Generate random "inspirational" quotes images by using an AI text generation model.
The following models can be used:
- bigscience/bloom through Hugging Face Inference API
- mistralai/Mixtral-8x7B-Instruct-v0.1 through Hugging Face Inference API
- meta-llama/Meta-Llama-3-70B through GroqCloud API
- A background is picked from Unsplash, either randomly or by giving roboquote a search query.
- The model is prompted to give an "inspirational" quote for the given background search query.
- The quote is inserted on the image which is then saved.
- Install the project with poetry by doing
poetry install
. - Set environment variables for configuration (the project uses environs so you can also put the variable in a env file):
HUGGING_FACE_ACCESS_TOKEN
(required): your Hugging Face access token for their Inference APIGROQ_CLOUD_API_KEY
(required): your GroqCloud API key for their APILOG_LEVEL
(optional, default isWARNING
): log level of the applicationWEB_DEBUG
(optional, default isFalse
): if you want to run the web app in debug mode (should not be required)
Run poetry run python main.py my_file.jpg
to generate a new random image.
See poetry run python main.py --help
for the available options.
The web version is a Starlette application (roboquote.web.app:app
).
It can be launched quickly locally with uvicorn through the make run-web
command.
- atomicparade for the code used to do the text auto wrapping
- BigScience Workshop for the BLOOM model used
- Google Fonts for the fonts used in the pictures.
- Groq for their inference API
- Hugging Face for the inference API
- Mistral AI for the Mistral-7B-Instruct-v0.1 model used
- Unsplash for the background images.