xuqinyang commited on
Commit
f219d72
1 Parent(s): 3b01ff0

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +3 -0
model.py CHANGED
@@ -19,10 +19,13 @@ def run(message: str,
19
  top_p: float = 0.95,
20
  top_k: int = 50) -> Iterator[str]:
21
  history = []
 
22
  result=""
23
  for i in chat_history:
24
  history.append({"role": "user", "content": i[0]})
 
25
  history.append({"role": "assistant", "content": i[1]})
 
26
  for response in llm.create_chat_completion(history,stream=True,max_tokens=-1,temperature=0.3,top_k=5,top_p=0.85,repeat_penalty=1.1):
27
  if "content" in response["choices"][0]["delta"]:
28
  result = result + response["choices"][0]["delta"]["content"]
 
19
  top_p: float = 0.95,
20
  top_k: int = 50) -> Iterator[str]:
21
  history = []
22
+ print(chat_history)
23
  result=""
24
  for i in chat_history:
25
  history.append({"role": "user", "content": i[0]})
26
+ if len(i[1])>0
27
  history.append({"role": "assistant", "content": i[1]})
28
+ print(history)
29
  for response in llm.create_chat_completion(history,stream=True,max_tokens=-1,temperature=0.3,top_k=5,top_p=0.85,repeat_penalty=1.1):
30
  if "content" in response["choices"][0]["delta"]:
31
  result = result + response["choices"][0]["delta"]["content"]