Giter Site home page Giter Site logo

askmybook's Introduction

Setup

  1. Create and fill in .env using .env.example as an example.

  2. Install required Python packages

pip install -r requirements.txt

Mac M1 / OS X Note: if you get an error installing psycopg2, you may need:

brew install postgresql

See psycopg/psycopg2#1200

  1. Turn your PDF into embeddings for GPT-3:
python scripts/pdf_to_pages_embeddings.py --pdf book.pdf
  1. Set up database tables and collect static files:
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic
  1. Other things to update:
  • Book title
  • Book cover image
  • URL to purchase book
  • Author name and bio

Deploy to Heroku

  1. Create a Heroku app:
heroku create yourappname

Set config variables on Heroku to match .env.

  1. Push to Heroku:
git push heroku main
heroku ps:scale web=1
heroku run python manage.py migrate
heroku open
heroku domains:add askmybook.com

Note that this repo does not contain the pages.csv and embeddings.csv you'll need, generated above. You can remove .csv from your own .gitignore and push them manually via git push heroku main.

Run locally

heroku local

Note: macOS Monterey uses port 5000 (the default port) for AirPlay sharing, so you will need to run heroku local on a different port. For example:

heroku local -p 5001

askmybook's People

Contributors

hackingthemarkets avatar slavingia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.