[9930f0]: / src / app.py

Download this file

19 lines (12 with data), 412 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
from fastapi import FastAPI, responses
import gradio as gr
from src.model_interface import iface
from fastapi.staticfiles import StaticFiles
from dotenv import load_dotenv
load_dotenv()
app = FastAPI()
app.mount("/static", StaticFiles(directory="static"), name="static")
@app.get("/")
def index():
return responses.FileResponse("pages/index.html")
app = gr.mount_gradio_app(app, iface, path="/gradio")