Spaces:
Runtime error
Runtime error
Update readme (#1)
Browse files- Update readme (350b0d6e58a8a50351fab191e4d77943f2c69399)
Co-authored-by: Mandar Garud <mandarmgd-03@users.noreply.huggingface.co>
readme
CHANGED
|
@@ -1,99 +1,87 @@
|
|
| 1 |
-
#
|
| 2 |
-
|
| 3 |
-
A chatbot built with **LangChain**, **Gradio**, and **Hugging Face Transformers** that allows you to interact with the **Samsung Manual**.
|
| 4 |
-
It uses embeddings + ChromaDB for retrieval and a conversational chain for contextual Q&A.
|
| 5 |
-
|
| 6 |
-
---
|
| 7 |
-
|
| 8 |
-
##
|
| 9 |
-
|
| 10 |
-
LLM_chatbot2/
|
| 11 |
-
βββ chroma_db/ # Persistent Chroma vector database
|
| 12 |
-
βββ temp_docs/ # Store documents (Samsung manual here)
|
| 13 |
-
βββ app.py # Main Gradio app
|
| 14 |
-
βββ requirements.txt # Dependencies
|
| 15 |
-
βββ README.md # Project documentation
|
| 16 |
-
βββ .gitattributes
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
-
|
| 26 |
-
-
|
| 27 |
-
-
|
| 28 |
-
|
| 29 |
-
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
yaml
|
| 89 |
-
Copy code
|
| 90 |
-
|
| 91 |
-
---
|
| 92 |
-
|
| 93 |
-
Do you want me to also **add example screenshots of the Gradio UI** in the README (like showing how a query/response looks), or keep it text-only?
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
|
|
|
| 1 |
+
# Samsung Manual Chatbot
|
| 2 |
+
|
| 3 |
+
A chatbot built with **LangChain**, **Gradio**, and **Hugging Face Transformers** that allows you to interact with the **Samsung Manual**.
|
| 4 |
+
It uses embeddings + ChromaDB for retrieval and a conversational chain for contextual Q&A.
|
| 5 |
+
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
## Project Structure
|
| 9 |
+
|
| 10 |
+
LLM_chatbot2/
|
| 11 |
+
βββ chroma_db/ # Persistent Chroma vector database
|
| 12 |
+
βββ temp_docs/ # Store documents (Samsung manual here)
|
| 13 |
+
βββ app.py # Main Gradio app
|
| 14 |
+
βββ requirements.txt # Dependencies
|
| 15 |
+
βββ README.md # Project documentation
|
| 16 |
+
βββ .gitattributes
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## Features
|
| 20 |
+
|
| 21 |
+
- **Document Loading** β Loads and processes the Samsung manual (`temp_docs/samsung_manual.txt`).
|
| 22 |
+
- **Chunking** β Splits the document into manageable chunks for embeddings.
|
| 23 |
+
- **Embeddings** β Uses `sentence-transformers/all-MiniLM-L6-v2` for semantic search.
|
| 24 |
+
- **Vector Database** β Stores embeddings in **ChromaDB** for retrieval.
|
| 25 |
+
- **Conversational Memory** β Maintains chat context with `ConversationBufferMemory`.
|
| 26 |
+
- **LLM Response** β Powered by `google/flan-t5-base` via Hugging Face pipeline.
|
| 27 |
+
- **Gradio UI** β Simple chat interface for interacting with the chatbot.
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## Installation
|
| 32 |
+
|
| 33 |
+
Clone the repository and install dependencies:
|
| 34 |
+
|
| 35 |
+
```bash
|
| 36 |
+
git clone https://github.com/Anvit25/LLM_chatbot2.git
|
| 37 |
+
cd LLM_chatbot2
|
| 38 |
+
pip install -r requirements.txt
|
| 39 |
+
Running the App
|
| 40 |
+
Make sure you have the Samsung manual text file at temp_docs/samsung_manual.txt.
|
| 41 |
+
|
| 42 |
+
Then run:
|
| 43 |
+
|
| 44 |
+
python app.py
|
| 45 |
+
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.
|
| 46 |
+
|
| 47 |
+
## Requirements
|
| 48 |
+
Dependencies are listed in requirements.txt:
|
| 49 |
+
|
| 50 |
+
pypdf
|
| 51 |
+
gradio
|
| 52 |
+
langchain
|
| 53 |
+
chromadb
|
| 54 |
+
sentence-transformers
|
| 55 |
+
transformers
|
| 56 |
+
torch
|
| 57 |
+
|
| 58 |
+
## Usage
|
| 59 |
+
Place your document inside temp_docs/ (default: samsung_manual.txt).
|
| 60 |
+
|
| 61 |
+
Run the app.
|
| 62 |
+
|
| 63 |
+
Ask natural language questions like:
|
| 64 |
+
|
| 65 |
+
"How do I reset my Samsung washing machine?"
|
| 66 |
+
|
| 67 |
+
"Explain the safety precautions in the manual."
|
| 68 |
+
|
| 69 |
+
The chatbot retrieves relevant chunks from the document and answers conversationally.
|
| 70 |
+
|
| 71 |
+
## Customization
|
| 72 |
+
Change the document: Replace temp_docs/samsung_manual.txt with any .txt file.
|
| 73 |
+
|
| 74 |
+
Switch embeddings: Modify MODEL_NAME_EMBEDDINGS in app.py.
|
| 75 |
+
|
| 76 |
+
Try different LLMs: Update MODEL_ID_LLM to another Hugging Face model.
|
| 77 |
+
|
| 78 |
+
## License
|
| 79 |
+
This project is open-source under the MIT License.
|
| 80 |
+
|
| 81 |
+
---
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|