javi8979 commited on
Commit
1d16277
·
verified ·
1 Parent(s): ac24b2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -21,6 +21,7 @@ example_sentence = ["Ahir se'n va anar, va agafar les seves coses i es va posar
21
  @spaces.GPU(duration=120)
22
  def translate(input_text, source, target):
23
  sentences = input_text.split('\n')
 
24
  generated_text = []
25
  for sentence in sentences:
26
  prompt = f'[{source}] {sentence} \n[{target}]'
 
21
  @spaces.GPU(duration=120)
22
  def translate(input_text, source, target):
23
  sentences = input_text.split('\n')
24
+ sentences = [ s for s in sentences if len(s) > 1 ]
25
  generated_text = []
26
  for sentence in sentences:
27
  prompt = f'[{source}] {sentence} \n[{target}]'