voicekit commited on
Commit
6ef0473
Β·
1 Parent(s): 5c3b60e

Deploy voicekit v1.0 - Free AI Lip Sync Studio

Browse files
Files changed (1) hide show
  1. app.py +20 -0
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"