|
|
|
|
|
import gradio as gr |
|
|
|
|
|
|
|
|
|
def get_response(context, question): |
|
answer = qa_model(question=question, context=context)["answer"] |
|
return answer |
|
|
|
|
|
context_textbox = gr.Textbox(lines=10, label="Context") |
|
question_textbox = gr.Textbox(label="Question") |
|
output_label = gr.Label(label="Response: ") |
|
|
|
interface = gr.Interface( |
|
fn=get_response, |
|
inputs=[context_textbox, question_textbox], |
|
outputs=output_label, |
|
title="Cryptocurrency QA System", |
|
description="Ask a question about cryptocurrency.", |
|
) |
|
|
|
|
|
interface.launch(share=True) |
|
|