sohamchitimali commited on
Commit
f57640b
·
1 Parent(s): 22be60d

Port Forwarding Problem Fix

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -906,12 +906,12 @@ with gr.Blocks(title="🏆 Hackathon-Winning Query System", theme=gr.themes.Defa
906
  outputs=[single_output]
907
  )
908
 
 
 
909
  if __name__ == "__main__":
910
- # The launch function will start a server, automatically handling both
911
- # the Gradio interface and your FastAPI endpoints on port 7860.
912
- # It will also correctly serve all necessary static files.
913
- demo.launch(
914
- server_name="0.0.0.0",
915
- server_port=7860,
916
- show_error=True
917
- )
 
906
  outputs=[single_output]
907
  )
908
 
909
+ app = gr.mount_gradio_app(api_app, demo, path="/")
910
+
911
  if __name__ == "__main__":
912
+ # We run this single, combined 'app' instance on port 7860.
913
+ # This is the correct way to run a combined app on a single public port.
914
+ # It ensures that both your API endpoints and your Gradio frontend
915
+ # are served from the same server and are both accessible.
916
+ import uvicorn
917
+ uvicorn.run(app, host="0.0.0.0", port=7860)