We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
尊敬的作者您好! 看了您的代码我受益匪浅,下面有一个问题请您指教, 我看到[Hugging Face]中有关T5预训练模型的推理代码,直接用transformers库推理的,如下: from transformers import BertTokenizer, T5ForConditionalGeneration, Text2TextGenerationPipeline tokenizer = BertTokenizer.from_pretrained("uer/t5-small-chinese-cluecorpussmall") model = T5ForConditionalGeneration.from_pretrained("uer/t5-small-chinese-cluecorpussmall") text2text_generator = Text2TextGenerationPipeline(model, tokenizer) text2text_generator("中国的首都是extra0京", max_length=50, do_sample=False) [{'generated_text': 'extra0 北 extra1 extra2 extra3 extra4 extra5'}] 请问一下UER风格的预训练T5模型如何推理,得到类似上面的效果?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
尊敬的作者您好!
看了您的代码我受益匪浅,下面有一个问题请您指教,
我看到[Hugging Face]中有关T5预训练模型的推理代码,直接用transformers库推理的,如下:
from transformers import BertTokenizer, T5ForConditionalGeneration, Text2TextGenerationPipeline
tokenizer = BertTokenizer.from_pretrained("uer/t5-small-chinese-cluecorpussmall")
model = T5ForConditionalGeneration.from_pretrained("uer/t5-small-chinese-cluecorpussmall")
text2text_generator = Text2TextGenerationPipeline(model, tokenizer)
text2text_generator("中国的首都是extra0京", max_length=50, do_sample=False)
[{'generated_text': 'extra0 北 extra1 extra2 extra3 extra4 extra5'}]
请问一下UER风格的预训练T5模型如何推理,得到类似上面的效果?
The text was updated successfully, but these errors were encountered: