Skip to content

Commit 1bb0bcd

Browse files
author
yuan.wang
committed
llm param modify
1 parent 5ab6e92 commit 1bb0bcd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/memos/configs/llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class BaseLLMConfig(BaseConfig):
1010

1111
model_name_or_path: str = Field(..., description="Model name or path")
1212
temperature: float = Field(default=0.7, description="Temperature for sampling")
13-
max_tokens: int = Field(default=8192, description="Maximum number of tokens to generate")
13+
max_tokens: int = Field(default=4096, description="Maximum number of tokens to generate")
1414
top_p: float = Field(default=0.95, description="Top-p sampling parameter")
1515
top_k: int = Field(default=50, description="Top-k sampling parameter")
1616
remove_think_prefix: bool = Field(

src/memos/mem_reader/read_multi_modal/system_parser.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Parser for system messages."""
22

3+
import ast
34
import json
45
import re
56
import uuid
@@ -137,8 +138,14 @@ def parse_fine(
137138
tool_schema = json.loads(content)
138139
assert isinstance(tool_schema, list), "Tool schema must be a list[dict]"
139140
except json.JSONDecodeError:
140-
logger.warning(f"[SystemParser] Failed to parse tool schema: {content}")
141-
return []
141+
try:
142+
tool_schema = ast.literal_eval(content)
143+
assert isinstance(tool_schema, list), "Tool schema must be a list[dict]"
144+
except (ValueError, SyntaxError, AssertionError):
145+
logger.warning(
146+
f"[SystemParser] Failed to parse tool schema with both JSON and ast.literal_eval: {content}"
147+
)
148+
return []
142149
except AssertionError:
143150
logger.warning(f"[SystemParser] Tool schema must be a list[dict]: {content}")
144151
return []

0 commit comments

Comments
 (0)