import gradio as gr from transformers import pipeline # Load your model model_name = "lachie0232/Jammy-finetuned" # Replace with your model's name qa_pipeline = pipeline("question-answering", model=model_name) # Define the function to handle user input def answer_question(question): context = "Insert your context or provide default knowledge." result = qa_pipeline(question=question, context=context) return result['answer'] # Create a Gradio interface interface = gr.Interface(fn=answer_question, inputs="text", outputs="text") # Launch the interface interface.launch()