Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,14 +6,6 @@ from transformers import pipeline
|
|
| 6 |
from transformers import AutoTokenizer
|
| 7 |
from spaces_info import description
|
| 8 |
|
| 9 |
-
if __name__ == "__main__":
|
| 10 |
-
demo = gr.Blocks()
|
| 11 |
-
with demo:
|
| 12 |
-
with gr.Row():
|
| 13 |
-
gr.Markdown(value=description)
|
| 14 |
-
|
| 15 |
-
demo.launch()
|
| 16 |
-
|
| 17 |
# Initializing the pipeline for the question answering model
|
| 18 |
question_answerer = pipeline("question-answering", model="Only-Mike/ADHD_Test_qa_model")
|
| 19 |
|
|
@@ -22,7 +14,14 @@ def question_answer(question, context):
|
|
| 22 |
result = question_answerer(question=question, context=context)
|
| 23 |
return result["answer"]
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
|
|
|
|
| 6 |
from transformers import AutoTokenizer
|
| 7 |
from spaces_info import description
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# Initializing the pipeline for the question answering model
|
| 10 |
question_answerer = pipeline("question-answering", model="Only-Mike/ADHD_Test_qa_model")
|
| 11 |
|
|
|
|
| 14 |
result = question_answerer(question=question, context=context)
|
| 15 |
return result["answer"]
|
| 16 |
|
| 17 |
+
if __name__ == "__main__":
|
| 18 |
+
demo = gr.Blocks()
|
| 19 |
+
with demo:
|
| 20 |
+
with gr.Row():
|
| 21 |
+
gr.Markdown(value=description)
|
| 22 |
+
gr.Interface(fn=question_answer, inputs=["text", "text"], outputs=["text"]).launch()
|
| 23 |
+
demo.launch()
|
| 24 |
+
|
| 25 |
|
| 26 |
|
| 27 |
|