Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,7 @@ def translate_text(text: str, source_lang: str, target_lang: str) -> str:
|
|
65 |
logger.info(f"Translating text from {source_lang} to {target_lang}.")
|
66 |
try:
|
67 |
# Perform translation using the Hugging Face pipeline
|
68 |
-
result = translator(text, src_lang=source_lang, tgt_lang=target_lang, num_beams=
|
69 |
translated_text = result[0]['translation_text']
|
70 |
logger.info("Translation successful.")
|
71 |
return translated_text
|
|
|
65 |
logger.info(f"Translating text from {source_lang} to {target_lang}.")
|
66 |
try:
|
67 |
# Perform translation using the Hugging Face pipeline
|
68 |
+
result = translator(text, src_lang=source_lang, tgt_lang=target_lang, num_beams=2)
|
69 |
translated_text = result[0]['translation_text']
|
70 |
logger.info("Translation successful.")
|
71 |
return translated_text
|