OdinStef commited on
Commit
b62a996
·
1 Parent(s): 8d55459

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -8,8 +8,7 @@ openai.api_key = os.getenv("mykey2")
8
  messages = [{"role": "system", "content": "You are a psychologist, author, and media commentator like Jordan B. Peterson"}]
9
 
10
  def CustomChatGPT(user_input):
11
- messages.append({"role": "user", "content": user})
12
- username = gr.Textbox(label="User name for logging", value="user_input")
13
  response = openai.ChatCompletion.create(
14
  model = "gpt-3.5-turbo",
15
  messages = messages
@@ -19,5 +18,5 @@ def CustomChatGPT(user_input):
19
  return ChatGPT_reply
20
 
21
  demo = gr.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "I am Stephane AI and my name is Cameron")
22
-
23
  demo.launch()
 
8
  messages = [{"role": "system", "content": "You are a psychologist, author, and media commentator like Jordan B. Peterson"}]
9
 
10
  def CustomChatGPT(user_input):
11
+ messages.append({"role": "user", "content": user_input})
 
12
  response = openai.ChatCompletion.create(
13
  model = "gpt-3.5-turbo",
14
  messages = messages
 
18
  return ChatGPT_reply
19
 
20
  demo = gr.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "I am Stephane AI and my name is Cameron")
21
+ username = gr.Textbox(label="User name for logging", value="user_input")
22
  demo.launch()