from transformers import pipeline import gradio as gr # Load lightweight legal model qa_pipeline = pipeline("question-answering", model="law-ai/InLegalBERT") def answer_question(question, context): result = qa_pipeline(question=question, context=context) return result['answer'] gr.Interface( fn=answer_question, inputs=["text", "text"], outputs="text", title="Indian Legal Q&A Bot", description="Ask questions based on Indian legal context" ).launch()