awacke1's picture
Create app.py
14dd37c
raw
history blame
720 Bytes
import gradio as gr
from transformers import pipeline
title = 'Easy QA with Roberta'
context = "There is a game called Tic Tac Toe where players take turns writing an X or O into a 3x3 grid. The object of the game is to get three Xs or three Os in a row to win."
question1 = "How do you win tic tac toe?"
question2 = "How many Xs do you need to win?"
question3 = "What is the name of the game?"
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()