Downloads · 30 days
7
2% of all-time downloads
PoeticPaper/mbart-large-50_definition_zh_CN
mbart-large-50_definition_zh_CN is a machine learning model from PoeticPaper. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
The model can generate definition in Chinese. Usage: from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
Downloads · 30 days
7
2% of all-time downloads
All-time downloads
331
Public
Repo size
4.9 GB
Likes
0
Public
Click a slice to open those files.
.bin2.4 GB · 100%
From the Hugging Face model README
The model can generate definition in Chinese. Usage:
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, pipeline
checkpoint = 'PoeticPaper/mbart-large-50_definition_zh_CN'
tokenizer = AutoTokenizer.from_pretrained(checkpoint, src_lang="zh_CN", tgt_lang="zh_CN")
model = AutoModelForSeq2SeqLM.from_pretrained(checkpoint)
generator = pipeline(
task='text2text-generation',
model=model,
tokenizer=tokenizer,
forced_bos_token_id=tokenizer.lang_code_to_id["zh_CN"],
)
input = "define: 槌 context: 能够 带来 幸福 的 小 槌 吊饰 共有 金白 两色 。 definition:"
output = generator(input) # output will be: "圆柱形 的 物体 。""