Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
| 1 |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
| 2 |
import gradio as grad
|
| 3 |
import ast
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def answer_question(question,context):
|
| 8 |
text= "{"+"'question': '"+question+"','context': '"+context+"'}"
|
|
|
|
| 1 |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
| 2 |
import gradio as grad
|
| 3 |
import ast
|
| 4 |
+
|
| 5 |
+
#mdl_name = "deepset/roberta-base-squad2"
|
| 6 |
+
#my_pipeline = pipeline('question-answering', model=mdl_name, tokenizer=mdl_name)
|
| 7 |
+
|
| 8 |
+
mdl_name = "distilbert-base-cased-distilled-squad"
|
| 9 |
+
my_pipeline = pipeline('question-answering', model=mdl_name,tokenizer=mdl_name)
|
| 10 |
|
| 11 |
def answer_question(question,context):
|
| 12 |
text= "{"+"'question': '"+question+"','context': '"+context+"'}"
|