InternLM / xtuner

An efficient, flexible and full-featured toolkit for fine-tuning LLM (InternLM2, Llama3, Phi3, Qwen, Mistral, ...)
https://xtuner.readthedocs.io/zh-cn/latest/
Apache License 2.0
3.94k stars 308 forks source link

指定模型本地路径后仍然需要下载模型 #721

Closed vincent507cpu closed 5 months ago

vincent507cpu commented 5 months ago

您好,我在指定本地路径后,仍然需要到 HuggingFace 下载,结果报错。我希望知道哪里设置错了。我想训练 llava-llama3-8b。

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/miniconda3/lib/python3.10/site-packages/transformers/utils/hub.py", line 399, in cached_file resolved_file = hf_hub_download( File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, *kwargs) File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1221, in hf_hub_download return _hf_hub_download_to_cache_dir( File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1325, in _hf_hub_download_to_cache_dir _raise_on_head_call_error(head_call_error, force_download, local_files_only) File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1823, in _raise_on_head_call_error raise head_call_error File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1722, in _get_metadata_or_catch_error metadata = get_hf_file_metadata(url=url, proxies=proxies, timeout=etag_timeout, headers=headers) File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(args, **kwargs) File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1645, in get_hf_file_metadata r = _request_wrapper( File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 372, in _request_wrapper response = _request_wrapper( File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 396, in _request_wrapper hf_raise_for_status(response) File "/root/miniconda3/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 321, in hf_raise_for_status raise GatedRepoError(message, response) from e huggingface_hub.utils._errors.GatedRepoError: 401 Client Error. (Request ID: Root=1-66546098-2a77795a4fb2e26d341a2147;99e64d9b-c281-4e7a-a289-d953b8deeb90)

Cannot access gated repo for url https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct/resolve/main/config.json. Access to model meta-llama/Meta-Llama-3-8B-Instruct is restricted. You must be authenticated to access it.

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/root/miniconda3/lib/python3.10/site-packages/xtuner/tools/train.py", line 360, in main() File "/root/miniconda3/lib/python3.10/site-packages/xtuner/tools/train.py", line 353, in main runner = RUNNERS.build(cfg) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, *args, kwargs, registry=self) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/registry/build_functions.py", line 196, in build_runner_from_cfg runner = runner_cls.from_cfg(args) # type: ignore File "/root/miniconda3/lib/python3.10/site-packages/mmengine/runner/_flexible_runner.py", line 423, in from_cfg runner = cls( File "/root/miniconda3/lib/python3.10/site-packages/mmengine/runner/_flexible_runner.py", line 403, in init self.register_hooks(default_hooks, custom_hooks) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/runner/_flexible_runner.py", line 1430, in register_hooks self.register_custom_hooks(custom_hooks) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/runner/_flexible_runner.py", line 1410, in register_custom_hooks self.register_hook(hook) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/runner/_flexible_runner.py", line 1310, in register_hook hook_obj = HOOKS.build(hook) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, args, kwargs, registry=self) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg obj = obj_cls(args) # type: ignore File "/root/miniconda3/lib/python3.10/site-packages/xtuner/engine/hooks/dataset_info_hook.py", line 24, in init self.tokenizer = BUILDER.build(tokenizer) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, args, kwargs, registry=self) File "/root/miniconda3/lib/python3.10/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg obj = obj_cls(args) # type: ignore File "/root/miniconda3/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 837, in from_pretrained config = AutoConfig.from_pretrained( File "/root/miniconda3/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 934, in from_pretrained config_dict, unused_kwargs = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, kwargs) File "/root/miniconda3/lib/python3.10/site-packages/transformers/configuration_utils.py", line 632, in get_config_dict config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs) File "/root/miniconda3/lib/python3.10/site-packages/transformers/configuration_utils.py", line 689, in _get_config_dict resolved_config_file = cached_file( File "/root/miniconda3/lib/python3.10/site-packages/transformers/utils/hub.py", line 417, in cached_file raise EnvironmentError( OSError: You are trying to access a gated repo. Make sure to have access to it at https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct. 401 Client Error. (Request ID: Root=1-66546098-2a77795a4fb2e26d341a2147;99e64d9b-c281-4e7a-a289-d953b8deeb90)

Cannot access gated repo for url https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct/resolve/main/config.json. Access to model meta-llama/Meta-Llama-3-8B-Instruct is restricted. You must be authenticated to access it. [2024-05-27 18:29:49,767] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 19592) of binary: /root/miniconda3/bin/python Traceback (most recent call last): File "/root/miniconda3/bin/torchrun", line 8, in sys.exit(main()) File "/root/miniconda3/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 346, in wrapper return f(*args, **kwargs) File "/root/miniconda3/lib/python3.10/site-packages/torch/distributed/run.py", line 806, in main run(args) File "/root/miniconda3/lib/python3.10/site-packages/torch/distributed/run.py", line 797, in run elastic_launch( File "/root/miniconda3/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 134, in call return launch_agent(self._config, self._entrypoint, list(args)) File "/root/miniconda3/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 264, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

/root/miniconda3/lib/python3.10/site-packages/xtuner/tools/train.py FAILED

Failures:

------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2024-05-27_18:29:49 host : autodl-container-514f11b352-ce13d0dd rank : 0 (local_rank: 0) exitcode : 1 (pid: 19592) error_file: traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================ ``` 谢谢帮助!
happyrenxiaozhao commented 3 months ago

您好,我好像也遇到了和您一样的问题,请问您解决了吗?