Spaces:
Build error
Build error
clementsan commited on
Commit ·
eb94a8f
1
Parent(s): 8aeeae1
Improve PDF chatbot description
Browse files97 unmodified lines989910010110210310480 unmodified lines18518618718818919019119219312 unmodified lines20620720820921021121221321497 unmodified lines"trust_remote_code": True, "torch_dtype": "auto"})progress(0.5, desc="Defining buffer memory...")memory = ConversationBufferMemory(memory_key="chat_history",return_messages=True80 unmodified lines# qa_chain = gr.Variable()gr.Markdown("""<center><h2>Document-based chatbot with memory</center></h2><h3>Ask any questions (and follow-up) about your PDF documents</h3><i>Note: this chatbot leverages LangChain for retrieval-augmented generation with memory.</i>""")with gr.Tab("Step 1 - Document pre-processing"):with gr.Row():12 unmodified linesdb_btn = gr.Button("Generating vector database...")with gr.Tab("Step 2 - QA chain initialization"):gr.Markdown("""<b>Note:</b> This space uses the free CPU Basic hardware from Hugging Face. The LLM models used below (free inference endpoints) can take some time to generate a reply.""")with gr.Row():llm_btn = gr.Radio(list_llm_simple, \label="LLM models", value = list_llm_simple[0], type="index", info="Choose your LLM model")97 unmodified lines989910010110210310480 unmodified lines18518618718818919019119219319419512 unmodified lines20820921021121221397 unmodified lines"trust_remote_code": True, "torch_dtype": "auto"})progress(0.75, desc="Defining buffer memory...")memory = ConversationBufferMemory(memory_key="chat_history",return_messages=True80 unmodified lines# qa_chain = gr.Variable()gr.Markdown("""<center><h2>PDF-based chatbot, powered by LangChain and open-source LLMs</center></h2><h3>Ask any questions about your PDF documents, along with follow-ups</h3><b>Note:</b> This AI assistant performs retrieval-augmented generation from your PDF documents. \When generating answers, it takes past questions into account (via conversational memory), and points to specific document sources for clarity purposes</i><b>Warning:</b> This space uses the free CPU Basic hardware from Hugging Face. Some steps and LLM models used below (free inference endpoints) can take some time to generate a reply.""")with gr.Tab("Step 1 - Document pre-processing"):with gr.Row():12 unmodified linesdb_btn = gr.Button("Generating vector database...")with gr.Tab("Step 2 - QA chain initialization"):with gr.Row():llm_btn = gr.Radio(list_llm_simple, \label="LLM models", value = list_llm_simple[0], type="index", info="Choose your LLM model")
app.py+6-7