Spaces:
Running
on
Zero
Running
on
Zero
ttsteam
commited on
Commit
·
7516f78
1
Parent(s):
9938c8d
IndicF5
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import io
|
|
|
2 |
import librosa
|
3 |
import requests
|
4 |
import tempfile
|
@@ -42,6 +43,8 @@ def synthesize_speech(text, ref_audio, ref_text):
|
|
42 |
# Load TTS model
|
43 |
repo_id = "ai4bharat/IndicF5"
|
44 |
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True)
|
|
|
|
|
45 |
|
46 |
# Example Data (Multiple Examples)
|
47 |
EXAMPLES = [
|
|
|
1 |
import io
|
2 |
+
import torch
|
3 |
import librosa
|
4 |
import requests
|
5 |
import tempfile
|
|
|
43 |
# Load TTS model
|
44 |
repo_id = "ai4bharat/IndicF5"
|
45 |
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True)
|
46 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
47 |
+
model = model.to(device)
|
48 |
|
49 |
# Example Data (Multiple Examples)
|
50 |
EXAMPLES = [
|