cor_da_fruta / app.py
spadini's picture
Update app.py
59ea7dd verified
raw
history blame contribute delete
422 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("question-answering", model="deepset/roberta-base-squad2-distilled", framework="pt")
def chat(message, history):
context="A laranja é uma fruta laranja e o limão é uma fruta verde"
resposta = pipe(question=message, context=context)
return resposta['answer']
demo = gr.ChatInterface(chat)
if __name__ == "__main__":
demo.launch()