An intelligent Twitter bot that generates and posts engaging tweets about data engineering using the LLaMA language model.
- 🤖 Automated tweet generation using LLaMA 2 model
- 🎯 Focused on data engineering topics
- 🔄 Variable outputs with temperature control
- ✍️ Multiple prompt templates for diversity
- ✅ Character limit compliance for Twitter
- 🔄 Automated posting capability
- Python 3.8+
- LLaMA 2 model file (7B-chat quantized version)
- Twitter Developer Account with API credentials
-
Clone the repository:
git clone https://github.com/YOUR_USERNAME/TwitterBot.git cd TwitterBot -
Install required packages:
pip install -r requirements.txt
-
Set up your environment variables in a
.envfile:CONSUMER_KEY=your_twitter_consumer_key CONSUMER_SECRET=your_twitter_consumer_secret ACCESS_TOKEN=your_twitter_access_token ACCESS_TOKEN_SECRET=your_twitter_access_token_secret
-
Download the LLaMA model:
- Download the LLaMA 2 7B-chat quantized model
- Place it in a
modelsdirectory - Update the model path in
twitter_bot.py
Run the bot:
python twitter_bot.pyYou can modify the following parameters in twitter_bot.py:
temperature: Controls output randomness (0.0 to 1.0)max_new_tokens: Controls response length- Prompt templates for tweet generation
- tweepy
- python-dotenv
- langchain
- ctransformers
Feel free to open issues or submit pull requests for improvements.
MIT License
This repo is for a Bot which will help with my X updates
d3cb1e73e9715776796395bbf01557d6846dca36