feaae commited on
Commit
5cca9c3
1 Parent(s): 5cdd9f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -17,7 +17,7 @@ for model_name in model_list:
17
 
18
  def translate(text, model_name):
19
  pipe = translation_pipelines[model_name]
20
- return pipe(text)[0]["translation_text"] if text else ''
21
 
22
  with gr.Blocks() as demo:
23
  with gr.Row():
 
17
 
18
  def translate(text, model_name):
19
  pipe = translation_pipelines[model_name]
20
+ return pipe(text)[0]["translation_text"] if text.strip() else ''
21
 
22
  with gr.Blocks() as demo:
23
  with gr.Row():