Only-Mike commited on
Commit
200d959
·
1 Parent(s): 899edcb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -8,16 +8,18 @@ from transformers import AutoTokenizer
8
  # Initializing the pipeline for the question answering model
9
  question_answerer = pipeline("question-answering", model="Only-Mike/ADHD_Test_qa_model")
10
 
11
- gr.Markdown('''ADHD QA Bot <br>
 
 
 
 
 
 
 
12
  This space is build to showcase a fine-tuning of the distilbert-base-uncased and its abilities to answer questions. <br>
13
  Examples could be: <br>
14
  - Question = What is ADHD? <br>
15
  - Context = Attention-deficit/hyperactivity disorder (ADHD) is a neurodevelopmental disorder characterized by inattention, hyperactivity, and impulsivity.<br>
16
- ''')
17
 
18
- def question_answer(question, context):
19
- # Answering from the trained model
20
- result = question_answerer(question=question, context=context)
21
- return result["answer"]
22
 
23
- gr.Interface(fn=question_answer, inputs=["text", "text"], outputs=["text"]).launch()
 
8
  # Initializing the pipeline for the question answering model
9
  question_answerer = pipeline("question-answering", model="Only-Mike/ADHD_Test_qa_model")
10
 
11
+ def question_answer(question, context):
12
+ # Answering from the trained model
13
+ result = question_answerer(question=question, context=context)
14
+ return result["answer"]
15
+
16
+ gr.Interface(fn=question_answer, inputs=["text", "text"], outputs=["text"]).launch()
17
+
18
+ gr.Markdown('ADHD QA Bot <br>
19
  This space is build to showcase a fine-tuning of the distilbert-base-uncased and its abilities to answer questions. <br>
20
  Examples could be: <br>
21
  - Question = What is ADHD? <br>
22
  - Context = Attention-deficit/hyperactivity disorder (ADHD) is a neurodevelopmental disorder characterized by inattention, hyperactivity, and impulsivity.<br>
23
+ ')
24
 
 
 
 
 
25