Spaces:
Sleeping
Sleeping
Walid-Ahmed
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,8 @@ from transformers import pipeline
|
|
3 |
import chardet
|
4 |
|
5 |
# Initialize the question-answering pipeline
|
6 |
-
qa_pipeline = pipeline("question-answering",model="deepset/roberta-base-squad2")
|
7 |
-
|
8 |
def answer_question(context, question):
|
9 |
result = qa_pipeline(question=question, context=context)
|
10 |
return result['answer']
|
|
|
3 |
import chardet
|
4 |
|
5 |
# Initialize the question-answering pipeline
|
6 |
+
#qa_pipeline = pipeline("question-answering",model="deepset/roberta-base-squad2")
|
7 |
+
question_answer = pipeline("question-answering",model="distilbert-base-cased-distilled-squad")
|
8 |
def answer_question(context, question):
|
9 |
result = qa_pipeline(question=question, context=context)
|
10 |
return result['answer']
|