voicekit commited on
Commit Β·
6ef0473
1
Parent(s): 5c3b60e
Deploy voicekit v1.0 - Free AI Lip Sync Studio
Browse files
app.py
CHANGED
|
@@ -18,6 +18,26 @@ from pathlib import Path
|
|
| 18 |
|
| 19 |
import gradio as gr
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
# ββ Paths βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 22 |
MODELS_DIR = Path("/tmp/voicekit_models")
|
| 23 |
WAV2LIP_DIR = MODELS_DIR / "Wav2Lip"
|
|
|
|
| 18 |
|
| 19 |
import gradio as gr
|
| 20 |
|
| 21 |
+
# ββ Monkeypatch Gradio Client bug in Python 3.13 / Pydantic v2 βββββββββββββββ
|
| 22 |
+
try:
|
| 23 |
+
import gradio_client.utils
|
| 24 |
+
orig_get_type = gradio_client.utils.get_type
|
| 25 |
+
def patched_get_type(schema):
|
| 26 |
+
if isinstance(schema, bool):
|
| 27 |
+
return "any"
|
| 28 |
+
return orig_get_type(schema)
|
| 29 |
+
gradio_client.utils.get_type = patched_get_type
|
| 30 |
+
|
| 31 |
+
orig_json_schema_to_python_type = gradio_client.utils._json_schema_to_python_type
|
| 32 |
+
def patched_json_schema_to_python_type(schema, defs=None):
|
| 33 |
+
if isinstance(schema, bool):
|
| 34 |
+
return "any"
|
| 35 |
+
return orig_json_schema_to_python_type(schema, defs)
|
| 36 |
+
gradio_client.utils._json_schema_to_python_type = patched_json_schema_to_python_type
|
| 37 |
+
print("[patch] Gradio Client JSON schema parser patched successfully.")
|
| 38 |
+
except Exception as patch_err:
|
| 39 |
+
print(f"[patch] Failed to apply Gradio Client patch: {patch_err}")
|
| 40 |
+
|
| 41 |
# ββ Paths βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 42 |
MODELS_DIR = Path("/tmp/voicekit_models")
|
| 43 |
WAV2LIP_DIR = MODELS_DIR / "Wav2Lip"
|