emma-yay commited on
Commit
cd02aff
·
verified ·
1 Parent(s): 0930480
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -11,9 +11,15 @@ def respond(message,history):
11
  messages,
12
  max_tokens=100,
13
  temperature= 0.9,
14
- top_p= 0.9
 
15
  )
16
  return response.choices[0].message.content.strip()
 
 
 
 
 
17
  #return random.choice(["Not today pal","Maybe or Maybe not","Who knows, do you know?","Do you know you are spectacularly annoying hun?",message,"Yes","No","Why","Shush"])
18
  chatbot= gr.ChatInterface(respond, title="Mean Bot")
19
  chatbot.launch()
 
11
  messages,
12
  max_tokens=100,
13
  temperature= 0.9,
14
+ top_p= 0.9,
15
+ stream=True
16
  )
17
  return response.choices[0].message.content.strip()
18
+ for
19
+ respond()
20
+ token=message.choices[0].delta.content
21
+ respond+=token
22
+ yield repond
23
  #return random.choice(["Not today pal","Maybe or Maybe not","Who knows, do you know?","Do you know you are spectacularly annoying hun?",message,"Yes","No","Why","Shush"])
24
  chatbot= gr.ChatInterface(respond, title="Mean Bot")
25
  chatbot.launch()