File "D:\LLM\download_deepseek.py", line 1, in <module>
from transformers import AutoTokenizer, AutoModelForSequenceClassification
ModuleNotFoundError: No module named 'transformers'
PS D:\LLM> pip install transformers
Defaulting to user installation because normal site-packages is not writeable
Collecting transformers
Using cached transformers-4.48.0-py3-none-any.whl.metadata (44 kB)
Requirement already satisfied: filelock in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from transformers) (3.13.1)
Collecting huggingface-hub<1.0,>=0.24.0 (from transformers)
Using cached huggingface_hub-0.27.1-py3-none-any.whl.metadata (13 kB)
Requirement already satisfied: numpy>=1.17 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from transformers) (2.1.3)
Requirement already satisfied: packaging>=20.0 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from transformers) (24.2)
Collecting pyyaml>=5.1 (from transformers)
Using cached PyYAML-6.0.2-cp312-cp312-win_amd64.whl.metadata (2.1 kB)
Collecting regex!=2019.12.17 (from transformers)
Using cached regex-2024.11.6-cp312-cp312-win_amd64.whl.metadata (41 kB)
Requirement already satisfied: requests in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from transformers) (2.32.3)
Collecting tokenizers<0.22,>=0.21 (from transformers)
Using cached tokenizers-0.21.0-cp39-abi3-win_amd64.whl.metadata (6.9 kB)
Collecting safetensors>=0.4.1 (from transformers)
Using cached safetensors-0.5.2-cp38-abi3-win_amd64.whl.metadata (3.9 kB)
Requirement already satisfied: tqdm>=4.27 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from transformers) (4.67.1)
Requirement already satisfied: fsspec>=2023.5.0 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from huggingface-hub<1.0,>=0.24.0->transformers) (2024.2.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from huggingface-hub<1.0,>=0.24.0->transformers) (4.12.2)
Requirement already satisfied: colorama in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from tqdm>=4.27->transformers) (0.4.6)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from requests->transformers) (3.4.0)
Requirement already satisfied: idna<4,>=2.5 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from requests->transformers) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from requests->transformers) (2.2.3)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from requests->transformers) (2024.8.30)
Using cached transformers-4.48.0-py3-none-any.whl (9.7 MB)
Using cached huggingface_hub-0.27.1-py3-none-any.whl (450 kB)
Using cached PyYAML-6.0.2-cp312-cp312-win_amd64.whl (156 kB)
Using cached regex-2024.11.6-cp312-cp312-win_amd64.whl (273 kB)
Using cached safetensors-0.5.2-cp38-abi3-win_amd64.whl (303 kB)
Using cached tokenizers-0.21.0-cp39-abi3-win_amd64.whl (2.4 MB)
Installing collected packages: safetensors, regex, pyyaml, huggingface-hub, tokenizers, transformers
WARNING: The script huggingface-cli.exe is installed in 'C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script transformers-cli.exe is installed in 'C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed huggingface-hub-0.27.1 pyyaml-6.0.2 regex-2024.11.6 safetensors-0.5.2 tokenizers-0.21.0 transformers-4.48.0
PS D:\LLM> python .\download_deepseek.py
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
Traceback (most recent call last):
File "D:\LLM\download_deepseek.py", line 2, in <module>
import torch
File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\torch\__init__.py", line 367, in <module>
from torch._C import * # noqa: F403
^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing _C: 지정된 모듈을 찾을 수 없습니다.
PS D:\LLM> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0
PS D:\LLM> pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
>>
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://download.pytorch.org/whl/cu118
Collecting torch
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
PS D:\LLM> pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
>>
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://download.pytorch.org/whl/cu118
Collecting torch
Using cached https://download.pytorch.org/whl/cu118/torch-2.5.1%2Bcu118-cp312-cp312-win_amd64.whl (2700.1 MB)
Collecting torchvision
Using cached https://download.pytorch.org/whl/cu118/torchvision-0.20.1%2Bcu118-cp312-cp312-win_amd64.whl (5.3 MB)
Collecting torchaudio
Using cached https://download.pytorch.org/whl/cu118/torchaudio-2.5.1%2Bcu118-cp312-cp312-win_amd64.whl (4.0 MB)
Requirement already satisfied: filelock in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torch) (3.13.1)
Requirement already satisfied: typing-extensions>=4.8.0 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torch) (4.12.2)
Requirement already satisfied: networkx in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torch) (3.2.1)
Requirement already satisfied: jinja2 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torch) (3.1.3)
Requirement already satisfied: fsspec in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torch) (2024.2.0)
Requirement already satisfied: setuptools in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torch) (70.0.0)
Requirement already satisfied: sympy==1.13.1 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torch) (1.13.1)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from sympy==1.13.1->torch) (1.3.0)
Requirement already satisfied: numpy in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torchvision) (2.1.3)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from torchvision) (11.0.0)
Requirement already satisfied: MarkupSafe>=2.0 in c:\users\administrator\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (from jinja2->torch) (2.1.5)
Installing collected packages: torch, torchvision, torchaudio
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\\Users\\Administrator\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python312\\site-packages\\torch\\include\\ATen\\ops\\_fake_quantize_per_tensor_affine_cachemask_tensor_qparams_compositeexplicitautograd_dispatch.h'
HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths
python -m venv C:\\venv
C:\\venv\\Scripts\\activate.ps1
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Windows 에서는 경로 길이 때문에도 문제가 생기네.
이 오류는 Windows에서 경로 길이가 너무 길어서 발생한 문제입니다. Windows의 기본 설정에서는 파일 경로가 260자 이상일 경우 오류가 발생할 수 있습니다. 이를 해결하려면 Windows Long Path 지원을 활성화해야 합니다.
해결 방법:
1. Windows Long Path 지원 활성화
Windows 10 이상에서는 Long Path 지원을 활성화할 수 있습니다.
- 로컬 그룹 정책 편집기 열기
- Windows 키 + R을 눌러 gpedit.msc 입력 후 실행.
- 경로 탐색
- 컴퓨터 구성 > 관리 템플릿 > 시스템 > 파일 시스템으로 이동.
- NTFS 장기 경로 지원 사용
- 오른쪽 창에서 **"NTFS에서 경로 길이 제한 제거"**를 찾아 두 번 클릭.
- **"사용"**을 선택한 후 확인.
- 시스템 재부팅
- 변경 사항 적용을 위해 시스템을 재부팅합니다.
2. 레지스트리 편집기로 활성화 (대안)
로컬 그룹 정책 편집기를 사용할 수 없는 Windows Home 에디션에서는 레지스트리를 직접 수정해야 합니다.
- 레지스트리 편집기 열기
- Windows 키 + R을 눌러 regedit 입력 후 실행.
- 경로 탐색
- HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\FileSystem
- LongPathsEnabled 활성화
- 오른쪽에서 **LongPathsEnabled**를 찾습니다.
- 없으면 DWORD (32비트) 값을 새로 만들고 이름을 LongPathsEnabled로 지정.
- 값을 1로 설정.
- 시스템 재부팅
3. 다시 설치 시도
Long Path 지원을 활성화한 후 PowerShell에서 다시 설치를 시도하세요.
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
4. 가상 환경 경로 변경
경로 길이를 줄이기 위해 짧은 이름의 디렉토리를 사용합니다.
- Python 가상 환경을 간단한 이름의 디렉토리에서 생성:
python -m venv C:\\venv C:\\venv\\Scripts\\activate
- 다시 패키지를 설치:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
(venv) PS D:\LLM> python .\download_deepseek.py
tokenizer_config.json: 100%|██████████████████████████████████████████████████████| 3.13k/3.13k [00:00<00:00, 2.99MB/s]
tokenizer.json: 100%|█████████████████████████████████████████████████████████████| 7.85M/7.85M [00:01<00:00, 6.89MB/s]
config.json: 100%|████████████████████████████████████████████████████████████████████████| 1.73k/1.73k [00:00<?, ?B/s]
configuration_deepseek.py: 100%|██████████████████████████████████████████████████| 10.6k/10.6k [00:00<00:00, 10.9MB/s]
A new version of the following files was downloaded from https://huggingface.co/deepseek-ai/DeepSeek-V3:
- configuration_deepseek.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
Traceback (most recent call last):
File "D:\LLM\download_deepseek.py", line 12, in <module>
model = AutoModelForSequenceClassification.from_pretrained(model_name, trust_remote_code=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\venv\Lib\site-packages\transformers\models\auto\auto_factory.py", line 567, in from_pretrained
raise ValueError(
ValueError: Unrecognized configuration class <class 'transformers_modules.deepseek-ai.DeepSeek-V3.4c1f24cc10a2a1894304c7ab52edd9710c047571.configuration_deepseek.DeepseekV3Config'> for this kind of AutoModel: AutoModelForSequenceClassification.
Model type should be one of AlbertConfig, BartConfig, BertConfig, BigBirdConfig, BigBirdPegasusConfig, BioGptConfig, BloomConfig, CamembertConfig, CanineConfig, LlamaConfig, ConvBertConfig, CTRLConfig, Data2VecTextConfig, DebertaConfig, DebertaV2Config, DiffLlamaConfig, DistilBertConfig, ElectraConfig, ErnieConfig, ErnieMConfig, EsmConfig, FalconConfig, FlaubertConfig, FNetConfig, FunnelConfig, GemmaConfig, Gemma2Config, GlmConfig, GPT2Config, GPT2Config, GPTBigCodeConfig, GPTNeoConfig, GPTNeoXConfig, GPTJConfig, IBertConfig, JambaConfig, JetMoeConfig, LayoutLMConfig, LayoutLMv2Config, LayoutLMv3Config, LEDConfig, LiltConfig, LlamaConfig, LongformerConfig, LukeConfig, MarkupLMConfig, MBartConfig, MegaConfig, MegatronBertConfig, MistralConfig, MixtralConfig, MobileBertConfig, ModernBertConfig, MPNetConfig, MptConfig, MraConfig, MT5Config, MvpConfig, NemotronConfig, NezhaConfig, NystromformerConfig, OpenLlamaConfig, OpenAIGPTConfig, OPTConfig, PerceiverConfig, PersimmonConfig, PhiConfig, Phi3Config, PhimoeConfig, PLBartConfig, QDQBertConfig, Qwen2Config, Qwen2MoeConfig, ReformerConfig, RemBertConfig, RobertaConfig, RobertaPreLayerNormConfig, RoCBertConfig, RoFormerConfig, SqueezeBertConfig, StableLmConfig, Starcoder2Config, T5Config, TapasConfig, TransfoXLConfig, UMT5Config, XLMConfig, XLMRobertaConfig, XLMRobertaXLConfig, XLNetConfig, XmodConfig, YosoConfig, ZambaConfig.
(venv) PS D:\LLM>
pip install transformers==4.33.3
pip install tokenizers --prefer-binary
mingw로 가야함..
Administrator@DESKTOP-UEUMU5S MINGW64 /d/LLM
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer
Warning: Not enforcing strong cipher suites for TLS, this is potentially less secure
Welcome to Rust!
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
C:\Users\Administrator\.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
C:\Users\Administrator\.cargo
This can be modified with the CARGO_HOME environment variable.
The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:
C:\Users\Administrator\.cargo\bin
This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
Current installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>1
info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2025-01-09, rust version 1.84.0 (9fc6b4312 2025-01-07)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
63.9 MiB / 63.9 MiB (100 %) 27.0 MiB/s in 2s ETA: 0s
info: downloading component 'rustfmt'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.5 MiB / 16.5 MiB (100 %) 1.7 MiB/s in 6s ETA: 0s
info: installing component 'rust-std'
22.2 MiB / 22.2 MiB (100 %) 16.8 MiB/s in 1s ETA: 0s
info: installing component 'rustc'
63.9 MiB / 63.9 MiB (100 %) 17.3 MiB/s in 3s ETA: 0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-pc-windows-msvc'
stable-x86_64-pc-windows-msvc updated - rustc 1.84.0 (9fc6b4312 2025-01-07) (from rustc 1.83.0 (90b35a623 2024-11-26))
Rust is installed now. Great!
To get started you may need to restart your current shell.
This would reload its PATH environment variable to include
Cargo's bin directory (%USERPROFILE%\.cargo\bin).
Press the Enter key to continue.
(venv)
Administrator@DESKTOP-UEUMU5S MINGW64 /d/LLM
$
'HJH IT Logs' 카테고리의 다른 글
공유경제용 차세대 CCTV 아이디어 (0) | 2025.01.14 |
---|---|
H100 테스트 (0) | 2025.01.13 |
llama and deepseek model download (0) | 2025.01.13 |
시장에서 필요한 기술스택 탐구 (0) | 2025.01.12 |
사무실 사진 (0) | 2025.01.12 |
최근댓글