This Python project generates your own Distracted Boyfriend meme.
You input in a topic of interest and LangChain and OpenAI generate the text for the meme. We pass this on to Imgflip to generate the actual meme.
With LangChain we:
- Describe the Distracted Boyfriend meme
- Generate text based on a topic you input
- Leverage LangChains
ResponseSchema
,StructuredOutputParser
andChatPromptTemplate
to return a determinate JSON response - Grab the text from the response and send that off to Imgflip to generate the meme
This app runs locally on your machine with Flask.
This project was started with the OpenAI python quickstart repo.
A demo using Lex Fridman: https://lexfridman.com/.
Video: https://youtu.be/eYwDiV8hhB8
Before you begin, ensure you have met the following requirements:
- Installed a recent version of Python (3.7 or newer) installed and a way to create virtual environments (virtualenv or conda)
- Created OpenAI API account and obtain an OpenAI API key
- Created a Imgflip account and save your username and password
Clone the repo
git clone https://github.com/waseemhnyc/Distracted-Boyfriend-AI-Meme-Generator
Create a virutalenv and source the environment
python3 -m venv myenv
source venv/bin/activate
Install the necessary libraries
pip install -r requirements.txt
Create a .env file and input your OpenAI API Key and Imgflip credentials in the file
cp .env.example .env
To run the program, run the following command in the terminal:
flask run
- Twitter: https://twitter.com/waseemhnyc
- Email: waseemh.nyc@gmail.com
This project is licensed under the MIT License - see the LICENSE file for details.