run480 commited on
Commit
a0d3657
1 Parent(s): f6f725c

Update app.py

Browse files

Try same paragraph and question on a different model: distilbert-base-cased-distilled-squad.

Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -2,9 +2,13 @@ from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
2
  import gradio as grad
3
  import ast
4
 
5
- # First, the RoBERTa base model is used, fine-tuned using the SQuAD 2.0 dataset.
6
  # It’s been trained on question-answer pairs, including unanswerable questions, for the task of question and answering.
7
- mdl_name = "deepset/roberta-base-squad2"
 
 
 
 
8
  my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
9
 
10
  def answer_question(question,context):
 
2
  import gradio as grad
3
  import ast
4
 
5
+ # 1. The RoBERTa base model is used, fine-tuned using the SQuAD 2.0 dataset.
6
  # It’s been trained on question-answer pairs, including unanswerable questions, for the task of question and answering.
7
+ # mdl_name = "deepset/roberta-base-squad2"
8
+ # my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
9
+
10
+ # 2. Different model.
11
+ mdl_name = "distilbert-base-cased-distilled-squad"
12
  my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
13
 
14
  def answer_question(question,context):