import gradio as gr | |
from transformers import pipeline | |
pipeline = pipeline(task="feedback-distilbert", model="isimorfizam/distilbert-base-cased-distilled-squad-feedback") | |
def predict(question): | |
question_answerer = pipeline("question-answering", model=MODEL_CHECKPOINT) | |
return question_answerer(question=question,context=context) | |
gradio_app = gr.Interface( | |
predict, | |
inputs=str, | |
outputs=str, | |
title='QA', | |
) | |
if __name__ == "__main__": | |
gradio_app.launch() |