Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
from transformers import pipeline
|
2 |
|
3 |
-
tts = pipeline("text-to-speech", model="julien-c/ljspeech_tts_train_tacotron2_raw_phn_tacotron_g2p_en_no_space_train")
|
4 |
-
|
5 |
# Initialize the translation pipeline for Russian to English
|
6 |
translator = pipeline("translation_ru_to_en", model="Helsinki-NLP/opus-mt-ru-en")
|
7 |
|
@@ -18,11 +16,4 @@ print("Translated Text: ", translation)
|
|
18 |
# Summarize the translated text
|
19 |
summary = summarizer(translation, max_length=140, min_length=110, do_sample=False)[0]['summary_text']
|
20 |
|
21 |
-
print("Summary: ", summary)
|
22 |
-
|
23 |
-
speech = tts(summary)
|
24 |
-
|
25 |
-
# The output is a list of PyTorch tensors containing the audio data
|
26 |
-
# Let's save the first (and only) audio sample to a file
|
27 |
-
with open("output1.wav", "wb") as f:
|
28 |
-
f.write(speech[0]["file"].read())
|
|
|
1 |
from transformers import pipeline
|
2 |
|
|
|
|
|
3 |
# Initialize the translation pipeline for Russian to English
|
4 |
translator = pipeline("translation_ru_to_en", model="Helsinki-NLP/opus-mt-ru-en")
|
5 |
|
|
|
16 |
# Summarize the translated text
|
17 |
summary = summarizer(translation, max_length=140, min_length=110, do_sample=False)[0]['summary_text']
|
18 |
|
19 |
+
print("Summary: ", summary)
|
|
|
|
|
|
|
|
|
|
|
|
|
|