Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,7 +75,7 @@ def retrieve_context(query, contexts):
|
|
| 75 |
|
| 76 |
|
| 77 |
# Define your function to generate answers
|
| 78 |
-
def generate_answer(question, context, ground):
|
| 79 |
contexts = chunk_splitter(context)
|
| 80 |
context = retrieve_context(question, contexts)
|
| 81 |
|
|
@@ -108,7 +108,8 @@ def list_examples():
|
|
| 108 |
context = example["article"]
|
| 109 |
question = example["question"]
|
| 110 |
answer = example["answer"]
|
| 111 |
-
|
|
|
|
| 112 |
return examples
|
| 113 |
|
| 114 |
|
|
@@ -118,6 +119,7 @@ iface = gr.Interface(
|
|
| 118 |
inputs=[
|
| 119 |
Textbox(label="Question"),
|
| 120 |
Textbox(label="Context"),
|
|
|
|
| 121 |
Textbox(label="Ground truth")
|
| 122 |
],
|
| 123 |
outputs=[
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
# Define your function to generate answers
|
| 78 |
+
def generate_answer(question, context, title, ground):
|
| 79 |
contexts = chunk_splitter(context)
|
| 80 |
context = retrieve_context(question, contexts)
|
| 81 |
|
|
|
|
| 108 |
context = example["article"]
|
| 109 |
question = example["question"]
|
| 110 |
answer = example["answer"]
|
| 111 |
+
title = example["title"]
|
| 112 |
+
examples.append([question, context, title, answer])
|
| 113 |
return examples
|
| 114 |
|
| 115 |
|
|
|
|
| 119 |
inputs=[
|
| 120 |
Textbox(label="Question"),
|
| 121 |
Textbox(label="Context"),
|
| 122 |
+
Textbox(label="Article title"),
|
| 123 |
Textbox(label="Ground truth")
|
| 124 |
],
|
| 125 |
outputs=[
|