Upload folder using huggingface_hub
Browse files- 5.py +1 -0
- gradio_patch.py +27 -0
- 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 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
#
|
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
|
|
|
|
|
|
|
|