Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
import torch
|
4 |
import datasets
|
@@ -45,7 +46,7 @@ def list_examples():
|
|
45 |
for example in dataset:
|
46 |
context = example["context"]
|
47 |
question = example["question"]
|
48 |
-
examples.append([
|
49 |
return examples
|
50 |
|
51 |
|
@@ -53,10 +54,10 @@ def list_examples():
|
|
53 |
iface = gr.Interface(
|
54 |
fn=generate_answer,
|
55 |
inputs=[
|
56 |
-
|
57 |
-
|
58 |
],
|
59 |
-
outputs=
|
60 |
examples=list_examples()
|
61 |
)
|
62 |
|
|
|
1 |
import gradio as gr
|
2 |
+
from gradio.components import Textbox
|
3 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
4 |
import torch
|
5 |
import datasets
|
|
|
46 |
for example in dataset:
|
47 |
context = example["context"]
|
48 |
question = example["question"]
|
49 |
+
examples.append([question, context])
|
50 |
return examples
|
51 |
|
52 |
|
|
|
54 |
iface = gr.Interface(
|
55 |
fn=generate_answer,
|
56 |
inputs=[
|
57 |
+
Textbox(label="Question"),
|
58 |
+
Textbox(label="Context")
|
59 |
],
|
60 |
+
outputs=Textbox(label="Generated Answer"),
|
61 |
examples=list_examples()
|
62 |
)
|
63 |
|