typesdigital commited on
Commit
fd0cd09
·
1 Parent(s): f34ae20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -5,8 +5,8 @@ openai.api_key = "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"
5
 
6
  messages = [{"role": "system", "content": "You are a Twitter Tweets expert that specializes in creating viral tweets for startup marketing and updates."}]
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
@@ -15,5 +15,5 @@ def CustomChatGPT(user_input):
15
  messages.append({"role": "assistant", "content": ChatGPT_reply})
16
  return ChatGPT_reply
17
 
18
- demo = gr.Interface(fn=CustomChatGPT, inputs="text", outputs="text", title="Twitter Tweets Pro")
19
  demo.launch()
 
5
 
6
  messages = [{"role": "system", "content": "You are a Twitter Tweets expert that specializes in creating viral tweets for startup marketing and updates."}]
7
 
8
+ def CustomChatGPT(message):
9
+ messages.append({"role": "user", "content": message})
10
  response = openai.ChatCompletion.create(
11
  model="gpt-3.5-turbo",
12
  messages=messages
 
15
  messages.append({"role": "assistant", "content": ChatGPT_reply})
16
  return ChatGPT_reply
17
 
18
+ demo = gr.Interface(fn=CustomChatGPT, inputs="text", outputs="text", title="Twitter Tweets Pro", inputs_label="Enter a message")
19
  demo.launch()