amiguel commited on
Commit
9582693
·
verified ·
1 Parent(s): ee0519d

Upload 3 files

Browse files
Files changed (3) hide show
  1. Dockerfile +5 -14
  2. README.md +68 -15
  3. requirements.txt +8 -2
Dockerfile CHANGED
@@ -1,21 +1,12 @@
1
- FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- software-properties-common \
9
- git \
10
- && rm -rf /var/lib/apt/lists/*
11
 
12
- COPY requirements.txt ./
13
- COPY src/ ./src/
14
-
15
- RUN pip3 install -r requirements.txt
16
 
17
  EXPOSE 8501
18
 
19
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
20
-
21
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
+ COPY requirements.txt .
6
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
7
 
8
+ COPY . .
 
 
 
9
 
10
  EXPOSE 8501
11
 
12
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
README.md CHANGED
@@ -1,20 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- title: Ai Systems
3
- emoji: 🚀
4
- colorFrom: red
5
- colorTo: red
6
- sdk: docker
7
- app_port: 8501
8
- tags:
9
- - streamlit
10
- pinned: false
11
- short_description: Building AI Reliable Systems
12
- license: apache-2.0
 
 
 
13
  ---
14
 
15
- # Welcome to Streamlit!
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
18
 
19
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
20
- forums](https://discuss.streamlit.io).
 
1
+ # AI Chatbot with RAG and HuggingFace Models
2
+
3
+ A professional, modular chatbot app using Streamlit, supporting PDF/CSV/XLSX upload, Retrieval-Augmented Generation (RAG), and custom HuggingFace models (e.g., amiguel/GM_Qwen1.8B_Finetune).
4
+
5
+ ---
6
+
7
+ ## Features
8
+
9
+ - Modern Streamlit chat UI with Tw Cen MT font and company logo
10
+ - Upload PDF, CSV, XLSX files for context
11
+ - Uses RAG pipeline for document QA
12
+ - Customizable HuggingFace text generation model
13
+ - Modular, production-ready codebase
14
+
15
+ ---
16
+
17
+ ## Quickstart
18
+
19
+ ### 1. **Clone and Install**
20
+
21
+ ```bash
22
+ git clone <your-repo-url>
23
+ cd chatbot_app
24
+ pip install -r requirements.txt
25
+ ```
26
+
27
+ ### 2. **Run Locally**
28
+
29
+ ```bash
30
+ streamlit run app.py
31
+ ```
32
+
33
+ ### 3. **Docker Deploy**
34
+
35
+ ```bash
36
+ docker build -t chatbot-app .
37
+ docker run -p 8501:8501 chatbot-app
38
+ ```
39
+
40
  ---
41
+
42
+ ## Deployment
43
+
44
+ ### **A. AWS (GPU)**
45
+ 1. Launch a GPU EC2 instance (e.g., g4dn.xlarge).
46
+ 2. Install Docker and NVIDIA drivers.
47
+ 3. Build and run the Docker image as above.
48
+ 4. Open port 8501 for web access.
49
+
50
+ ### **B. HuggingFace Spaces**
51
+ 1. Create a new Space (Streamlit SDK).
52
+ 2. Upload all files (including `app.py`, `requirements.txt`, `src/`, and `assets/`).
53
+ 3. The app will auto-deploy.
54
+
55
  ---
56
 
57
+ ## Customization
58
+
59
+ - Change the logo in `assets/logo.png`.
60
+ - Adjust font or colors in `src/utils.py`.
61
+ - Swap out the default HuggingFace model in the sidebar.
62
+
63
+ ---
64
+
65
+ ## License
66
+
67
+ MIT
68
+
69
+ ---
70
 
71
+ ## Contact
72
 
73
+ [Your Company Name] | [[email protected]]
 
requirements.txt CHANGED
@@ -1,3 +1,9 @@
1
- altair
 
 
 
 
 
2
  pandas
3
- streamlit
 
 
1
+ streamlit
2
+ langchain
3
+ transformers
4
+ sentence-transformers
5
+ faiss-cpu
6
+ pdfplumber
7
  pandas
8
+ openpyxl
9
+ torch