Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| context = "The African elephant is the largest land animal in the world. These magnificent creatures can reach up to 13 feet in height at the shoulder and weigh as much as 14,000 pounds. Known for their impressive tusks and long trunks, African elephants are herbivores that consume a diet consisting mainly of leaves, grasses, and fruits. These intelligent and social animals live in matriarchal groups led by the oldest and wisest female, who guides the herd in search of food, water, and shelter. African elephants play a crucial role in their ecosystems by shaping landscapes and creating habitats for other species through their feeding and foraging activities." | |
| question = "What is the largest land animal in the world?" | |
| interface = gr.Interface.load( | |
| "huggingface/deepset/roberta-base-squad2", | |
| inputs=[gr.Textbox(lines=7, label="Context paragraph"), gr.Textbox(lines=2, label="Question")], | |
| outputs=[gr.Textbox(label="Answer"), gr.Textbox(label="Score")] | |
| ) | |
| interface.description = "Provide your own paragraph and ask any question about the text. How well does the model answer?" | |
| interface.title = "Question Answering Model" | |
| interface.launch() |