Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pratikkalein/chat-with-pdf
Simple application using Python and Streamlit using OpenAI API.
https://github.com/pratikkalein/chat-with-pdf
genai python streamlit
Last synced: about 10 hours ago
JSON representation
Simple application using Python and Streamlit using OpenAI API.
- Host: GitHub
- URL: https://github.com/pratikkalein/chat-with-pdf
- Owner: pratikkalein
- Created: 2023-07-06T17:48:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-22T11:55:28.000Z (over 1 year ago)
- Last Synced: 2024-11-11T22:09:51.918Z (2 months ago)
- Topics: genai, python, streamlit
- Language: Python
- Homepage:
- Size: 351 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: history.db
Awesome Lists containing this project
README
# Chat With PDF
Simple application using Python and Streamlit using OpenAI API. Upload any pdf file and ask questions about it! It also supports images scans.
## Screenshots
![Deployed app](/img/prod.png)**With History and Auto generated questions**
![With History and Auto generated questions](/img/history.png)
## Local environment
Make sure you have python and pip installed
1. Clone the repo
```bash
git clone https://github.com/pratikkalein/chat-with-pdf
```
2. Create a virtual environment
```bash
python3 -m venv venv
```
3. Activate the enviornment
```bash
source /venv/bin/activate
```
4. Install the requirments
```bash
pip install -r requirements.txt
```
5. Create .env file at the root of the project and add your Open AI API key.
```
OPEN_AI_API_KEY=yourapikey
```
6. Run
```bash
streamlit run app.py
```
## Deploy to Google Cloud
### Build Docker Image using Cloud Build```bash
gcloud builds submit --tag gcr.io/gcp-project-id/chat-with-pdf --project=gcp-project-id
```### Deploy latest image to Cloud Run
Before running the command make sure you add your secret to the Secret Manager.
Syntax for the --update-secrets
```bash
--update-secretes=ENV_VAR_NAME=SECRET_NAME:VERSION
``````bash
gcloud run deploy chat-with-pdf --image gcr.io/gcp-project-id/chat-with-pdf --platform managed --project=gcp-project-id --allow-unauthenticated --region=asia-south1 --max-instances=2 --update-secrets=OPENAI_API_KEY=openai:1
```If you wish to modify your deployment you can refere the documentation [here](https://cloud.google.com/sdk/gcloud/reference/run/deploy).