Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from fastapi import FastAPI
|
| 3 |
+
from app.main import app as fastapi_app # Import your existing FastAPI app
|
| 4 |
+
|
| 5 |
+
# Create a dummy Gradio interface (just a placeholder screen)
|
| 6 |
+
with gr.Blocks() as demo:
|
| 7 |
+
gr.Markdown("# Moderation API")
|
| 8 |
+
gr.Markdown("This is an API service. Please send POST requests to `/api/v1/moderate`.")
|
| 9 |
+
|
| 10 |
+
# Mount your FastAPI app onto the Gradio app
|
| 11 |
+
app = gr.mount_gradio_app(fastapi_app, demo, path="/")
|