akshaylinson commited on
Commit
ff77bbd
·
1 Parent(s): 7ead558

fix: install f5_tts at runtime from bundled /app/IndicF5

Browse files
Files changed (2) hide show
  1. app.py +5 -3
  2. requirements.txt +0 -1
app.py CHANGED
@@ -21,12 +21,14 @@ _INDICF5_DIR = os.path.join(_BASE_DIR, "IndicF5")
21
  _ckpt_path = os.path.join(_INDICF5_DIR, "model.safetensors")
22
  _vocab_path = os.path.join(_INDICF5_DIR, "checkpoints", "vocab.txt")
23
 
24
- # Install f5_tts from bundled folder if not already importable
 
25
  try:
26
  import f5_tts
27
  except ImportError:
28
- import subprocess
29
- subprocess.run([sys.executable, "-m", "pip", "install", "-e", _INDICF5_DIR, "--quiet"], check=True)
 
30
 
31
  from f5_tts.infer.utils_infer import load_model, load_vocoder, preprocess_ref_audio_text, infer_process
32
  from f5_tts.model import DiT
 
21
  _ckpt_path = os.path.join(_INDICF5_DIR, "model.safetensors")
22
  _vocab_path = os.path.join(_INDICF5_DIR, "checkpoints", "vocab.txt")
23
 
24
+ # Install f5_tts from bundled IndicF5/ folder at startup
25
+ import subprocess
26
  try:
27
  import f5_tts
28
  except ImportError:
29
+ print(f"[INDICF5-SPACE] Installing f5_tts from {_INDICF5_DIR} …")
30
+ subprocess.run([sys.executable, "-m", "pip", "install", "-e", _INDICF5_DIR, "--quiet", "--no-deps"], check=True)
31
+ import f5_tts
32
 
33
  from f5_tts.infer.utils_infer import load_model, load_vocoder, preprocess_ref_audio_text, infer_process
34
  from f5_tts.model import DiT
requirements.txt CHANGED
@@ -9,4 +9,3 @@ transformers
9
  vocos
10
  einops
11
  x-transformers
12
- ./IndicF5
 
9
  vocos
10
  einops
11
  x-transformers