Reads an epub format book. Use an LLM to summarize it chapter by chapter, and write it to output.
- Install the software packages.
pip install EbookLib beautifulsoup4
pip install transformers torch
- To allow Slack integration, set an incoming webhook URL and export it to the environment variable
SLACK_WEBHOOK_URL. Otherwise, uncomment the linepost_via_webhookin the main scriptsummarize_book.py.
- Place a book in the
eBooksfolder. Let's say the file name isbook_name.epub. - Enter the
scriptsfolder. - Call
sbatch script_run.sbatchto launch the computation job to slurm. - When the job completes, the resulting book summary (in markdown) will appear in
eBooksfolder asbook_name_summary-modelname.md
- To change the GPUs to run on, modify the
script_run.sbatchscript. - To change the model, modify the
--modeland--model_shortnamewhen callingsummarize_book.py. - To change the prompt, modify the command in the
summarize_book.py
