Spaces:
Runtime error
Runtime error
Commit Β·
6863c79
1
Parent(s): 5456a1f
bundle IndicF5 model and fix paths
Browse files- IndicF5 +1 -0
- app.py +10 -5
- requirements.txt +0 -2
IndicF5
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Subproject commit 13f7c4d627cc10111aea8fe9c0039462cacacdc7
|
app.py
CHANGED
|
@@ -15,16 +15,21 @@ import spaces
|
|
| 15 |
import torch
|
| 16 |
from fastapi import FastAPI, File, Form, UploadFile, HTTPException
|
| 17 |
from fastapi.responses import Response, JSONResponse
|
| 18 |
-
from huggingface_hub import snapshot_download
|
| 19 |
|
| 20 |
# ββ load model once at startup ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 21 |
-
MODEL_REPO = "ai4bharat/IndicF5"
|
| 22 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 23 |
print(f"[INDICF5-SPACE] Loading model on {DEVICE} β¦")
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
from f5_tts.infer.utils_infer import (
|
| 30 |
load_model,
|
|
|
|
| 15 |
import torch
|
| 16 |
from fastapi import FastAPI, File, Form, UploadFile, HTTPException
|
| 17 |
from fastapi.responses import Response, JSONResponse
|
|
|
|
| 18 |
|
| 19 |
# ββ load model once at startup ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 20 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
print(f"[INDICF5-SPACE] Loading model on {DEVICE} β¦")
|
| 22 |
|
| 23 |
+
# Model files are bundled in the IndicF5/ subfolder β no download needed
|
| 24 |
+
_BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 25 |
+
_INDICF5_DIR = os.path.join(_BASE_DIR, "IndicF5")
|
| 26 |
+
_ckpt_path = os.path.join(_INDICF5_DIR, "model.safetensors")
|
| 27 |
+
_vocab_path = os.path.join(_INDICF5_DIR, "checkpoints", "vocab.txt")
|
| 28 |
+
|
| 29 |
+
# Install f5_tts from the bundled repo
|
| 30 |
+
import sys
|
| 31 |
+
if _INDICF5_DIR not in sys.path:
|
| 32 |
+
sys.path.insert(0, _INDICF5_DIR)
|
| 33 |
|
| 34 |
from f5_tts.infer.utils_infer import (
|
| 35 |
load_model,
|
requirements.txt
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
gradio==4.44.0
|
| 2 |
-
huggingface_hub==0.24.0
|
| 3 |
spaces
|
| 4 |
fastapi
|
| 5 |
python-multipart
|
|
@@ -10,4 +9,3 @@ transformers
|
|
| 10 |
vocos
|
| 11 |
einops
|
| 12 |
x-transformers
|
| 13 |
-
git+https://github.com/AI4Bharat/IndicF5.git
|
|
|
|
| 1 |
gradio==4.44.0
|
|
|
|
| 2 |
spaces
|
| 3 |
fastapi
|
| 4 |
python-multipart
|
|
|
|
| 9 |
vocos
|
| 10 |
einops
|
| 11 |
x-transformers
|
|
|