alonsosilva
commited on
Commit
•
c50c40d
1
Parent(s):
820c314
Update app.py
Browse files
app.py
CHANGED
@@ -46,11 +46,11 @@ def translate(text, input_language, output_language):
|
|
46 |
)
|
47 |
text = response["choices"][0]["message"]["content"]
|
48 |
translated_text = text
|
49 |
-
output_language = decapitalize(output_language)
|
50 |
-
output_language = to_language_code_dict[output_language]
|
51 |
return translated_text, output_language
|
52 |
|
53 |
def tts(text: str, language: str):
|
|
|
|
|
54 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
55 |
print(fp.name)
|
56 |
tts = gTTS(text, lang=language)
|
|
|
46 |
)
|
47 |
text = response["choices"][0]["message"]["content"]
|
48 |
translated_text = text
|
|
|
|
|
49 |
return translated_text, output_language
|
50 |
|
51 |
def tts(text: str, language: str):
|
52 |
+
language = decapitalize(language)
|
53 |
+
language = to_language_code_dict[language]
|
54 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
55 |
print(fp.name)
|
56 |
tts = gTTS(text, lang=language)
|