Spaces:
Sleeping
Sleeping
Commit ·
365daa1
1
Parent(s): 3676be8
Gradio Fix
Browse files
app.py
CHANGED
|
@@ -1167,19 +1167,28 @@ with gr.Blocks(
|
|
| 1167 |
outputs=[single_output]
|
| 1168 |
)
|
| 1169 |
|
| 1170 |
-
# Mount Gradio on FastAPI
|
| 1171 |
-
app = gr.mount_gradio_app(api_app, demo, path="/")
|
| 1172 |
-
|
| 1173 |
# Main execution
|
| 1174 |
if __name__ == "__main__":
|
| 1175 |
print("🚀 Starting Deployment-Ready Document QA System...")
|
| 1176 |
print(f"📊 Gradio version: {gr.__version__}")
|
| 1177 |
|
| 1178 |
# Run the application
|
| 1179 |
-
|
| 1180 |
-
|
| 1181 |
-
|
| 1182 |
-
|
| 1183 |
-
|
| 1184 |
-
|
| 1185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1167 |
outputs=[single_output]
|
| 1168 |
)
|
| 1169 |
|
|
|
|
|
|
|
|
|
|
| 1170 |
# Main execution
|
| 1171 |
if __name__ == "__main__":
|
| 1172 |
print("🚀 Starting Deployment-Ready Document QA System...")
|
| 1173 |
print(f"📊 Gradio version: {gr.__version__}")
|
| 1174 |
|
| 1175 |
# Run the application
|
| 1176 |
+
# ------------------ DELETE THIS BLOCK ------------------
|
| 1177 |
+
# uvicorn.run(
|
| 1178 |
+
# app,
|
| 1179 |
+
# host="0.0.0.0",
|
| 1180 |
+
# port=7860,
|
| 1181 |
+
# log_level="info",
|
| 1182 |
+
# access_log=False # Reduce log noise
|
| 1183 |
+
# )
|
| 1184 |
+
# --------------------------------------------------------
|
| 1185 |
+
|
| 1186 |
+
# -------------------- ADD THIS INSTEAD --------------------
|
| 1187 |
+
if __name__ == "__main__":
|
| 1188 |
+
print("🚀 Starting Deployment-Ready Document QA System...")
|
| 1189 |
+
print(f"📊 Gradio version: {gr.__version__}")
|
| 1190 |
+
|
| 1191 |
+
# Launch the app using Gradio's built-in server
|
| 1192 |
+
# This will also serve the FastAPI 'app' object
|
| 1193 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 1194 |
+
# --------------------------------------------------------
|