Karzan commited on
Commit
6ecf753
·
verified ·
1 Parent(s): 5147f7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -8,13 +8,13 @@ pipe = pipeline(
8
  model=model_id,
9
  max_answer_len=300,
10
  handle_impossible_answer=True,
11
- top_k=5,
12
  )
13
 
14
 
15
  def func(context, question):
16
  result = pipe(question=question, context=context)
17
- return result[0]["answer"], result[0]["score"], result[1]["answer"], result[1]["score"], result[2]["answer"], result[2]["score"], result[3]["answer"], result[3]["score"], result[4]["answer"], result[4]["score"]
18
 
19
 
20
  interface = gr.Interface(
@@ -30,10 +30,6 @@ interface = gr.Interface(
30
  gr.Textbox(label="Score"),
31
  gr.Textbox(label="Answer"),
32
  gr.Textbox(label="Score"),
33
- gr.Textbox(label="Answer"),
34
- gr.Textbox(label="Score"),
35
- gr.Textbox(label="Answer"),
36
- gr.Textbox(label="Score"),
37
  ],
38
  # submit_btn=submit_btn,
39
  )
 
8
  model=model_id,
9
  max_answer_len=300,
10
  handle_impossible_answer=True,
11
+ top_k=3,
12
  )
13
 
14
 
15
  def func(context, question):
16
  result = pipe(question=question, context=context)
17
+ return result[0]["answer"], result[0]["score"], result[1]["answer"], result[1]["score"], result[2]["answer"], result[2]["score"]
18
 
19
 
20
  interface = gr.Interface(
 
30
  gr.Textbox(label="Score"),
31
  gr.Textbox(label="Answer"),
32
  gr.Textbox(label="Score"),
 
 
 
 
33
  ],
34
  # submit_btn=submit_btn,
35
  )