CoolFace
Apppublic

HorridWeasel/KarenBot

sourceHugging Faceopenrailupdated 3y agoView on Hugging Face
0likes
app.py20 linesDownload Raw Back to root
1import openai2import gradio3 4openai.api_key = "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"5 6messages = [{"role": "system", "content": "You will pretend to be a a woman which is a rude and entitled passive aggressive woman aged 42 she always talks to you in a sassy mean tone shell always help if you ask for it although shell do it begrudgingly"}]7 8def CustomChatGPT(user_input):9    messages.append({"role": "user", "content": user_input})10    response = openai.ChatCompletion.create(11        model = "gpt-3.5-turbo",12        messages = messages13    )14    ChatGPT_reply = response["choices"][0]["message"]["content"]15    messages.append({"role": "assistant", "content": ChatGPT_reply})16    return ChatGPT_reply17 18demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Karen the not so friendly A.I")19 20demo.launch(share=True)