Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from app import app as fastapi_app | |
| # --------------------------- | |
| # Root Gradio App | |
| # --------------------------- | |
| with gr.Blocks() as demo: | |
| gr.Markdown( | |
| """ | |
| # Car Damage Detector | |
| Use the API endpoints directly. | |
| """ | |
| ) | |
| # --------------------------- | |
| # Mount FastAPI INSIDE Gradio | |
| # --------------------------- | |
| app = gr.mount_gradio_app( | |
| demo, # Gradio must be the ROOT app | |
| fastapi_app, # FastAPI is mounted inside it | |
| path="/" # API available at / | |
| ) | |