Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: #114 #115

Merged
merged 1 commit into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
)