Add colab link
Browse files
README.md
CHANGED
@@ -15,6 +15,7 @@ widget:
|
|
15 |
- `对联:您的上联`,比如 `对联:北国风光,千里冰封,万里雪飘`
|
16 |
- 如果你想尝试
|
17 |
- 如果自己有GPU环境,可以参考我放在huggingface的[示例代码](https://huggingface.co/hululuzhu/chinese-couplet-t5-mengzi-finetune#%E8%BF%90%E8%A1%8C%E4%BB%A3%E7%A0%81%E7%A4%BA%E4%BE%8B)
|
|
|
18 |
- 训练代码请参考[我的github链接](https://github.com/hululuzhu/chinese-ai-writing-share)
|
19 |
- 如果想了解一些背景和讨论,可以看我的[slides](https://github.com/hululuzhu/chinese-ai-writing-share/tree/main/slides)
|
20 |
|
@@ -60,7 +61,7 @@ MAX_OUT_TOKENS = MAX_SEQ_LEN
|
|
60 |
|
61 |
def couplet(in_str, model=couplet_model,
|
62 |
is_input_traditional_chinese=False,
|
63 |
-
num_beams=
|
64 |
model.model = model.model.to('cuda')
|
65 |
in_request = f"{COUPLET_PROMPOT}{in_str[:MAX_SEQ_LEN]}"
|
66 |
if is_input_traditional_chinese:
|
|
|
15 |
- `对联:您的上联`,比如 `对联:北国风光,千里冰封,万里雪飘`
|
16 |
- 如果你想尝试
|
17 |
- 如果自己有GPU环境,可以参考我放在huggingface的[示例代码](https://huggingface.co/hululuzhu/chinese-couplet-t5-mengzi-finetune#%E8%BF%90%E8%A1%8C%E4%BB%A3%E7%A0%81%E7%A4%BA%E4%BE%8B)
|
18 |
+
- 或者使用Google colab可以用这个[简单的colab notebook](https://colab.research.google.com/github/hululuzhu/chinese-ai-writing-share/blob/main/inference/2022_simple_couplet_inference_huggingface.ipynb)
|
19 |
- 训练代码请参考[我的github链接](https://github.com/hululuzhu/chinese-ai-writing-share)
|
20 |
- 如果想了解一些背景和讨论,可以看我的[slides](https://github.com/hululuzhu/chinese-ai-writing-share/tree/main/slides)
|
21 |
|
|
|
61 |
|
62 |
def couplet(in_str, model=couplet_model,
|
63 |
is_input_traditional_chinese=False,
|
64 |
+
num_beams=2):
|
65 |
model.model = model.model.to('cuda')
|
66 |
in_request = f"{COUPLET_PROMPOT}{in_str[:MAX_SEQ_LEN]}"
|
67 |
if is_input_traditional_chinese:
|