iojw commited on
Commit
8f55d24
1 Parent(s): f33abcd

Bold prefix

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -25,7 +25,7 @@ def predict(message, history, threshold, temperature):
25
  {
26
  "role": "assistant",
27
  # Remove model name from response
28
- "content": re.sub(r"^\[.*?\]\s*", "", assistant),
29
  }
30
  )
31
  history_openai_format.append({"role": "user", "content": message})
@@ -44,7 +44,7 @@ def predict(message, history, threshold, temperature):
44
  for i, chunk in enumerate(stream):
45
  print(chunk)
46
  if i == 0:
47
- model_prefix = f"[{chunk.model}]\n"
48
  yield model_prefix
49
  partial_message += model_prefix
50
  partial_message += chunk.choices[0].delta.content or ""
 
25
  {
26
  "role": "assistant",
27
  # Remove model name from response
28
+ "content": re.sub(r"^\*\*\[.*?\]\*\*\s*", "", assistant),
29
  }
30
  )
31
  history_openai_format.append({"role": "user", "content": message})
 
44
  for i, chunk in enumerate(stream):
45
  print(chunk)
46
  if i == 0:
47
+ model_prefix = f"**[{chunk.model}]**\n"
48
  yield model_prefix
49
  partial_message += model_prefix
50
  partial_message += chunk.choices[0].delta.content or ""