Skip to content

Commit

Permalink
Merge pull request #115 from 1chooo/ho-dev
Browse files Browse the repository at this point in the history
update: #114
  • Loading branch information
1chooo authored Sep 10, 2023
2 parents 71b82bf + 2bada6c commit 5dac104
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
15 changes: 11 additions & 4 deletions Refinaid/App/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -107,4 +112,6 @@ async def page_orders(request: Request, ):

@app.get("/favicon.ico")
async def favicon():
return FileResponse(os.getcwd()+demo.favicon_path)
return FileResponse(
os.getcwd() + demo.favicon_path
)
25 changes: 2 additions & 23 deletions Refinaid/gui/Launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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',
)

0 comments on commit 5dac104

Please sign in to comment.