Skip to content

Commit cb30ebc

Browse files
sufubaoshihaobai
andcommitted
fix openai v1 (#1178)
Co-authored-by: shihaobai <42648726+shihaobai@users.noreply.github.com>
1 parent f59f258 commit cb30ebc

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

lightllm/models/qwen2/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, kvargs):
1818

1919
def _init_config(self):
2020
super()._init_config()
21-
if self.config["sliding_window"] is None:
21+
if self.config.get("sliding_window", None) is None:
2222
self.config["sliding_window"] = self.max_total_token_num
2323
# rename key [SYM: to be confirmed]
2424
return

lightllm/server/api_models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ class Message(BaseModel):
2424
class Function(BaseModel):
2525
"""Function descriptions."""
2626

27-
description: Optional[str] = Field(default=None, examples=[None])
2827
name: Optional[str] = None
29-
parameters: Optional[object] = None
28+
description: Optional[str] = Field(default=None, examples=[None])
29+
parameters: Optional[dict] = None
30+
response: Optional[dict] = None
3031

3132

3233
class Tool(BaseModel):

lightllm/server/api_openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _process_tool_call_id(
8181
# SGLang sets call_item.tool_index to the *local* position inside that message.
8282
# Therefore, the index must be corrected by using
8383
# `history_tool_calls_cnt + call_item.tool_index` to ensure globally unique and properly ordered.
84-
tool_call_id = f"functions.{call_item.name}:{history_tool_calls_cnt+call_item.tool_index}"
84+
tool_call_id = f"functions.{call_item.name}:{history_tool_calls_cnt + call_item.tool_index}"
8585
logger.debug(
8686
f"Process tool call idx, parser: {tool_call_parser}, \
8787
tool_call_id: {tool_call_id}, \

lightllm/server/core/objs/sampling_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
_SAMPLING_EPS = 1e-5
99
DEFAULT_INPUT_PENALTY = os.getenv("INPUT_PENALTY", "False").upper() in ["ON", "TRUE", "1"]
10-
SKIP_SPECIAL_TOKENS = os.getenv("SKIP_SPECIAL_TOKENS", "True").upper() in ["ON", "TRUE", "1"]
10+
SKIP_SPECIAL_TOKENS = os.getenv("SKIP_SPECIAL_TOKENS", "False").upper() in ["ON", "TRUE", "1"]
1111

1212
# 从环境变量获取最大长度限制
1313
STOP_SEQUENCE_MAX_LENGTH = int(os.getenv("LIGHTLLM_STOP_SEQUENCE_MAX_LENGTH", 256))

0 commit comments

Comments
 (0)