Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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=
|
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,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 |
)
|