Arjn commited on
Commit
2ad33af
·
1 Parent(s): ee1f3de
Files changed (1) hide show
  1. Real/main.py +22 -0
Real/main.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import openai
2
+ import gradio
3
+
4
+ openai.api_key= "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"
5
+
6
+ messages = [{"role": "user", "content": "you are anything everything the greatmasterminds"}]
7
+
8
+ def CustomChatGPT(user_input):
9
+ messages.append({"role": "user","content": user_input})
10
+ response=openai.ChatCompletion.create(
11
+ model= "gpt-3.5-turbo",
12
+ messages = messages
13
+
14
+
15
+
16
+ )
17
+ ChatGPT_reply = response["choices"][0]["message"]["content"]
18
+ messages.append({"role": "assistant", "content": ChatGPT_reply})
19
+ return ChatGPT_reply
20
+ demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "SecureX beta")
21
+
22
+ demo.launch(share=True)