Spaces:
Runtime error
Runtime error
| # Samsung Manual Chatbot | |
| A chatbot built with **LangChain**, **Gradio**, and **Hugging Face Transformers** that allows you to interact with the **Samsung Manual**. | |
| It uses embeddings + ChromaDB for retrieval and a conversational chain for contextual Q&A. | |
| --- | |
| ## Project Structure | |
| LLM_chatbot2/ | |
| βββ chroma_db/ # Persistent Chroma vector database | |
| βββ temp_docs/ # Store documents (Samsung manual here) | |
| βββ app.py # Main Gradio app | |
| βββ requirements.txt # Dependencies | |
| βββ README.md # Project documentation | |
| βββ .gitattributes | |
| --- | |
| ## Features | |
| - **Document Loading** β Loads and processes the Samsung manual (`temp_docs/samsung_manual.txt`). | |
| - **Chunking** β Splits the document into manageable chunks for embeddings. | |
| - **Embeddings** β Uses `sentence-transformers/all-MiniLM-L6-v2` for semantic search. | |
| - **Vector Database** β Stores embeddings in **ChromaDB** for retrieval. | |
| - **Conversational Memory** β Maintains chat context with `ConversationBufferMemory`. | |
| - **LLM Response** β Powered by `google/flan-t5-base` via Hugging Face pipeline. | |
| - **Gradio UI** β Simple chat interface for interacting with the chatbot. | |
| --- | |
| ## Installation | |
| Clone the repository and install dependencies: | |
| ```bash | |
| git clone https://github.com/Anvit25/LLM_chatbot2.git | |
| cd LLM_chatbot2 | |
| pip install -r requirements.txt | |
| Running the App | |
| Make sure you have the Samsung manual text file at temp_docs/samsung_manual.txt. | |
| Then run: | |
| python app.py | |
| Gradio will launch a local server. Open the link shown in the terminal (usually http://127.0.0.1:7860) to interact with the chatbot. | |
| ``` | |
| ## Requirements | |
| Dependencies are listed in requirements.txt: | |
| pypdf | |
| gradio | |
| langchain | |
| chromadb | |
| sentence-transformers | |
| transformers | |
| torch | |
| ## Usage | |
| Place your document inside temp_docs/ (default: samsung_manual.txt). | |
| Run the app. | |
| Ask natural language questions like: | |
| "How do I reset my Samsung washing machine?" | |
| "Explain the safety precautions in the manual." | |
| The chatbot retrieves relevant chunks from the document and answers conversationally. | |
| ## Customization | |
| Change the document: Replace temp_docs/samsung_manual.txt with any .txt file. | |
| Switch embeddings: Modify MODEL_NAME_EMBEDDINGS in app.py. | |
| Try different LLMs: Update MODEL_ID_LLM to another Hugging Face model. | |
| ## License | |
| This project is open-source under the MIT License. | |
| --- | |