import gradio as gr from huggingface_hub import InferenceClient import spaces from rag import RAG r = RAG() @spaces.GPU def respond(text,history): return r.query(text) demo = gr.ChatInterface( respond, title="LAW LM", description="Ask legal questions", chatbot=gr.Chatbot(placeholder="Type your text here...") ) if __name__ == "__main__": demo.launch()