Update app.py
Browse files
app.py
CHANGED
|
@@ -2,11 +2,11 @@ import gradio as gr
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import torch
|
| 4 |
|
|
|
|
|
|
|
| 5 |
def answer_question(question, answer_text):
|
| 6 |
-
model_checkpoint = "MarcBrun/ixambert-finetuned-squad"
|
| 7 |
-
question_answerer = pipeline("question-answering", model=model_checkpoint)
|
| 8 |
|
| 9 |
-
answer =
|
| 10 |
|
| 11 |
return answer["answer"]
|
| 12 |
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import torch
|
| 4 |
|
| 5 |
+
qa = pipeline("question-answering", model="MarcBrun/ixambert-finetuned-squad")
|
| 6 |
+
|
| 7 |
def answer_question(question, answer_text):
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
answer = qa(question=question, context=answer_text)
|
| 10 |
|
| 11 |
return answer["answer"]
|
| 12 |
|