Spaces:
Sleeping
Sleeping
Michael Hu
commited on
Commit
·
77b7581
1
Parent(s):
2f1e419
fix bug
Browse files- utils/translation.py +1 -1
utils/translation.py
CHANGED
|
@@ -48,7 +48,7 @@ def translate_text(text):
|
|
| 48 |
# Generate translation with target language specification
|
| 49 |
outputs = model.generate(
|
| 50 |
**inputs,
|
| 51 |
-
forced_bos_token_id=tokenizer.convert_tokens_to_ids
|
| 52 |
max_new_tokens=1024
|
| 53 |
)
|
| 54 |
|
|
|
|
| 48 |
# Generate translation with target language specification
|
| 49 |
outputs = model.generate(
|
| 50 |
**inputs,
|
| 51 |
+
forced_bos_token_id=tokenizer.convert_tokens_to_ids("zho_Hans"),
|
| 52 |
max_new_tokens=1024
|
| 53 |
)
|
| 54 |
|