Skip to content

pratikkalein/chat-with-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

With History and Auto generated questions

With History and Auto generated questions

Local environment

Make sure you have python and pip installed

  1. Clone the repo
git clone https://github.com/pratikkalein/chat-with-pdf
  1. Create a virtual environment
python3 -m venv venv
  1. Activate the enviornment
source /venv/bin/activate
  1. Install the requirments
pip install -r requirements.txt 
  1. Create .env file at the root of the project and add your Open AI API key.
OPEN_AI_API_KEY=yourapikey
  1. Run
streamlit run app.py

Deploy to Google Cloud

Build Docker Image using Cloud Build

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

 --update-secretes=ENV_VAR_NAME=SECRET_NAME:VERSION
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.

About

Simple application using Python and Streamlit using OpenAI API.

Topics

Resources

Stars

Watchers

Forks