import gradio as gr from transformers import pipeline title = 'Toy Question Answering App v0.1' context = "Rock Paper scissors can be played between two or more people. To begin, choose your opponent and stand or sit across from them.Both players close one hand into a fist and shake it while counting down. While counting down, players say, 'Rock, Paper, Scissors, Shoot' or 'Three, Two, One, Shoot!' on Shoot, everyone makes one of the three different hand signals/To make a rock, close your hand into a fist. To make paper, hold your hand out flat, with your palm facing downward.To make scissors, hold out your first two fingers in a V-shape. In Rock Paper Scissors, rock beats scissors by crushing them. Scissors beat paper by cutting the paper in two. paper beats rock by covering the paper. Players can play one game, best out of three games or as many games as they want!" question1 = "How many players are there?" question2 = "Does Rock beat paper?" question3 = "Do scissors beat paper?" model_name = "deepset/roberta-base-squad2" question_answerer = pipeline("question-answering", model=model_name, tokenizer=model_name) interface = gr.Interface.from_pipeline(question_answerer, title = title, theme = "peach", examples = [[context, question1],[context, question2],[context, question3]]).launch()