Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,8 @@ import soundfile as sf
|
|
| 6 |
translation_model = pipeline("translation_en_to_ur", model="Helsinki-NLP/opus-mt-en-ur")
|
| 7 |
reverse_translation_model = pipeline("translation_ur_to_en", model="Helsinki-NLP/opus-mt-ur-en")
|
| 8 |
|
| 9 |
-
# Initialize text-to-speech model
|
| 10 |
-
tts_model = pipeline("text-to-speech", model="
|
| 11 |
|
| 12 |
# Function to translate text and provide feedback
|
| 13 |
def translate_and_speak(text, direction):
|
|
|
|
| 6 |
translation_model = pipeline("translation_en_to_ur", model="Helsinki-NLP/opus-mt-en-ur")
|
| 7 |
reverse_translation_model = pipeline("translation_ur_to_en", model="Helsinki-NLP/opus-mt-ur-en")
|
| 8 |
|
| 9 |
+
# Initialize text-to-speech model (English to Speech)
|
| 10 |
+
tts_model = pipeline("text-to-speech", model="espnet/kan-bayashi_ljspeech")
|
| 11 |
|
| 12 |
# Function to translate text and provide feedback
|
| 13 |
def translate_and_speak(text, direction):
|