Anvit25 commited on
Commit
81efa0d
Β·
verified Β·
1 Parent(s): 7612430

Upload readme

Browse files
Files changed (1) hide show
  1. readme +99 -0
readme ADDED
@@ -0,0 +1,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
+ markdown
19
+ Copy code
20
+
21
+ ---
22
+
23
+ ## βš™οΈ Features
24
+
25
+ - πŸ“„ **Document Loading** – Loads and processes the Samsung manual (`temp_docs/samsung_manual.txt`).
26
+ - βœ‚οΈ **Chunking** – Splits the document into manageable chunks for embeddings.
27
+ - 🧠 **Embeddings** – Uses `sentence-transformers/all-MiniLM-L6-v2` for semantic search.
28
+ - πŸ’Ύ **Vector Database** – Stores embeddings in **ChromaDB** for retrieval.
29
+ - πŸ”„ **Conversational Memory** – Maintains chat context with `ConversationBufferMemory`.
30
+ - πŸ—£οΈ **LLM Response** – Powered by `google/flan-t5-base` via Hugging Face pipeline.
31
+ - 🎨 **Gradio UI** – Simple chat interface for interacting with the chatbot.
32
+
33
+ ---
34
+
35
+ ## πŸ“¦ Installation
36
+
37
+ Clone the repository and install dependencies:
38
+
39
+ ```bash
40
+ git clone https://github.com/your-username/LLM_chatbot2.git
41
+ cd LLM_chatbot2
42
+ pip install -r requirements.txt
43
+ ▢️ Running the App
44
+ Make sure you have the Samsung manual text file at temp_docs/samsung_manual.txt.
45
+
46
+ Then run:
47
+
48
+ bash
49
+ Copy code
50
+ python app.py
51
+ 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.
52
+
53
+ πŸ“ Requirements
54
+ Dependencies are listed in requirements.txt:
55
+
56
+ nginx
57
+ Copy code
58
+ pypdf
59
+ gradio
60
+ langchain
61
+ chromadb
62
+ sentence-transformers
63
+ transformers
64
+ torch
65
+ πŸš€ Usage
66
+ Place your document inside temp_docs/ (default: samsung_manual.txt).
67
+
68
+ Run the app.
69
+
70
+ Ask natural language questions like:
71
+
72
+ "How do I reset my Samsung washing machine?"
73
+
74
+ "Explain the safety precautions in the manual."
75
+
76
+ The chatbot retrieves relevant chunks from the document and answers conversationally.
77
+
78
+ πŸ› οΈ Customization
79
+ Change the document: Replace temp_docs/samsung_manual.txt with any .txt file.
80
+
81
+ Switch embeddings: Modify MODEL_NAME_EMBEDDINGS in app.py.
82
+
83
+ Try different LLMs: Update MODEL_ID_LLM to another Hugging Face model.
84
+
85
+ πŸ“œ License
86
+ This project is open-source under the MIT License.
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
+