Update README_zh-CN.md
Browse files- README_zh-CN.md +3 -3
README_zh-CN.md
CHANGED
@@ -24,13 +24,13 @@ tokenizer = AutoTokenizer.from_pretrained(model_path)
|
|
24 |
|
25 |
def translate(
|
26 |
text: str,
|
27 |
-
to: Literal["
|
28 |
**kwargs
|
29 |
):
|
30 |
generation_args = dict(
|
31 |
max_new_tokens = kwargs.pop("max_new_tokens", 512),
|
32 |
do_sample = kwargs.pop("do_sample", True),
|
33 |
-
temperature = kwargs.pop("temperature", 0.
|
34 |
top_p = kwargs.pop("top_p", 0.8),
|
35 |
top_k = kwargs.pop("top_k", 40),
|
36 |
**kwargs
|
@@ -61,7 +61,7 @@ def translate(
|
|
61 |
return response
|
62 |
|
63 |
text = "After a long day at work, I love to unwind by cooking a nice dinner and watching my favorite TV series. It really helps me relax and recharge for the next day."
|
64 |
-
response = translate(text=text, to='
|
65 |
print(f'Translation: {response}')
|
66 |
|
67 |
"""
|
|
|
24 |
|
25 |
def translate(
|
26 |
text: str,
|
27 |
+
to: Literal["Chinese", "English"] = "Chinese",
|
28 |
**kwargs
|
29 |
):
|
30 |
generation_args = dict(
|
31 |
max_new_tokens = kwargs.pop("max_new_tokens", 512),
|
32 |
do_sample = kwargs.pop("do_sample", True),
|
33 |
+
temperature = kwargs.pop("temperature", 0.55),
|
34 |
top_p = kwargs.pop("top_p", 0.8),
|
35 |
top_k = kwargs.pop("top_k", 40),
|
36 |
**kwargs
|
|
|
61 |
return response
|
62 |
|
63 |
text = "After a long day at work, I love to unwind by cooking a nice dinner and watching my favorite TV series. It really helps me relax and recharge for the next day."
|
64 |
+
response = translate(text=text, to='Chinese')
|
65 |
print(f'Translation: {response}')
|
66 |
|
67 |
"""
|