mhammad commited on
Commit
493d9a8
·
verified ·
1 Parent(s): a78cb42

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. 5.py +1 -0
  2. gradio_patch.py +27 -0
  3. requirements.txt +6 -10
5.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import threading
2
  import time
3
  import gradio as gr
 
1
+ import gradio_patch
2
  import threading
3
  import time
4
  import gradio as gr
gradio_patch.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Patch for Gradio's 'bool' is not iterable error
2
+ import sys
3
+
4
+ def patch_gradio():
5
+ try:
6
+ import gradio_client.utils
7
+
8
+ # Store the original get_type function
9
+ original_get_type = gradio_client.utils.get_type
10
+
11
+ # Create a fixed version that handles booleans
12
+ def patched_get_type(schema):
13
+ if isinstance(schema, bool):
14
+ return "bool"
15
+ return original_get_type(schema)
16
+
17
+ # Replace the original function with our patched version
18
+ gradio_client.utils.get_type = patched_get_type
19
+
20
+ print("✅ Gradio patch applied successfully")
21
+ except ImportError:
22
+ print("❌ Could not import gradio_client.utils to apply patch")
23
+ except Exception as e:
24
+ print(f"❌ Failed to apply Gradio patch: {str(e)}")
25
+
26
+ # Apply the patch immediately when this module is imported
27
+ patch_gradio()
requirements.txt CHANGED
@@ -1,10 +1,6 @@
1
- # Core packages with compatible versions
2
- gradio==3.50.2
3
- fastapi==0.103.2
4
- uvicorn==0.23.2
5
-
6
- # Your missing dependencies
7
- gtts==2.3.2
8
- openai==1.6.1
9
-
10
- # Add any other dependencies your application needs
 
1
+ gradio>=3.50.2
2
+ fastapi>=0.103.2
3
+ uvicorn>=0.23.2
4
+ gtts>=2.3.2
5
+ openai>=1.6.1
6
+ # Add any other dependencies your app needs