xuqinyang commited on
Commit
1d97b1b
1 Parent(s): 0f120a4

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +4 -4
model.py CHANGED
@@ -15,9 +15,9 @@ def run(message: str,
15
  chat_history: list[tuple[str, str]],
16
  system_prompt: str,
17
  max_new_tokens: int = 1024,
18
- temperature: float = 0.8,
19
- top_p: float = 0.95,
20
- top_k: int = 50) -> Iterator[str]:
21
  history = []
22
  print(chat_history)
23
  result=""
@@ -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=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"]
32
  yield result
 
15
  chat_history: list[tuple[str, str]],
16
  system_prompt: str,
17
  max_new_tokens: int = 1024,
18
+ temperature: float = 0.3,
19
+ top_p: float = 0.85,
20
+ top_k: int = 5) -> Iterator[str]:
21
  history = []
22
  print(chat_history)
23
  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,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