Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,16 @@ import torch
|
|
5 |
import io
|
6 |
import soundfile as sf
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Initialize ASR pipeline
|
9 |
print("TTS Tokenizer:", tokenizer_tts) # Print the tokenizer for the TTS model
|
10 |
|
|
|
5 |
import io
|
6 |
import soundfile as sf
|
7 |
|
8 |
+
# Initialize ASR pipeline
|
9 |
+
transcriber = pipeline("automatic-speech-recognition", model="facebook/s2t-small-librispeech-asr")
|
10 |
+
|
11 |
+
# Initialize LLM pipeline
|
12 |
+
generator = pipeline("text-generation", model="microsoft/Phi-3-mini-4k-instruct", trust_remote_code=True)
|
13 |
+
|
14 |
+
# Initialize TTS tokenizer and model
|
15 |
+
tokenizer_tts = VitsTokenizer.from_pretrained("facebook/mms-tts-eng")
|
16 |
+
model_tts = VitsModel.from_pretrained("facebook/mms-tts-eng")
|
17 |
+
|
18 |
# Initialize ASR pipeline
|
19 |
print("TTS Tokenizer:", tokenizer_tts) # Print the tokenizer for the TTS model
|
20 |
|