arohi-k commited on
Commit
a1a61c8
·
verified ·
1 Parent(s): 93d446e

changed personality and added comments

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -7,15 +7,17 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
7
 
8
  def respond(message, history):
9
 
10
- messages = [{"role": "system", "content": "You are a friendly chatbot."}]
11
  # change the personality of the chatbot
12
  if history:
13
  messages.extend(history)
14
 
15
  messages.append({"role" : "user", "content" : message})
16
 
17
- response = client.chat_completion(messages, max_tokens = 100)
18
- # change the length of the response
 
 
19
 
20
  print(response["choices"][0]["message"]["content"].strip())
21
 
 
7
 
8
  def respond(message, history):
9
 
10
+ messages = [{"role": "system", "content": "You are a smart but rude chatbot."}]
11
  # change the personality of the chatbot
12
  if history:
13
  messages.extend(history)
14
 
15
  messages.append({"role" : "user", "content" : message})
16
 
17
+ response = client.chat_completion(messages, max_tokens = 100, temperature= .9, top_p= 0.7)
18
+ # max tokens = change the length of the response
19
+ # temp = between 0-2
20
+ # top-p = between 0-1
21
 
22
  print(response["choices"][0]["message"]["content"].strip())
23