batmanscode / Talk2Book

Use AI to personify books, so that you can talk to them ๐Ÿ™Š

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Talk2Book ๐Ÿ“–

Use AI to personify books, so that you can talk to them ๐Ÿ™Š


Talk2Book: 1984 on Hugging Face Spaces

Use the Talk2Book app on Hugging Face Spaces

Notebooks

Binder nbviewer

Talk2Book.ipynb

Open In Colab

Use this to talk to '1984'. Embeddings for this book have already been created so you can use it out of the box ๐Ÿ“ฆ

Book2Vec.ipynb

Open In Colab

Use this to see how embeddings for '1984' were made or create your own for another book!

Limitations

This can't yet do summaries or continue a conversaion; each question gets a single answer. Contributions for these are very welcome!

Potential improvements

Save good outputs to use as examples in the prompt (few shot).

How can I talk to another book?

  1. Create a vector store with embeddings using Book2Vec.ipynb
  2. Upload to https://huggingface.co as a dataset (recommended)
  3. Use Talk2Book.ipynb with the vector store you created

And make it an app:

  1. Duplicate this Hugging Face Space (or just copy the code in app.py) and change the vector store to the one you created in step 2

Contributing

  1. Fork
  2. Install requirements: pip install -r requirements.txt (also at the top of each notebook)
  3. Install nbdev: pip instal nbdev
  4. Make changes, run your notebooks

In the terminal, before each commit:

  1. Run nbdev_install_hooks to clean the notebooks (removes metadata)

And finally:

  1. Submit your PR

Using Codespaces/VSCode

Everything you need will be installed when you open Codespaces/VSCode; specified in .devcontainer/

Notes for Codespaces:

  • Currently Jupyter notebook doesnโ€™t work on Codespaces for an unknown reason, or at least I canโ€™t, so youโ€™ll have to use JupyterLab
  • Open with jupyter lab --NotebookApp.allow_origin='*' --NotebookApp.ip='0.0.0.0'
  • For more info on using see https://code.visualstudio.com/docs/datascience/notebooks-web

About

Use AI to personify books, so that you can talk to them ๐Ÿ™Š


Languages

Language:Jupyter Notebook 99.6%Language:Shell 0.4%