Saurabhz commited on
Commit
ae59627
·
1 Parent(s): e36d3cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -1,19 +1,19 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
-
4
-
5
  def question_answer(context, question):
6
- model_checkpoint = "huggingface-course/bert-finetuned-squad"
7
- model = pipeline("question-answering", model=model_checkpoint)
8
- to_predict = [
9
- {
10
- "context": context,
11
- "qas": [
12
  {
13
- "question": question,
14
- "id": "0",
15
- }
16
- ],
 
 
 
17
  }
18
  ]
19
  answers, probabilities = model.predict(to_predict)
 
1
  import gradio as gr
2
  from transformers import pipeline
3
+
 
4
  def question_answer(context, question):
5
+ model_checkpoint = "huggingface-course/bert-finetuned-squad"
6
+ model = pipeline("question-answering", model=model_checkpoint)
7
+
8
+ to_predict = [
 
 
9
  {
10
+ "context": context,
11
+ "qas": [
12
+ {
13
+ "question": question,
14
+ "id": "0",
15
+ }
16
+ ],
17
  }
18
  ]
19
  answers, probabilities = model.predict(to_predict)