Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,9 +79,9 @@ def call_langflow(message, history):
|
|
| 79 |
return f"Error parsing response: {str(e)}\nResponse: {data}"
|
| 80 |
|
| 81 |
#Create FastAPI App for health check.
|
| 82 |
-
|
| 83 |
# Optional CORS setup
|
| 84 |
-
|
| 85 |
CORSMiddleware,
|
| 86 |
allow_origins=["*"],
|
| 87 |
allow_credentials=True,
|
|
@@ -112,4 +112,4 @@ with gr.Blocks(
|
|
| 112 |
)
|
| 113 |
|
| 114 |
# Mount Gradio app to FastAPI at root path
|
| 115 |
-
app = gr.mount_gradio_app(
|
|
|
|
| 79 |
return f"Error parsing response: {str(e)}\nResponse: {data}"
|
| 80 |
|
| 81 |
#Create FastAPI App for health check.
|
| 82 |
+
fastapi_app = FastAPI(title="Chatbot with Ping API")
|
| 83 |
# Optional CORS setup
|
| 84 |
+
fastapi_app.add_middleware(
|
| 85 |
CORSMiddleware,
|
| 86 |
allow_origins=["*"],
|
| 87 |
allow_credentials=True,
|
|
|
|
| 112 |
)
|
| 113 |
|
| 114 |
# Mount Gradio app to FastAPI at root path
|
| 115 |
+
app = gr.mount_gradio_app(fastapi_appapp, demo, path="/")
|