ykirpichev
commited on
Commit
·
4bd34af
1
Parent(s):
b1b6065
Update app.py
Browse files
app.py
CHANGED
@@ -31,8 +31,15 @@ def translate(audio):
|
|
31 |
|
32 |
|
33 |
def synthesise(text):
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
inputs = processor(text=text, return_tensors="pt")
|
35 |
speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
|
|
|
36 |
return speech.cpu()
|
37 |
|
38 |
|
|
|
31 |
|
32 |
|
33 |
def synthesise(text):
|
34 |
+
inputs = tokenizer_mms(text, return_tensors="pt")
|
35 |
+
input_ids = inputs["input_ids"]
|
36 |
+
with torch.no_grad():
|
37 |
+
outputs = model_mms(input_ids)
|
38 |
+
print(outputs)
|
39 |
+
|
40 |
inputs = processor(text=text, return_tensors="pt")
|
41 |
speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
|
42 |
+
print(speech)
|
43 |
return speech.cpu()
|
44 |
|
45 |
|