How to save-freeze-generate a .pb or .ckpt file for transformers and squad dataset?

Hello, I am trying to create a .pb or .ckpt file with a BERT Question Answer model to after the transformation convert it into a tflite file as the official tensorflow documentation says but I can't get it yet, thank you very much

!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))

Upvotes: 0

Views: 211

Answers (0)

Related Questions