Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

采样过程问题 #3181

Closed
huxiaosheng123 opened this issue Feb 19, 2025 · 3 comments
Closed

采样过程问题 #3181

huxiaosheng123 opened this issue Feb 19, 2025 · 3 comments

Comments

@huxiaosheng123
Copy link

huxiaosheng123 commented Feb 19, 2025

Describe the bug
swift sample --model /train_model/Qwen2.5-7B-Instruct/ --sampler_engine lmdeploy --num_return_sequences 5 --n_best_to_keep 3 --dataset /ms-swift/dataset/AI-ModelScope/alpaca-gpt4-data-zh#5 --prm_model /train_model/GRM-Llama3.2-3B-rewardmodel-ft/

swift sample --model /train_model/Qwen2.5-7B-Instruct/ --sampler_engine lmdeploy --num_return_sequences 5 --n_best_to_keep 3 --dataset /ms-swift/dataset/AI-ModelScope/alpaca-gpt4-data-zh#5 --orm_model math

都报错 /ms-swift/swift/llm/sampling/vanilla_sampler.py", line 136, in generate
if resp_list[j].choices[0].message.content:
AttributeError: 'AttributeError' object has no attribute 'choices'

--sampler_engine lmdeploy 换成pt,报错:'PtEngine' object is not callable

@tastelikefeet
Copy link
Collaborator

拉下最新的main代码,已经修复了 #

@huxiaosheng123
Copy link
Author

huxiaosheng123 commented Feb 19, 2025

拉下最新的main代码,已经修复了 #

Traceback (most recent call last):
File "/ms-swift-main/swift/cli/sample.py", line 5, in
sampling_main()
File "/ms-swift-main/swift/llm/sampling/sampling.py", line 73, in sampling_main
return SwiftSampling(args).main()
File "/ms-swift-main/swift/llm/base.py", line 46, in main
result = self.run()
File "/ms-swift-main/swift/llm/sampling/sampling.py", line 64, in run
generated = self.sampler.do_sample(slices)
File "/ms-swift-main/swift/llm/sampling/vanilla_sampler.py", line 169, in do_sample
prm_score, _prm_mask = get_reward(
File "/ms-swift-main/swift/llm/sampling/utils.py", line 45, in get_reward
rewards = model(infer_requests, request_config=request_config, **gt_param)
TypeError: 'PtEngine' object is not callable

刚拉的main代码,还是会报错

--sampler_engine lmdeploy 方式:
AttributeError("'AsyncEngine' object has no attribute 'get_generator'")

@tastelikefeet
Copy link
Collaborator

抱歉最近我们在忙于GRPO的事情,已修复 #3184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants