📜  罗伯塔推理 TensorFlow - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:53.950000             🧑  作者: Mango

代码示例1
from transformers import RobertaTokenizer, TFRobertaModel
tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
model = TFRobertaModel.from_pretrained('roberta-base')
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='tf')
output = model(encoded_input)