catherineThurgood commited on
Commit
0dbc77d
·
verified ·
1 Parent(s): 77557a1

university helping chat bot

Browse files

made the chatbot friendly and updated max tokens to 500

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,7 +5,7 @@ from huggingface_hub import InferenceClient
5
  client = InferenceClient("microsoft/phi-4")
6
 
7
  def respond(message, history):
8
- messages = [{"role": "system", "content": "you help pick options for university subjects"}]
9
 
10
  if history:
11
  messages.extend(history)
@@ -15,7 +15,7 @@ def respond(message, history):
15
 
16
  response = client.chat_completion(
17
  messages,
18
- max_tokens=100
19
  )
20
  return response['choices'][0]['message']['content'].strip()
21
 
 
5
  client = InferenceClient("microsoft/phi-4")
6
 
7
  def respond(message, history):
8
+ messages = [{"role": "system", "content": "you are a friendly chatbot to help pick options for university subjects"}]
9
 
10
  if history:
11
  messages.extend(history)
 
15
 
16
  response = client.chat_completion(
17
  messages,
18
+ max_tokens=500
19
  )
20
  return response['choices'][0]['message']['content'].strip()
21