AlyssaD commited on
Commit
2111f4b
·
verified ·
1 Parent(s): 6dc0700

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -9,18 +9,15 @@ client = InferenceClient("microsoft/phi-4")
9
 
10
  def respond(message, history):
11
  messages = [{"role": "system", "content": "You are a friendly chatbot"}]
12
-
13
- if history:
14
- messages.extend(history)
15
 
16
- messages.append({"role": "user", "content": message})
17
-
18
- response = client.chat_completion(
19
- messages,
20
- max_tokens=100
 
21
  )
22
-
23
- return response['choices'][0]['message']['content'].strip()
24
 
25
 
26
  #def echo(message, history):
 
9
 
10
  def respond(message, history):
11
  messages = [{"role": "system", "content": "You are a friendly chatbot"}]
 
 
 
12
 
13
+ if history:
14
+ messages.extend(history)
15
+ messages.append({"role": "user", "content": message})
16
+ response = client.chat_completion(
17
+ messages,
18
+ max_tokens=100
19
  )
20
+ return response['choices'][0]['message']['content'].strip()
 
21
 
22
 
23
  #def echo(message, history):