sir-aadiboii commited on
Commit
69b4817
·
verified ·
1 Parent(s): f0464be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -5,21 +5,21 @@ import random
5
  client=InferenceClient("HuggingFaceH4/zephyr-7b-beta")
6
 
7
  def respond(message, history):
8
- responses = ["Yes", "No"]
9
- return random.choice(responses)
10
 
11
  messages = [
12
  {"role":"system",
13
  "content":"You are a friendly chatbot :)"
14
  }
15
  ]
16
-
17
- if history:
18
- messages.extend(history)
19
-
20
- response = client.chat_completion(messages, max_tokens=100)
21
-
22
- return response["choices"][0]["message"]["content"].strip()
23
 
24
  chatbot = gr.ChatInterface(respond, type="messages")
25
  chatbot.launch()
 
5
  client=InferenceClient("HuggingFaceH4/zephyr-7b-beta")
6
 
7
  def respond(message, history):
8
+ #responses = ["Yes", "No"]
9
+ #return random.choice(responses)
10
 
11
  messages = [
12
  {"role":"system",
13
  "content":"You are a friendly chatbot :)"
14
  }
15
  ]
16
+
17
+ if history:
18
+ messages.extend(history)
19
+
20
+ response = client.chat_completion(messages, max_tokens=100)
21
+
22
+ return response["choices"][0]["message"]["content"].strip()
23
 
24
  chatbot = gr.ChatInterface(respond, type="messages")
25
  chatbot.launch()