Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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}]'
|