You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我提前启动了一个vllm server,然后用下面的代码:
from memos.configs.mem_chat import MemChatConfigFactory
from memos.configs.mem_cube import GeneralMemCubeConfig
from memos.mem_chat.factory import MemChatFactory
from memos.mem_cube.general import GeneralMemCube
运行后,每次只要问两个问题,问了第三个问题敲了回车,就会报错:
Traceback (most recent call last):
File "/home/qiaoyifan/test/chat.py", line 98, in
mem_chat.run()
File "/home/qiaoyifan/.local/lib/python3.11/site-packages/memos/mem_chat/simple.py", line 84, in run
system_prompt = self._build_system_prompt(memories)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/qiaoyifan/.local/lib/python3.11/site-packages/memos/mem_chat/simple.py", line 152, in _build_system_prompt
memory_context += f"{i}. ({memory.metadata.memory_time}) {memory.memory}\n"
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/qiaoyifan/.local/lib/python3.11/site-packages/pydantic/main.py", line 991, in getattr
raise AttributeError(f'{type(self).name!r} object has no attribute {item!r}')
AttributeError: 'TextualMemoryMetadata' object has no attribute 'memory_time'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
我提前启动了一个vllm server,然后用下面的代码:
from memos.configs.mem_chat import MemChatConfigFactory
from memos.configs.mem_cube import GeneralMemCubeConfig
from memos.mem_chat.factory import MemChatFactory
from memos.mem_cube.general import GeneralMemCube
memchat_config = MemChatConfigFactory.model_validate(
{
"backend": "simple",
"config": {
"user_id": "user_123",
"chat_llm": {
"backend": "vllm",
"config": {
"model_name_or_path": "/home/qiaoyifan/models/Qwen3-14B",
"temperature": 0.7,
"api_base": "http://localhost:8088/v1",
"remove_think_prefix": True,
"max_tokens": 10240,
"model_schema": "memos.configs.llm.VLLMLLMConfig",
},
},
"max_turns_window": 20,
"top_k": 50,
"enable_textual_memory": True,
"enable_activation_memory": False,
"enable_parametric_memory": False,
},
}
)
config = GeneralMemCubeConfig.model_validate(
{
"user_id": "user03alice",
"cube_id": "user03alice/mem_cube_tree",
"text_mem": {
"backend": "naive_text",
"config": {
"extractor_llm": {
"backend": "vllm",
"config": {
"model_name_or_path": "/home/qiaoyifan/models/Qwen3-14B",
"temperature": 0.7,
"remove_think_prefix": True,
"max_tokens": 20480,
"api_base": "http://localhost:8088/v1",
},
},
},
},
"act_mem": {
"backend": "kv_cache",
"config": {
"memory_filename": "activation_memory.pickle",
"extractor_llm": {
"backend": "vllm",
"config": {
"model_name_or_path": "/home/qiaoyifan/models/Qwen3-14B",
"temperature": 0.7,
"max_tokens": 20480,
"top_p": 0.9,
"top_k": 50,
"remove_think_prefix": False,
"api_base": "http://localhost:8088/v1",
},
},
},
},
"para_mem": {
"backend": "lora",
"config": {
"memory_filename": "parametric_memory.adapter",
"extractor_llm": {
"backend": "huggingface",
"config": {
"model_name_or_path": "/home/qiaoyifan/models/Qwen3-14B",
"temperature": 0.7,
"max_tokens": 20480,
"top_p": 0.9,
"top_k": 50,
"remove_think_prefix": False,
},
},
},
},
},
)
mem_cube = GeneralMemCube(config)
mem_chat = MemChatFactory.from_config(memchat_config)
#mem_chat.mem_cube = GeneralMemCube.init_from_dir("examples/data/mem_cube_2")
mem_chat.mem_cube = mem_cube
mem_chat.run()
mem_chat.mem_cube.dump("/tmp/mem_cube")
运行后,每次只要问两个问题,问了第三个问题敲了回车,就会报错:
Traceback (most recent call last):
File "/home/qiaoyifan/test/chat.py", line 98, in
mem_chat.run()
File "/home/qiaoyifan/.local/lib/python3.11/site-packages/memos/mem_chat/simple.py", line 84, in run
system_prompt = self._build_system_prompt(memories)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/qiaoyifan/.local/lib/python3.11/site-packages/memos/mem_chat/simple.py", line 152, in _build_system_prompt
memory_context += f"{i}. ({memory.metadata.memory_time}) {memory.memory}\n"
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/qiaoyifan/.local/lib/python3.11/site-packages/pydantic/main.py", line 991, in getattr
raise AttributeError(f'{type(self).name!r} object has no attribute {item!r}')
AttributeError: 'TextualMemoryMetadata' object has no attribute 'memory_time'
FYI:我这边用的昇腾环境,没有ollama支持,所以backend尽量选的vllm
Beta Was this translation helpful? Give feedback.
All reactions