Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from email.policy import default
|
| 2 |
from json import encoder
|
| 3 |
import gradio as gr
|
|
@@ -6,8 +21,6 @@ import numpy as np
|
|
| 6 |
import torch
|
| 7 |
import requests
|
| 8 |
import random
|
| 9 |
-
import os
|
| 10 |
-
import sys
|
| 11 |
import pickle
|
| 12 |
from PIL import Image
|
| 13 |
from tqdm.auto import tqdm
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys# Add the current directory to path if needed
|
| 3 |
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
| 4 |
+
# Apply the patch
|
| 5 |
+
import gradio_client.utils as client_utils
|
| 6 |
+
from patch_utils import json_schema_to_python_type, _json_schema_to_python_type, get_type, get_desc
|
| 7 |
+
|
| 8 |
+
# Override the functions with your patched versions
|
| 9 |
+
client_utils.json_schema_to_python_type = json_schema_to_python_type
|
| 10 |
+
client_utils._json_schema_to_python_type = _json_schema_to_python_type
|
| 11 |
+
client_utils.get_type = get_type
|
| 12 |
+
# Add the missing get_desc function
|
| 13 |
+
if not hasattr(client_utils, 'get_desc'):
|
| 14 |
+
client_utils.get_desc = get_desc
|
| 15 |
+
|
| 16 |
from email.policy import default
|
| 17 |
from json import encoder
|
| 18 |
import gradio as gr
|
|
|
|
| 21 |
import torch
|
| 22 |
import requests
|
| 23 |
import random
|
|
|
|
|
|
|
| 24 |
import pickle
|
| 25 |
from PIL import Image
|
| 26 |
from tqdm.auto import tqdm
|