Simple telegram bot with GPT4free
Thanks to xtekky
Supports poe.com, thb.ai, you.com, deepai.org, AI Assist
Supports multiple bots in poe.com
Hugging face token is only required for image captioning.
Support OCR with tesseract additional to salesforce blip image captioning
Supports voice transcription with openai whisper
Text to image (stable diffusion) uses hugging face hosted space feel free to change to your own space
HG_img2text = 'https://api-inference.huggingface.co/models/Salesforce/blip-image-captioning-large'
HG_text2img = 'https://noes14155-runwayml-stable-diffusion-v1-5.hf.space/'
line 15 and 16 in main.py
Download or clone this repository
Change environment variables in .env file. Environment Variables
install the requirements(Install takes more time due to openai whisper package and its dependencies)
pip install -r requirements.txt
Run main.py
python main.py
Build
docker build -t telegrambot_gpt4free:latest "."
Docker-compose
docker-compose up --build -d
To run this project, you will need to create a .env file and add the following environment variables
BOT_TOKEN
Get this by messaging @botfather Refer to https://core.telegram.org/bots/tutorial#obtain-your-bot-token
POE_TOKEN
Optional (leave it blank if you don't want to use quora(poe.com))
Sign up to Poe and head over to the site
ctrl+shift+i to open developer console
Go to Application -> Cookies -> https://poe.com
Find the p-b cookie and copy its value, this will be your Poe-token
HG_TOKEN
Optional(Required forimage captioning). Sign up on hugging face and get the token from here