legacy107 commited on
Commit
98b9b58
1 Parent(s): 70cdcf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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([context, question])
49
  return examples
50
 
51
 
@@ -53,10 +54,10 @@ def list_examples():
53
  iface = gr.Interface(
54
  fn=generate_answer,
55
  inputs=[
56
- gr.inputs.Textbox(label="Question"),
57
- gr.inputs.Textbox(label="Context")
58
  ],
59
- outputs=gr.outputs.Textbox(label="Generated Answer"),
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