Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ def translation_to_French(api_key, text):
|
|
| 31 |
if not response_translation or not response_translation.candidates:
|
| 32 |
return "Error: No translation returned from Gemini API.", None
|
| 33 |
|
| 34 |
-
translated = response_translation.
|
| 35 |
|
| 36 |
# Pronunciation prompt
|
| 37 |
pronunciation_prompt = (
|
|
@@ -51,7 +51,7 @@ def translation_to_French(api_key, text):
|
|
| 51 |
if not response_pronunciation or not response_pronunciation.candidates:
|
| 52 |
return translated, "Error: No pronunciation returned from Gemini API."
|
| 53 |
|
| 54 |
-
pronunciation = response_pronunciation.
|
| 55 |
|
| 56 |
return translated, pronunciation
|
| 57 |
|
|
|
|
| 31 |
if not response_translation or not response_translation.candidates:
|
| 32 |
return "Error: No translation returned from Gemini API.", None
|
| 33 |
|
| 34 |
+
translated = response_translation.text.strip()
|
| 35 |
|
| 36 |
# Pronunciation prompt
|
| 37 |
pronunciation_prompt = (
|
|
|
|
| 51 |
if not response_pronunciation or not response_pronunciation.candidates:
|
| 52 |
return translated, "Error: No pronunciation returned from Gemini API."
|
| 53 |
|
| 54 |
+
pronunciation = response_pronunciation.text.strip()
|
| 55 |
|
| 56 |
return translated, pronunciation
|
| 57 |
|