Welcome to the LitArt repository! This project merges the beauty of literature with digital innovation to create immersive experiences for literature enthusiasts.
Demo.mp4
LitArt is a platform that combines literary analysis with interactive technology, offering tools and features that enhance the reader's and writer's experience. Our goal is to make literary works more accessible and engaging through modern technology, providing insightful analyses, interactive content, and a community for literature lovers.
This project was inspired by the need to bridge the gap between traditional literary appreciation and the digital age. We aim to transform the solitary act of reading into a more engaging and communal activity, helping users explore literature in new and exciting ways.
Before you begin, ensure you have met the following requirements:
- Python 3.8 or above
- GPU (A100, V100-SXM2)
To set up LitArt for development, follow these steps:
- Clone the Repository
git clone https://github.com/ronair212/LitArt
- Install all the dependencies in your environment (Link to setup environment)
pip install -r requirements.txt
To run LitArt on your local machine:
streamlit run app.py
This will create a port that you can open in your browser.
To forward your port to another machine.
ssh -L 5000:<YOUR-PORT> <YOUR-CLOUD-LOGIN>
This is to forward your port to https://localhost:5000
If you want to train on your data, we have created scripts for the summarization and image generation model.
Training Summarizer
sh script_ts.sh
The training script for encoder-decoder models has the following training arguments
--model "<MODEL-NAME>" \
--tokenizer "<MODEL-TOKEN>" \
--trainpath "<TRAINING-DATA-PATH>" \
--testpath "<TESTING-DATA-PATH>" \
--valpath "<VALIDATION-DATA-PATH>" \
--batchsize 16 \
--chapterlength 1024 \
--summarylength 128 \
--num_epochs 10 \
--log_path "<PATH-TO-SAVE-LOGS>" \
--cache_dir "<CACHE-DIRECTORY>"
Training Generator
sh script_sd.sh
Generator
--gradient_accumulation_steps=3 \
--mixed_precision="fp16" \
--max_train_steps=250\
--learning_rate=2e-06 \
--rank=8 \
--lora=True \
You can tweak the flags mentioned above to try different configurations for the stable diffusion model
- Streamlit - Web framework
- Transformer, diffuser, PEFT - Model fine-tuning and training
- Pytorch Lighting - Framework