diff --git a/Refinaid/App/app.py b/Refinaid/App/app.py index aa56158..7d6f12c 100644 --- a/Refinaid/App/app.py +++ b/Refinaid/App/app.py @@ -7,7 +7,7 @@ import os from fastapi import FastAPI, Request from fastapi.templating import Jinja2Templates -from fastapi.responses import HTMLResponse ,FileResponse +from fastapi.responses import HTMLResponse, FileResponse from fastapi.staticfiles import StaticFiles from fastapi import Form, Depends, HTTPException import gradio as gr @@ -28,9 +28,14 @@ templates = Jinja2Templates(directory="templates") demo = build_ui() -demo.favicon_path = os.sep+"static"+os.sep+"favicon.png" +demo.favicon_path = ( + os.sep + + "static" + + os.sep + + "favicon.png" +) app = gr.mount_gradio_app( - app, demo, path=PLAYGROUND_PATH , + app, demo, path=PLAYGROUND_PATH, ) @app.get("/", response_class=HTMLResponse) @@ -107,4 +112,6 @@ async def page_orders(request: Request, ): @app.get("/favicon.ico") async def favicon(): - return FileResponse(os.getcwd()+demo.favicon_path) \ No newline at end of file + return FileResponse( + os.getcwd() + demo.favicon_path + ) diff --git a/Refinaid/gui/Launch.py b/Refinaid/gui/Launch.py index b065428..590a945 100644 --- a/Refinaid/gui/Launch.py +++ b/Refinaid/gui/Launch.py @@ -25,11 +25,10 @@ def build_ui(*args: Any, **kwargs: Any) -> gr.Blocks: training_history_component = TrainingHistoryComponent(page_content) preprocessing_example = PreprocessingExample() - demo = gr.Blocks( + demo: gr.Blocks = gr.Blocks( title='Refinaid', - ) - demo.favicon_path = os.sep+"static"+os.sep+"favicon.png" + with demo: our_heading = page_header.get_home_header() @@ -136,16 +135,6 @@ def build_ui(*args: Any, **kwargs: Any) -> gr.Blocks: training_history, ) = training_history_component.get_history_training_info() - # with gr.Tab("Teaching"): - # teaching_header = gr.Markdown( - # "## Teaching" - # ) - - # with gr.Tab("Demo"): - # demo_header = gr.Markdown( - # "## Demo" - # ) - background_listener( selected_dataset_name, select_mutiple_parameters_dropdown, @@ -180,13 +169,3 @@ def build_ui(*args: Any, **kwargs: Any) -> gr.Blocks: ) return demo - - demo.launch( - # enable_queue=True, - # share=True, - server_name="127.0.0.1", - server_port=6006, - debug=True, - # inbrowser=True, - # favicon_path='add_our_favicon_path', - )