0

您好,我正在尝试使用 BERT 问答模型创建一个 .pb 或 .ckpt 文件,以便在转换后将其转换为 tflite 文件,正如官方 tensorflow 文档所说但我还不能得到它,非常感谢

!pip install transformers
from transformers import pipeline
nlp = pipeline("question-answering")
context = r"""
Extractive Question Answering is the task of extracting an answer 
from 
a text given a question. An example of a
question answering dataset is the SQuAD dataset, which is entirely 
based on that task. If you would like to fine-tune
a model on a SQuAD task, you may leverage the `run_squad.py`.
"""
print(nlp(question="What is extractive question answering?", 
context=context))
print(nlp(question="What is a good example of a question answering 
dataset?", context=context))
4

0 回答 0