umar-sharif821 commited on
Commit
75b0081
·
1 Parent(s): b5767ab

fix: Gradio 5 and env-driven host to fix HfFolder import error

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. requirements.txt +4 -4
app.py CHANGED
@@ -154,4 +154,7 @@ with gr.Blocks(title="CDN Cache Optimizer") as demo:
154
 
155
 
156
  if __name__ == "__main__":
157
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
 
 
154
 
155
 
156
  if __name__ == "__main__":
157
+ import os
158
+ host = os.environ.get("GRADIO_SERVER_NAME", "127.0.0.1")
159
+ port = int(os.environ.get("GRADIO_SERVER_PORT", "7860"))
160
+ demo.launch(server_name=host, server_port=port)
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- gradio==4.44.1
2
- pydantic==2.7.1
3
- matplotlib==3.8.4
4
- numpy==1.26.4
 
1
+ gradio>=5.0,<6
2
+ pydantic>=2.7,<3
3
+ matplotlib>=3.8
4
+ numpy>=1.26,<2