Setup

Duplicate the ChatGPT space:

https://huggingface.co/spaces/Xhaheen/ChatGPT_HF

The actual code is only around 20 lines:

Grab the session key:

and profit:

and