xuqinyang commited on
Commit
897b0b4
1 Parent(s): 6e5ccfa

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +1 -1
model.py CHANGED
@@ -26,7 +26,7 @@ def run(message: str,
26
  history.append({"role": "assistant", "content": i[1]})
27
  print(history)
28
  history.append({"role": "user", "content": message})
29
- for response in llm.create_chat_completion(history,stream=True,max_tokens=-1,temperature=temperature,top_k=top_k,top_p=top_p,repeat_penalty=1.1):
30
  if "content" in response["choices"][0]["delta"]:
31
  result = result + response["choices"][0]["delta"]["content"]
32
  yield result
 
26
  history.append({"role": "assistant", "content": i[1]})
27
  print(history)
28
  history.append({"role": "user", "content": message})
29
+ for response in llm.create_chat_completion(history,stop=["</s>"],stream=True,max_tokens=-1,temperature=temperature,top_k=top_k,top_p=top_p,repeat_penalty=1.1):
30
  if "content" in response["choices"][0]["delta"]:
31
  result = result + response["choices"][0]["delta"]["content"]
32
  yield result