Spaces:
Build error
Build error
| import gradio as gr | |
| from ui.gradio_ui import get_ui # Main UI structure | |
| from style import custom_css # Custom CSS for styling | |
| # Import and initialize LangChain RAg chain for lawbot | |
| from modules.lawbot.rag_with_langchain import load_documents, split_documents, create_vectorstore, setup_rag_chain | |
| # Initialize RAg chain once at app startup | |
| documents = load_documents() | |
| docs = split_documents(documents) | |
| vectorstore = create_vectorstore(docs) | |
| qa_chain = setup_rag_chain(vectorstore) | |
| # Gradio app with custom CSS and UI | |
| with gr.Blocks(css=custom_css) as demo: | |
| get_ui() # Loads all tabs including PehchaanSetu and others | |
| # Launch the Gradio app | |
| if __name__ == "__main__": | |
| url = demo.launch() | |
| print(f"🚀 Saarthi app is running at: {url}") | |