solve patch
Browse files- patch_gradio.py +3 -4
patch_gradio.py
CHANGED
@@ -1,18 +1,17 @@
|
|
1 |
# Create a file called patch_gradio.py
|
2 |
-
from types import MethodType
|
3 |
import gradio_client.utils
|
4 |
|
5 |
# Store the original function
|
6 |
original_get_type = gradio_client.utils.get_type
|
7 |
|
8 |
# Define the patched function
|
9 |
-
def patched_get_type(
|
10 |
# Add type checking before using 'in' operator
|
11 |
if not isinstance(schema, dict):
|
12 |
return str(schema) # Convert to string as fallback
|
13 |
|
14 |
# Original function logic
|
15 |
-
return original_get_type(
|
16 |
|
17 |
# Apply the patch
|
18 |
-
gradio_client.utils.get_type =
|
|
|
1 |
# Create a file called patch_gradio.py
|
|
|
2 |
import gradio_client.utils
|
3 |
|
4 |
# Store the original function
|
5 |
original_get_type = gradio_client.utils.get_type
|
6 |
|
7 |
# Define the patched function
|
8 |
+
def patched_get_type(schema):
|
9 |
# Add type checking before using 'in' operator
|
10 |
if not isinstance(schema, dict):
|
11 |
return str(schema) # Convert to string as fallback
|
12 |
|
13 |
# Original function logic
|
14 |
+
return original_get_type(schema)
|
15 |
|
16 |
# Apply the patch
|
17 |
+
gradio_client.utils.get_type = patched_get_type
|