question_answer / app.py
Wootang01's picture
Update app.py
5a6ecf4
raw
history blame
869 Bytes
import gradio as gr
examples = [
["What’s more, the only way I can keep myself awake and finish off everything I need to for the day is by consuming energy drinks. I know that some of these drinks have caffeine in them, and sometimes I feel groggy in the morning if I’ve had more than a couple the night before.", "When does 'them' refer to?"]
]
gr.Interface.load("huggingface/deepset/roberta-base-squad2",
inputs=[gr.inputs.Textbox(lines=10, label="Context", placeholder="Type a sentence or paragraph here."),
gr.inputs.Textbox(lines=2, label="Question", placeholder="Ask a question based on the context.")],
outputs=[gr.outputs.Textbox(label="Answer"),
gr.outputs.Label(label="Probability")],
examples=examples).launch(share=True)