Skip to content

importlib.metadata.PackageNotFoundError: No package metadata was found for unsloth #60

Closed

Description

@xiechengmude

`
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/workspace/LLaMA-Factory/src/train_bash.py", line 14, in
main()
File "/workspace/LLaMA-Factory/src/train_bash.py", line 5, in main
run_exp()
File "/workspace/LLaMA-Factory/src/llmtuner/train/tuner.py", line 26, in run_exp
run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
File "/workspace/LLaMA-Factory/src/llmtuner/train/sft/workflow.py", line 29, in run_sft
model, tokenizer = load_model_and_tokenizer(model_args, finetuning_args, training_args.do_train)
File "/workspace/LLaMA-Factory/src/llmtuner/model/loader.py", line 63, in load_model_and_tokenizer
require_version("unsloth", "Follow the instructions at: https://github.com/unslothai/unsloth")
File "/root/miniconda3/envs/llama_factory/lib/python3.10/site-packages/transformers/utils/versions.py", line 104, in require_version
raise importlib.metadata.PackageNotFoundError(
importlib.metadata.PackageNotFoundError: No package metadata was found for The 'unsloth' distribution was not found and is required by this application.
Follow the instructions at: https://github.com/unslothai/unsloth
Converting format of dataset: 97%|█████████▋| 139000/143000 [00:02<00:00, 55130.54 examples/s]12/31/2023 15:47:40 - INFO - llmtuner.model.patcher - Quantizing model to 4 bit.
Traceback (most recent call last):
File "/root/miniconda3/envs/llama_factory/lib/python3.10/site-packages/transformers/utils/versions.py", line 102, in require_version
got_ver = importlib.metadata.version(pkg)
File "/root/miniconda3/envs/llama_factory/lib/python3.10/importlib/metadata/init.py", line 996, in version
return distribution(distribution_name).version
File "/root/miniconda3/envs/llama_factory/lib/python3.10/importlib/metadata/init.py", line 969, in distribution
return Distribution.from_name(distribution_name)
File "/root/miniconda3/envs/llama_factory/lib/python3.10/importlib/metadata/init.py", line 548, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for unsloth

During handling of the above exception, another exception occurred:`

Activity

  1. danielhanchen commented on Dec 31, 2023

    @danielhanchen
    Member

    Did you install Unsloth?

  2. danielhanchen commented on Dec 31, 2023

    @danielhanchen
    Member

    Oh wait you might have to update pip

  3. xiechengmude commented on Dec 31, 2023

    @xiechengmude
    Author

    Oh wait you might have to update pip

    I installed it with pip .So you mean I should upgrade pip individually again?

    But my pip version is the newest verison now.

  4. xiechengmude commented on Dec 31, 2023

    @xiechengmude
    Author

    furthermore, whats the info here meaning?

    /root/miniconda3/envs/unsloth/lib/python3.10/site-packages/unsloth/__init__.py:23: UserWarning: Unsloth: 'CUDA_VISIBLE_DEVICES' is currently 0,1,2,3,4,5,6,7 but we require 'CUDA_VISIBLE_DEVICES=0' We shall set it ourselves.

  5. danielhanchen commented on Jan 1, 2024

    @danielhanchen
    Member

    @xiechengmude If you're using the latest pip, then to be honest, I'm not sure why the installation is not working.

    Did you follow exactly the instructions as described? If you have Conda / Anaconda, you must follow https://github.com/unslothai/unsloth#installation-instructions---conda or else CUDA will not link properly.

    If you used pip, you must have torch>=2.1.0 and on torch==2.1.1 one must use the Pytorch 2.1.1 install path as shown in the pip section https://github.com/unslothai/unsloth#installation-instructions---pip

    Unsloth only supports single GPUs for now - multi GPU will be for a future release. So, we set CUDA_VISIBLE_DEVICES=0 to not make Unsloth cause CUDA segfaults.

  6. danielhanchen commented on Jan 1, 2024

    @danielhanchen
    Member

    furthermore, whats the info here meaning?

    /root/miniconda3/envs/unsloth/lib/python3.10/site-packages/unsloth/__init__.py:23: UserWarning: Unsloth: 'CUDA_VISIBLE_DEVICES' is currently 0,1,2,3,4,5,6,7 but we require 'CUDA_VISIBLE_DEVICES=0' We shall set it ourselves.

    Wait I just noticed - so Unsloth is in fact working?

    When did you get the first error msg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    unsure bug?

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions