Skip to content

Commit 02a5d33

Browse files
author
xusenlin
committed
Refactor code
1 parent 42ab07a commit 02a5d33

26 files changed

+1175
-1228
lines changed

api/apapter/template.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class Chatglm3Template(BaseTemplate):
264264
name = "chatglm3"
265265
allow_models = ["chatglm3"]
266266
stop = {
267-
"strings": ["<|user|>", "<|observation|>", "</s>", "<|observation|>"],
267+
"strings": ["<|user|>", "</s>", "<|observation|>"],
268268
"token_ids": [64795, 64797, 2],
269269
}
270270

@@ -957,7 +957,8 @@ class YiAITemplate(BaseTemplate):
957957
name = "yi"
958958
allow_models = ["yi"]
959959
stop = {
960-
"strings": ["<|im_end|>"],
960+
"strings": ["<|endoftext|>", "<|im_end|>"],
961+
"token_ids": [2, 6, 7, 8], # "<|endoftext|>", "<|im_start|>", "<|im_end|>", "<|im_sep|>"
961962
}
962963

963964
@property

api/config.py

-5
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,6 @@ class Settings(BaseModel):
123123
ge=-1,
124124
description="Context length for generating completions."
125125
)
126-
stream_interverl: Optional[int] = Field(
127-
default=int(get_env("STREAM_INTERVERL", 2)),
128-
ge=1,
129-
description="Stream interverl for generating completions."
130-
)
131126
chat_template: Optional[str] = Field(
132127
default=get_env("PROMPT_NAME", None),
133128
description="Chat template for generating completions."

api/core/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)