Skip to content

Commit b03ac89

Browse files
committed
Fix gradio deployment
1 parent adc0b6e commit b03ac89

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
22
title: HiringHelp-Chatbot
3-
app_file: app.py
3+
emoji: 👨‍💼
4+
colorFrom: blue
5+
colorTo: indigo
46
sdk: gradio
5-
sdk_version: 5.22.0
7+
sdk_version: "5.22.0"
8+
app_file: app.py
9+
pinned: false
610
---
711

8-
912
# HiringHelp Chatbot
1013

1114
A chatbot that helps with hiring-related questions using RAG (Retrieval-Augmented Generation) with Gradio interface.
@@ -14,7 +17,7 @@ A chatbot that helps with hiring-related questions using RAG (Retrieval-Augmente
1417

1518
- Interactive chat interface using Gradio
1619
- RAG system for retrieving relevant information from candidate documents
17-
- Support for multiple document formats (PDF, TXT, CSV)
20+
- Support for text document formats
1821
- Conversation memory to maintain context
1922
- Real-time responses using OpenRouter API
2023

@@ -53,11 +56,11 @@ A chatbot that helps with hiring-related questions using RAG (Retrieval-Augmente
5356
- gradio
5457
- openai
5558
- python-dotenv
56-
- PyPDF2
5759
- pandas
5860
- langchain
5961
- faiss-cpu
6062
- requests
63+
- beautifulsoup4
6164

6265
## Local Development
6366

@@ -83,7 +86,7 @@ pip install -r requirements.txt
8386
OPENROUTER_API_KEY=your_api_key_here
8487
```
8588

86-
5. Add your knowledge source documents (PDF, TXT, or CSV) to the `knowledge_sources` directory.
89+
5. Add your knowledge source documents to the `knowledge_sources` directory.
8790

8891
6. Run the application:
8992
```bash
@@ -123,7 +126,6 @@ HiringHelp-Chatbot/
123126
├── requirements.txt # Python dependencies
124127
├── .env # Environment variables (local only)
125128
└── knowledge_sources/ # Directory for knowledge base documents
126-
├── sample_candidates.txt # Sample candidate data
127129
└── README.md # Instructions for adding documents
128130
```
129131

@@ -136,7 +138,7 @@ HiringHelp Chatbot is an intelligent hiring assistant that uses Retrieval-Augmen
136138

137139
## Features
138140
- **RAG-Based Analysis**: Uses Retrieval-Augmented Generation to provide accurate, document-grounded responses
139-
- **Resume Analysis**: Processes and analyzes candidate resumes in PDF format
141+
- **Resume Analysis**: Processes and analyzes candidate resumes
140142
- **Intelligent Matching**: Uses LangChain and advanced language models to match candidates with job requirements
141143
- **Interactive Chat Interface**: User-friendly web interface for natural conversations
142144
- **Rate-Limited API**: Implements rate limiting (10 requests/minute, 100 requests/day) for stable service
@@ -150,25 +152,25 @@ HiringHelp Chatbot is an intelligent hiring assistant that uses Retrieval-Augmen
150152
- Qwen-2-7B-Chat: Primary model for chat completions (via OpenRouter)
151153
- text-embedding-ada-002: OpenAI's embedding model for document vectorization
152154
- **Vector Database**: FAISS for efficient document retrieval
153-
- **Document Processing**: PyPDF2 for PDF parsing, LangChain for text splitting and embedding
155+
- **Document Processing**: LangChain for text splitting and embedding
154156
- **Rate Limiting**: Flask-Limiter for API protection
155157
- **Data Storage**: SQLite for persistent storage
156158
- **Containerization**: Docker for deployment
157159

158160
## How RAG Works in This Application
159161
1. **Document Ingestion**:
160-
- Resumes are processed and split into chunks using LangChain's text splitters
162+
- Documents are processed and split into chunks using LangChain's text splitters
161163
- Each chunk is embedded using OpenAI's text-embedding-ada-002 model
162164
- Embeddings are stored in a FAISS vector database
163165

164166
2. **Query Processing**:
165167
- User queries are embedded using the same OpenAI embedding model
166-
- Relevant resume sections are retrieved using vector similarity search
168+
- Relevant document sections are retrieved using vector similarity search
167169
- Retrieved context is used to generate accurate, grounded responses
168170

169171
3. **Response Generation**:
170172
- Qwen-2-7B-Chat model receives both the user query and retrieved context
171-
- Responses are generated based on actual resume content
173+
- Responses are generated based on actual document content
172174
- The RAG approach ensures responses are factual and verifiable
173175

174176
## Requirements
@@ -178,7 +180,6 @@ Werkzeug==2.0.3
178180
openai>=1.0.0
179181
sqlalchemy==1.4.25
180182
python-dotenv==1.0.1
181-
PyPDF2==3.0.1
182183
pandas==2.2.0
183184
scikit-learn==1.5.0
184185
langchain-core>=0.1.17
@@ -190,6 +191,7 @@ faiss-cpu==1.7.4
190191
Flask-Limiter>=3.5.0
191192
requests>=2.32.3
192193
aiohttp==3.9.1
194+
beautifulsoup4==4.12.2
193195
```
194196

195197
## Local Development Setup
@@ -206,8 +208,8 @@ Create a `.env` file in the root directory:
206208
OPENROUTER_API_KEY=your_api_key_here
207209
```
208210

209-
3. Add candidate resumes:
210-
Place PDF resumes in the `knowledge_sources` directory.
211+
3. Add candidate documents:
212+
Place candidate documents in the `knowledge_sources` directory.
211213

212214
4. Run with Docker:
213215
```bash
@@ -238,7 +240,7 @@ HiringHelp-Chatbot/
238240
├── api/ # Main application code
239241
│ ├── index.py # Flask application and API endpoints
240242
│ └── __init__.py
241-
├── knowledge_sources/ # Directory for candidate resumes
243+
├── knowledge_sources/ # Directory for candidate documents
242244
├── lib/ # Helper libraries
243245
├── public/ # Static files
244246
├── database/ # Database related files

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from langchain.chains import RetrievalQA
1313
from langchain.chains.conversation.memory import ConversationBufferMemory
1414
from langchain.embeddings.base import Embeddings
15-
from PyPDF2 import PdfReader
15+
# from PyPDF2 import PdfReader
1616

1717
# Load environment variables from .env file
1818
load_dotenv()

0 commit comments

Comments
 (0)