Aguilar Elizondo commited on
Commit
f79b01f
·
1 Parent(s): fcfb70e

Try Gradio 4.20.0 to avoid launch bug

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +13 -1
  3. requirements.txt +1 -1
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: 🏗️
4
  colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 4.44.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: blue
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.20.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -101,4 +101,16 @@ iface = gr.Interface(
101
  )
102
 
103
  if __name__ == "__main__":
104
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  )
102
 
103
  if __name__ == "__main__":
104
+ # Check if running on HF Spaces
105
+ is_spaces = os.getenv("SPACE_ID") is not None
106
+
107
+ if is_spaces:
108
+ # HF Spaces specific configuration
109
+ iface.launch(
110
+ server_name="0.0.0.0",
111
+ server_port=7860,
112
+ share=False
113
+ )
114
+ else:
115
+ # Local development
116
+ iface.launch(share=True)
requirements.txt CHANGED
@@ -16,7 +16,7 @@ numpy>=1.24.0
16
  basicsr>=1.4.2
17
 
18
  # Gradio interface
19
- gradio==4.44.1
20
 
21
  # Configuration
22
  pydantic>=2.5.0
 
16
  basicsr>=1.4.2
17
 
18
  # Gradio interface
19
+ gradio==4.20.0
20
 
21
  # Configuration
22
  pydantic>=2.5.0