fastx commited on
Commit
7567357
·
1 Parent(s): 2657465

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -11,7 +11,13 @@ def chatbot(input):
11
  if input:
12
  messages.append({"role": "user", "content": input})
13
  chat = openai.ChatCompletion.create(
14
- model="gpt-3.5-turbo", messages=messages
 
 
 
 
 
 
15
  )
16
  reply = chat.choices[0].message.content
17
  messages.append({"role": "assistant", "content": reply})
@@ -20,6 +26,6 @@ def chatbot(input):
20
  inputs = gr.inputs.Textbox(lines=7, label="Chat with AI")
21
  outputs = gr.outputs.Textbox(label="Reply")
22
 
23
- gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Chatbot",
24
  description="Ask anything you want",
25
  theme="compact").launch()
 
11
  if input:
12
  messages.append({"role": "user", "content": input})
13
  chat = openai.ChatCompletion.create(
14
+ model="gpt-3.5-turbo", messages=messages,
15
+ temperature=1.2,
16
+ max_tokens=2500,
17
+ top_p=1,
18
+ frequency_penalty=0,
19
+ presence_penalty=0
20
+
21
  )
22
  reply = chat.choices[0].message.content
23
  messages.append({"role": "assistant", "content": reply})
 
26
  inputs = gr.inputs.Textbox(lines=7, label="Chat with AI")
27
  outputs = gr.outputs.Textbox(label="Reply")
28
 
29
+ gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="Lisa's AI Chatbot",
30
  description="Ask anything you want",
31
  theme="compact").launch()