oza75 commited on
Commit
8b0b40d
·
verified ·
1 Parent(s): b35a09e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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=5)
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