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

fix module mapping error of baichuan model #977

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

grimoire
Copy link
Collaborator

@grimoire grimoire commented Jan 17, 2024

python -m lmdeploy.pytorch.chat \
    /path/to/baichuan2/Baichuan2-7B-Chat/ \
    baichuan2-7b
python -m lmdeploy.pytorch.chat \
    /path/to/baichuan2/Baichuan2-7B-Chat/ \
    baichuan2-7b

leads to different result.

@lvhan028 lvhan028 requested a review from AllentDan January 17, 2024 10:19
@lvhan028
Copy link
Collaborator

This is baichuan1 or baichuan2?

@AllentDan
Copy link
Collaborator

Why not just remove the last char /?

@grimoire
Copy link
Collaborator Author

This is baichuan1 or baichuan2?

baichuan2

@grimoire
Copy link
Collaborator Author

Why not just remove the last char /?

Inorder to match renamed model directory.

lmdeploy/pytorch/models/baichuan.py Outdated Show resolved Hide resolved
@lvhan028
Copy link
Collaborator

baichuan 1 or baichuan 2

@zhulinJulia24
Copy link
Collaborator

命令

lmdeploy convert baichuan2-7b /nvme/qa_test_models/Baichuan2-7B-Chat --dst-path /nvme/qa_test_models/autotest_model/workspace_Baichuan2-7B-Chat

报错

/usr/local/lib/python3.8/dist-packages/fuzzywuzzy/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
Traceback (most recent call last):
File "/usr/local/bin/lmdeploy", line 8, in
sys.exit(run())
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/cli/entrypoint.py", line 18, in run
args.run(args)
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/cli/cli.py", line 97, in convert
main(**kwargs)
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/turbomind/deploy/converter.py", line 286, in main
output_model = OUTPUT_MODELS.get(output_format)(input_model=input_model,
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/turbomind/deploy/target_model/fp.py", line 26, in init
super().init(input_model, cfg, to_file, out_dir)
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/turbomind/deploy/target_model/base.py", line 141, in init
self.cfg = self.get_config(cfg)
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/turbomind/deploy/target_model/fp.py", line 30, in get_config
final_cfg = super().get_config(cfg).dict
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/turbomind/deploy/target_model/base.py", line 160, in get_config
for bin in self.input_model.bins():
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/turbomind/deploy/source_model/base.py", line 174, in bins
for mgr in self.get_mgrs():
File "/usr/local/lib/python3.8/dist-packages/lmdeploy/turbomind/deploy/source_model/llama.py", line 163, in get_mgrs
ret = self.Reader(new_params, unused_params,
TypeError: init() takes 4 positional arguments but 5 were given

这个是修复baichuan convert报错问题的么?
我这边尝试了更新了环境内的conda文件,问题还未解决

@grimoire
Copy link
Collaborator Author

baichuan 1 or baichuan 2

baichuan 2

@grimoire
Copy link
Collaborator Author

这个是修复baichuan convert报错问题的么? 我这边尝试了更新了环境内的conda文件,问题还未解决

不是,这个是修 pytorch 那边的问题

@lvhan028 lvhan028 changed the title fix baichuan mapping fix module mapping error of baichuan model Jan 22, 2024
@lvhan028 lvhan028 merged commit f456511 into InternLM:main Jan 22, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants