FairyTailor: Multimodal Generative Framework for Storytelling
Users can create a cohesive children's story by weaving generated texts and retrieved images with their input. With co-creation, writers contribute their creative thinking, while generative models contribute to their constant workflow. FairyTailor adds another modality and modifies the text generation process to help producing a coherent and creative story.
FairyTailor_2021.mov
Notice (Updated September 17, 2023): The live demo and dvc downloads are no longer available.
After cloning the repository:
Client (Vue 2.6)
Install and check that the client compiles:
cd client
npm i
npm run build
Backend (FASTAPI)
Install and activate the environment (conda provided):
conda env create -f environment.yml
conda activate MultiModalStory
Install environment globally in the directory:
pip install -e .
pip install git+https://github.com/openai/CLIP.git
After installation run:
python -m spacy download en_core_web_sm
In python terminal:
nltk.download('wordnet')
nltk.download('sentiwordnet')
nltk.download('averaged_perceptron_tagger')
[DEPRECTAED] Large Data Management (dvc)
Our large data files are stored on IBM's Cloud Object Storage, and to pull data files from that platform you will use a special, read-only .dvc/config
file.
dvc pull -f
Which will pull:
- backend/outputs (five preset stories)
- backend/story_generator/downloaded (transformers)
- client/public/unsplash25k (styled images)
Client:
cd client
npm run devw
Backend (with server auto reload):
uvicorn backend.server:app --reload --reload-dir backend
Open the uvicorn server localhost:8000
in your web browser
- Place the transformer in
backend/story_generator/downloaded directory
. - Update the current model path by changing the constant
FINETUNED_GPT2_PATH
inbackend/story_generator/constants.py
.
- Replace the folder
client/public/unsplash25k/sketch_images1024
with yours. - Update the current path by changing the constant
IMAGE_PATH
inclient/src/components/Constants.js
.
- Add functions to the backend endpoint at
backend/server/main.py
. - Update
client/src/js/api/mainApi.js
to call the backend endpoint from the client. - Update the corresponding user components in
client/src/components
.