Update app.py
Browse filesremoved .to(device) from tokeniser and added to synthesise()
app.py
CHANGED
@@ -15,7 +15,7 @@ asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base",
|
|
15 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
16 |
|
17 |
model = VitsModel.from_pretrained("Matthijs/mms-tts-fra").to(device)
|
18 |
-
tokenizer = VitsTokenizer.from_pretrained("Matthijs/mms-tts-fra")
|
19 |
|
20 |
#embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
21 |
#speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
@@ -30,7 +30,7 @@ def synthesise(text):
|
|
30 |
#inputs = processor(text=text, return_tensors="pt")
|
31 |
#speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
|
32 |
inputs = tokenizer(text_example, return_tensors="pt")
|
33 |
-
input_ids = inputs["input_ids"]
|
34 |
|
35 |
|
36 |
with torch.no_grad():
|
|
|
15 |
#processor = SpeechT5Processor.from_pretrained("microsoft/speecht5_tts")
|
16 |
|
17 |
model = VitsModel.from_pretrained("Matthijs/mms-tts-fra").to(device)
|
18 |
+
tokenizer = VitsTokenizer.from_pretrained("Matthijs/mms-tts-fra")
|
19 |
|
20 |
#embeddings_dataset = load_dataset("Matthijs/cmu-arctic-xvectors", split="validation")
|
21 |
#speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze(0)
|
|
|
30 |
#inputs = processor(text=text, return_tensors="pt")
|
31 |
#speech = model.generate_speech(inputs["input_ids"].to(device), speaker_embeddings.to(device), vocoder=vocoder)
|
32 |
inputs = tokenizer(text_example, return_tensors="pt")
|
33 |
+
input_ids = inputs["input_ids"].to(device)
|
34 |
|
35 |
|
36 |
with torch.no_grad():
|