chatgpt_telegram_bot icon indicating copy to clipboard operation
chatgpt_telegram_bot copied to clipboard

GPT4-Turbo and vision support

Open djx2726889 opened this issue 1 year ago • 13 comments

Hello, GPT-4 Turbo and the Vision Model have been released by OpenAI. Can you provide support for these models?

djx2726889 avatar Nov 09 '23 09:11 djx2726889

You can change the models by yourself if you don't want o wait for official support.

jocxfin avatar Nov 10 '23 14:11 jocxfin

@jocxfin I'm not sure that it would work in gpt-4-vision model case. It works perfectly fine in case of gpt-4-turbo though.

yaroslavyaroslav avatar Nov 10 '23 21:11 yaroslavyaroslav

@jocxfin Me too. Didn't figure out how to use gpt-4-vision.

MrPeterJin avatar Nov 11 '23 06:11 MrPeterJin

Hey! I’ll soon add support for GPT-4 and then for DALLE-3 and GPT-4 Vision

karfly avatar Nov 11 '23 08:11 karfly

@yaroslavyaroslav How to do that? I've added new model gpt-4-1106-preview and bot says "Something went wrong during completion. Reason: Unknown model: gpt-4-1106-preview"

KillingNature avatar Nov 13 '23 20:11 KillingNature

@yaroslavyaroslav How to do that? I've added new model gpt-4-1106-preview and bot says "Something went wrong during completion. Reason: Unknown model: gpt-4-1106-preview"

Yep, it's a fun one. You have to update bot/openai_utils.py to the following state:

class ChatGPT:
    def __init__(self, model="gpt-3.5-turbo-1106"):
        assert model in {"gpt-3.5-turbo-1106", "gpt-4-1106-preview"}, f"Unknown model: {model}"

Perform a search within this file for any other checks of this models limitations, I believe I changed it more then in a single place.

yaroslavyaroslav avatar Nov 13 '23 23:11 yaroslavyaroslav

Hi! Just added support of GPT-4 Turbo ❤️ Please, test it and write here if something goes wrong

karfly avatar Nov 15 '23 14:11 karfly

Sometimes, when the answer is long, it cuts off half-way during the message editing and then it gives: Something went wrong during completion. Reason: Timed out Maybe it's way too quick? Haha

Ax3Effect avatar Nov 15 '23 19:11 Ax3Effect

@Ax3Effect turn off the enable_message_streaming: false # if set, messages will be shown to user word-by-word in config.yml. The error itself is caused by the bot pinging the Telegram API too often to edit the message. Ofc with this change you will lose the ability to see the response as it's being formed, but it still fixes the issue.

jocxfin avatar Nov 15 '23 20:11 jocxfin

You could also lower the rate at which it modifies the message via the Telegram API by increasing the sleep in that function.. from 0.1 to 0.5 or even once every 1 second..

hvanmegen avatar Nov 20 '23 02:11 hvanmegen

When can you add support for DALL-E-3 and GPT-4 Turbo with vision?

Werdan5 avatar Nov 23 '23 22:11 Werdan5

Hello everyone,

Noticed requests for gpt-4-vision in a TG bot. I've implemented it in my project chatgpt-tg with a focus on easy updates for new OpenAI features. Caveats: setup requires a real IP and a little more complex, also no group chat or DALL-E 2 support yet.

Repo here for those interested: https://github.com/ijwfly/chatgpt-tg. I'm open to feedback and any setup queries you might have.

ijwfly avatar Dec 09 '23 15:12 ijwfly

Repo here for those interested: https://github.com/ijwfly/chatgpt-tg. I'm open to feedback and any setup queries you might have.

Have tried it, quite solid release, I'd say. Gonna switch there from here.

yaroslavyaroslav avatar Dec 10 '23 15:12 yaroslavyaroslav