Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ def translate_text(text, source_lang, target_lang):
|
|
| 77 |
num_return_sequences=1,
|
| 78 |
)
|
| 79 |
full_output = tokenizer.decode(translated_chunk[0], skip_special_tokens=True)
|
| 80 |
-
full_output = full_output.replace(
|
| 81 |
yield full_output
|
| 82 |
except Exception as e:
|
| 83 |
yield f"翻译出错: {str(e)}"
|
|
|
|
| 77 |
num_return_sequences=1,
|
| 78 |
)
|
| 79 |
full_output = tokenizer.decode(translated_chunk[0], skip_special_tokens=True)
|
| 80 |
+
full_output = full_output.replace(prompt.strip(),"")
|
| 81 |
yield full_output
|
| 82 |
except Exception as e:
|
| 83 |
yield f"翻译出错: {str(e)}"
|