lmdeploy 部署量化出现错误

Open
#1,893 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Start with the lmdeploy/lite/utils/calib_dataloader.py get_ptb entry point and the datasets.load_dataset call shown in the traceback. Reproduce the command in a clean environment, then inspect the installed datasets package and its compatibility with lmdeploy. Done means identifying the cause of the NoneType error and documenting a verified resolution.

Written by the indexing model from the issue text.

Description

lmdeploy lite auto_awq
/root/models/internlm2_5-1_8b-chat
--calib-dataset 'ptb'
--calib-samples 128
--calib-seqlen 2048
--w-bits 4
--w-group-size 128
--batch-size 1
--search-scale False
--work-dir /root/models/internlm2_5-1_8b-chat-w4a16-4bit
输入此命令后
报错显示

Traceback (most recent call last):
File "/root/.conda/envs/lmdeploy/bin/lmdeploy", line 8, in <module>
  sys.exit(run())
File "/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/lmdeploy/cli/entrypoint.py", line 36, in run
  args.run(args)
File "/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/lmdeploy/cli/lite.py", line 139, in auto_awq
  auto_awq(**kwargs)
File "/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/lmdeploy/lite/apis/auto_awq.py", line 80, in auto_awq
  vl_model, model, tokenizer, work_dir = calibrate(model,
File "/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/lmdeploy/lite/apis/calibrate.py", line 216, in calibrate
  calib_loader, _ = get_calib_loaders(calib_dataset,
File "/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/lmdeploy/lite/utils/calib_dataloader.py", line 302, in get_calib_loaders
  return get_ptb(tokenizer, nsamples, seed, seqlen)
File "/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/lmdeploy/lite/utils/calib_dataloader.py", line 58, in get_ptb
  traindata = load_dataset('ptb_text_only', 'penn_treebank', split='train')
File "/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/datasets/load.py", line 2074, in load_dataset
  builder_instance = load_dataset_builder(
File "/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/datasets/load.py", line 1832, in load_dataset_builder
  builder_instance: DatasetBuilder = builder_cls(
TypeError: 'NoneType' object is not callable

如何解决?

Dominant language
Python
Stars
2k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from InternLM/Tutorial

All issues in InternLM/Tutorial

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.