ChatGPT icon indicating copy to clipboard operation
ChatGPT copied to clipboard

Use revChatGPT in headless linux server / hosted online app

Open gustavz opened this issue 2 years ago • 3 comments
trafficstars

I was not able to use revChatGPT in a hosted streamlit app (headless linux server), it only works in offline/local apps. In hosted apps it seems to fail to open a new chrome window to log into the chatgppt session with error

local variable 'driver' referenced before assignment

deployed app: https://jaivus.streamlit.app/ repo: https://github.com/gustavz/jaivus

Is there a way to use revChatGPT in an online/hosted app, or is it only for offline/local usage?

gustavz avatar Jan 30 '23 10:01 gustavz

I tried it with installing

chromium
chromium-driver

but that does not help

gustavz avatar Jan 30 '23 12:01 gustavz

Use Xvfb

acheong08 avatar Jan 30 '23 12:01 acheong08

https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/743#issuecomment-1366847803

acheong08 avatar Jan 30 '23 12:01 acheong08

@gustavz You can also take a look at this. https://github.com/ahmetkca/chatgpt-unofficial-api-docker/tree/my-docker-novnc It might solve your problem. I designed this to be able to deploy to AWS.

ahmetkca avatar Feb 02 '23 06:02 ahmetkca

@acheong08 I am using xvfb, here is the full packages list i use to host: https://github.com/gustavz/jaivus/blob/main/packages.txt

gustavz avatar Feb 02 '23 08:02 gustavz

Official API just dropped yesterday. No more browsers needed

acheong08 avatar Feb 02 '23 08:02 acheong08

Please read README

acheong08 avatar Feb 02 '23 08:02 acheong08

nice! how do I use it, just pass my api key instead of the session key into Chatbot?

gustavz avatar Feb 02 '23 11:02 gustavz

from revChatGPT.Official import Chatbot

There are some minor differences in API which you can find documented in the Wiki

acheong08 avatar Feb 02 '23 11:02 acheong08

Example usage:

https://github.com/acheong08/ChatGPT/blob/main/src/revChatGPT/Official.py#L347-L451

acheong08 avatar Feb 02 '23 11:02 acheong08

great, works for me now thanks!

gustavz avatar Feb 02 '23 12:02 gustavz