-
System Info谢谢,公司服务无法联网 Reproduction
OthersNo response |
Beta Was this translation helpful? Give feedback.
Answered by
Ki-Seki
Jul 10, 2025
Replies: 2 comments
-
from memos.configs.llm import LLMConfigFactory
from memos.llms.factory import LLMFactory
config = LLMConfigFactory.model_validate(
{
"backend": "huggingface",
"config": {
"model_name_or_path": "Qwen/Qwen3-1.7B",
"temperature": 0.8,
"max_tokens": 1024,
"top_p": 0.9,
"top_k": 50,
},
}
)
llm = LLMFactory.from_config(config)
messages = [
{"role": "user", "content": "Hello, who are you"},
]
response = llm.generate(messages)
print("Scenario 4:", response)
print("==" * 20) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Ki-Seki
-
谢谢 么么哒 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
examples/basic_modules/llm.py
里有使用本地模型的示例,修改model_name_or_path
即可。