not run

#16
by rakmik - opened

(base) C:\Windows\system32>cd C:\Users\TARGET STORE\Desktop\1

(base) C:\Users\TARGET STORE\Desktop\1>python
Python 3.11.5 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:26:23) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

exit()

(base) C:\Users\TARGET STORE\Desktop\1>conda create --name 1 python=3.11 -y && conda activate 1
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. <==
current version: 23.7.4
latest version: 25.3.1

Please update conda by running

$ conda update -n base -c defaults conda

Or to minimize the number of packages updated during conda update use

 conda install conda=25.3.1

Package Plan

environment location: C:\ProgramData\anaconda3\envs\1

added / updated specs:
- python=3.11

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
vc-14.42                   |       haa95532_5          11 KB
vs2015_runtime-14.42.34433 |       hbfb602d_5         1.2 MB
------------------------------------------------------------
                                       Total:         1.2 MB

The following NEW packages will be INSTALLED:

bzip2 pkgs/main/win-64::bzip2-1.0.8-h2bbff1b_6
ca-certificates pkgs/main/win-64::ca-certificates-2025.2.25-haa95532_0
libffi pkgs/main/win-64::libffi-3.4.4-hd77b12b_1
openssl pkgs/main/win-64::openssl-3.0.16-h3f729d1_0
pip pkgs/main/win-64::pip-25.0-py311haa95532_0
python pkgs/main/win-64::python-3.11.11-h4607a30_0
setuptools pkgs/main/win-64::setuptools-75.8.0-py311haa95532_0
sqlite pkgs/main/win-64::sqlite-3.45.3-h2bbff1b_0
tk pkgs/main/win-64::tk-8.6.14-h0416ee5_0
tzdata pkgs/main/noarch::tzdata-2025a-h04d1e81_0
vc pkgs/main/win-64::vc-14.42-haa95532_5
vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.42.34433-hbfb602d_5
wheel pkgs/main/win-64::wheel-0.45.1-py311haa95532_0
xz pkgs/main/win-64::xz-5.6.4-h4754444_1
zlib pkgs/main/win-64::zlib-1.2.13-h8cc25b3_1

Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#

To activate this environment, use

$ conda activate 1

To deactivate an active environment, use

$ conda deactivate

(1) C:\Users\TARGET STORE\Desktop\1>gi clone https://github.com/microsoft/BitNet.git
'gi' is not recognized as an internal or external command,
operable program or batch file.

(1) C:\Users\TARGET STORE\Desktop\1>git clone https://github.com/microsoft/BitNet.git
Cloning into 'BitNet'...
remote: Enumerating objects: 255, done.
remote: Counting objects: 100% (157/157), done.
remote: Compressing objects: 100% (90/90), done.
remote: Total 255 (delta 104), reused 70 (delta 67), pack-reused 98 (from 4)
Receiving objects: 100% (255/255), 2.05 MiB | 2.94 MiB/s, done.
Resolving deltas: 100% (118/118), done.

(1) C:\Users\TARGET STORE\Desktop\1>cd BitNet

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>pip install -r requirements.txt
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt'

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>dir
Volume in drive C has no label.
Volume Serial Number is 101F-C125

Directory of C:\Users\TARGET STORE\Desktop\1\BitNet

04/19/2025 02:20 PM

.
04/19/2025 02:20 PM ..
04/19/2025 02:20 PM 376 .gitignore
04/19/2025 02:20 PM 139 .gitmodules
04/19/2025 02:20 PM 3rdparty
04/19/2025 02:20 PM assets
04/19/2025 02:20 PM 2,741 CMakeLists.txt
04/19/2025 02:20 PM 453 CODE_OF_CONDUCT.md
04/19/2025 02:20 PM docs
04/19/2025 02:20 PM include
04/19/2025 02:20 PM 1,162 LICENSE
04/19/2025 02:20 PM media
04/19/2025 02:20 PM preset_kernels
04/19/2025 02:20 PM 14,261 README.md
04/19/2025 02:20 PM 598 requirements.txt
04/19/2025 02:20 PM 2,532 run_inference.py
04/19/2025 02:20 PM 2,697 SECURITY.md
04/19/2025 02:20 PM 11,206 setup_env.py
04/19/2025 02:20 PM src
04/19/2025 02:20 PM utils
10 File(s) 36,165 bytes
10 Dir(s) 201,116,852,224 bytes free

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>pip install -r requirements.txt
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt'

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>ؤيزز
'ؤيزز' is not recognized as an internal or external command,
operable program or batch file.

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>cd..

(1) C:\Users\TARGET STORE\Desktop\1>git clone --recurse-submodules https://github.com/microsoft/BitNet
fatal: destination path 'BitNet' already exists and is not an empty directory.

(1) C:\Users\TARGET STORE\Desktop\1>git clone --recurse-submodules https://github.com/microsoft/BitNet
Cloning into 'BitNet'...
remote: Enumerating objects: 255, done.
remote: Counting objects: 100% (158/158), done.
remote: Compressing objects: 100% (90/90), done.
remote: Total 255 (delta 104), reused 72 (delta 68), pack-reused 97 (from 4)
Receiving objects: 100% (255/255), 2.05 MiB | 2.93 MiB/s, done.
Resolving deltas: 100% (118/118), done.
Submodule '3rdparty/llama.cpp' (https://github.com/Eddie-Wang1120/llama.cpp.git) registered for path '3rdparty/llama.cpp'
Cloning into 'C:/Users/TARGET STORE/Desktop/1/BitNet/3rdparty/llama.cpp'...
remote: Enumerating objects: 25611, done.
remote: Total 25611 (delta 0), reused 0 (delta 0), pack-reused 25611 (from 1)
Receiving objects: 100% (25611/25611), 59.09 MiB | 3.43 MiB/s, done.
Resolving deltas: 100% (18270/18270), done.
Submodule path '3rdparty/llama.cpp': checked out 'a8ac7072ae02ffd68b4b661db0ebd2689fb82b7f'
Submodule 'kompute' (https://github.com/nomic-ai/kompute.git) registered for path '3rdparty/llama.cpp/ggml/src/kompute'
Cloning into 'C:/Users/TARGET STORE/Desktop/1/BitNet/3rdparty/llama.cpp/ggml/src/kompute'...
remote: Enumerating objects: 9122, done.
remote: Counting objects: 100% (155/155), done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 9122 (delta 109), reused 86 (delta 86), pack-reused 8967 (from 3)
Receiving objects: 100% (9122/9122), 17.59 MiB | 3.35 MiB/s, done.
Resolving deltas: 100% (5728/5728), done.
Submodule path '3rdparty/llama.cpp/ggml/src/kompute': checked out '4565194ed7c32d1d2efa32ceab4d3c6cae006306'

(1) C:\Users\TARGET STORE\Desktop\1>cd C:\Users\TARGET STORE\Desktop\1\BitNet

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>pip install -r requirements.txt
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu, https://download.pytorch.org/whl/cpu, https://download.pytorch.org/whl/cpu, https://download.pytorch.org/whl/cpu
Collecting numpy=1.26.4 (from -r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 1))
Downloading numpy-1.26.4-cp311-cp311-win_amd64.whl.metadata (61 kB)
Collecting sentencepiece
=0.2.0 (from -r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 2))
Downloading sentencepiece-0.2.0-cp311-cp311-win_amd64.whl.metadata (8.3 kB)
Collecting transformers<5.0.0,>=4.46.3 (from -r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3))
Downloading transformers-4.51.3-py3-none-any.whl.metadata (38 kB)
Collecting gguf>=0.1.0 (from -r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 4))
Downloading gguf-0.16.2-py3-none-any.whl.metadata (4.4 kB)
Collecting protobuf<5.0.0,>=4.21.0 (from -r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 5))
Downloading protobuf-4.25.6-cp310-abi3-win_amd64.whl.metadata (541 bytes)
Collecting torch=2.2.1 (from -r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_hf_to_gguf.txt (line 3))
Downloading https://download.pytorch.org/whl/cpu/torch-2.2.2%2Bcpu-cp311-cp311-win_amd64.whl (200.8 MB)
---------------------------------------- 200.8/200.8 MB 3.4 MB/s eta 0:00:00
Collecting filelock (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3))
Using cached filelock-3.18.0-py3-none-any.whl.metadata (2.9 kB)
Collecting huggingface-hub<1.0,>=0.30.0 (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3))
Using cached huggingface_hub-0.30.2-py3-none-any.whl.metadata (13 kB)
Requirement already satisfied: packaging>=20.0 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (24.2)
Requirement already satisfied: pyyaml>=5.1 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (6.0.2)
Requirement already satisfied: regex!=2019.12.17 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (2024.11.6)
Requirement already satisfied: requests in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (2.32.3)
Collecting tokenizers<0.22,>=0.21 (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3))
Downloading tokenizers-0.21.1-cp39-abi3-win_amd64.whl.metadata (6.9 kB)
Requirement already satisfied: safetensors>=0.4.3 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (0.5.3)
Requirement already satisfied: tqdm>=4.27 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (4.66.4)
Collecting typing-extensions>=4.8.0 (from torch
=2.2.1->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_hf_to_gguf.txt (line 3))
Downloading typing_extensions-4.13.2-py3-none-any.whl.metadata (3.0 kB)
Collecting sympy (from torch=2.2.1->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_hf_to_gguf.txt (line 3))
Downloading sympy-1.13.3-py3-none-any.whl.metadata (12 kB)
Collecting networkx (from torch
=2.2.1->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_hf_to_gguf.txt (line 3))
Downloading networkx-3.4.2-py3-none-any.whl.metadata (6.3 kB)
Collecting jinja2 (from torch=2.2.1->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_hf_to_gguf.txt (line 3))
Using cached jinja2-3.1.6-py3-none-any.whl.metadata (2.9 kB)
Collecting fsspec (from torch
=2.2.1->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_hf_to_gguf.txt (line 3))
Using cached fsspec-2025.3.2-py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: colorama in c:\users\target store\appdata\roaming\python\python311\site-packages (from tqdm>=4.27->transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (0.4.6)
Collecting MarkupSafe>=2.0 (from jinja2->torch=2.2.1->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_hf_to_gguf.txt (line 3))
Downloading MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl.metadata (4.1 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\target store\appdata\roaming\python\python311\site-packages (from requests->transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (3.4.1)
Requirement already satisfied: idna<4,>=2.5 in c:\users\target store\appdata\roaming\python\python311\site-packages (from requests->transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\target store\appdata\roaming\python\python311\site-packages (from requests->transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (2.3.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\target store\appdata\roaming\python\python311\site-packages (from requests->transformers<5.0.0,>=4.46.3->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_legacy_llama.txt (line 3)) (2025.1.31)
Collecting mpmath<1.4,>=1.1.0 (from sympy->torch
=2.2.1->-r C:\Users\TARGET STORE\Desktop\1\BitNet\3rdparty\llama.cpp\requirements\requirements-convert_hf_to_gguf.txt (line 3))
Downloading https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB)
---------------------------------------- 536.2/536.2 kB 3.5 MB/s eta 0:00:00
Downloading numpy-1.26.4-cp311-cp311-win_amd64.whl (15.8 MB)
---------------------------------------- 15.8/15.8 MB 3.7 MB/s eta 0:00:00
Downloading sentencepiece-0.2.0-cp311-cp311-win_amd64.whl (991 kB)
---------------------------------------- 991.5/991.5 kB 3.3 MB/s eta 0:00:00
Downloading transformers-4.51.3-py3-none-any.whl (10.4 MB)
---------------------------------------- 10.4/10.4 MB 3.6 MB/s eta 0:00:00
Downloading gguf-0.16.2-py3-none-any.whl (92 kB)
Downloading protobuf-4.25.6-cp310-abi3-win_amd64.whl (413 kB)
Using cached huggingface_hub-0.30.2-py3-none-any.whl (481 kB)
Using cached fsspec-2025.3.2-py3-none-any.whl (194 kB)
Downloading tokenizers-0.21.1-cp39-abi3-win_amd64.whl (2.4 MB)
---------------------------------------- 2.4/2.4 MB 3.6 MB/s eta 0:00:00
Downloading typing_extensions-4.13.2-py3-none-any.whl (45 kB)
Using cached filelock-3.18.0-py3-none-any.whl (16 kB)
Using cached jinja2-3.1.6-py3-none-any.whl (134 kB)
Downloading networkx-3.4.2-py3-none-any.whl (1.7 MB)
---------------------------------------- 1.7/1.7 MB 3.5 MB/s eta 0:00:00
Downloading sympy-1.13.3-py3-none-any.whl (6.2 MB)
---------------------------------------- 6.2/6.2 MB 3.6 MB/s eta 0:00:00
Downloading MarkupSafe-3.0.2-cp311-cp311-win_amd64.whl (15 kB)
Installing collected packages: sentencepiece, mpmath, typing-extensions, sympy, protobuf, numpy, networkx, MarkupSafe, fsspec, filelock, jinja2, huggingface-hub, gguf, torch, tokenizers, transformers
Successfully installed MarkupSafe-3.0.2 filelock-3.18.0 fsspec-2025.3.2 gguf-0.16.2 huggingface-hub-0.30.2 jinja2-3.1.6 mpmath-1.3.0 networkx-3.4.2 numpy-1.26.4 protobuf-4.25.6 sentencepiece-0.2.0 sympy-1.13.3 tokenizers-0.21.1 torch-2.2.2+cpu transformers-4.51.3 typing-extensions-4.13.2

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>python
Python 3.11.11 | packaged by Anaconda, Inc. | (main, Dec 11 2024, 16:34:19) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "microsoft/bitnet-b1.58-2B-4T"

Load tokenizer and model

tokenizer = AutoTokenizer.from_pretrained(model_id)
tokenizer_config.json: 100%|██████████████████████████████████████████████████████| 50.8k/50.8k [00:00<00:00, 25.5MB/s]
tokenizer.json: 100%|█████████████████████████████████████████████████████████████| 9.09M/9.09M [00:02<00:00, 3.61MB/s]
special_tokens_map.json: 100%|██████████████████████████████████████████████████████████████| 73.0/73.0 [00:00<?, ?B/s]
model = AutoModelForCausalLM.from_pretrained(
... model_id,
... torch_dtype=torch.bfloat16
... )
config.json: 100%|████████████████████████████████████████████████████████████████████████████| 803/803 [00:00<?, ?B/s]
Traceback (most recent call last):
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\dynamic_module_utils.py", line 666, in resolve_trust_remote_code
prev_sig_handler = signal.signal(signal.SIGALRM, _raise_timeout_error)
^^^^^^^^^^^^^^
AttributeError: module 'signal' has no attribute 'SIGALRM'. Did you mean: 'SIGABRT'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\auto_factory.py", line 531, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\configuration_auto.py", line 1117, in from_pretrained
trust_remote_code = resolve_trust_remote_code(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\dynamic_module_utils.py", line 682, in resolve_trust_remote_code
raise ValueError(
ValueError: The repository for microsoft/bitnet-b1.58-2B-4T contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/microsoft/bitnet-b1.58-2B-4T.
Please pass the argument trust_remote_code=True to allow custom code to be run.

Apply the chat template

messages = [
... {"role": "system", "content": "You are a helpful AI assistant."},
... {"role": "user", "content": "How are you?"},
... ]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
chat_input = tokenizer(prompt, return_tensors="pt").to(model.device)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'model' is not defined

Generate response

chat_outputs = model.generate(**chat_input, max_new_tokens=50)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'model' is not defined
response = tokenizer.decode(chat_outputs[0][chat_input['input_ids'].shape[-1]:], skip_special_tokens=True) # Decode only the response part
Traceback (most recent call last):
File "", line 1, in
NameError: name 'chat_outputs' is not defined
print("\nAssistant Response:", response)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'response' is not defined

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "microsoft/bitnet-b1.58-2B-4T"

Load tokenizer and model

tokenizer = AutoTokenizer.from_pretrained(model_id)

model = AutoModelForCausalLM.from_pretrained(
... model_id,
... torch_dtype=torch.bfloat16,
... trust_remote_code=True # هذا مهم جدًا لتفادي الخطأ
... )
Could not locate the configuration_bitnet.py inside microsoft/bitnet-b1.58-2B-4T.
Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\auto_factory.py", line 531, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\configuration_auto.py", line 1123, in from_pretrained
config_class = get_class_from_dynamic_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\dynamic_module_utils.py", line 558, in get_class_from_dynamic_module
final_module = get_cached_module_file(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\dynamic_module_utils.py", line 362, in get_cached_module_file
resolved_module_file = cached_file(
^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\utils\hub.py", line 266, in cached_file
file = cached_files(path_or_repo_id=path_or_repo_id, filenames=[filename], **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\utils\hub.py", line 517, in cached_files
raise EnvironmentError(
OSError: microsoft/bitnet-b1.58-2B-4T does not appear to have a file named configuration_bitnet.py. Checkout 'https://huggingface.co/microsoft/bitnet-b1.58-2B-4T/tree/main'for available files.

Apply the chat template

messages = [
... {"role": "system", "content": "You are a helpful AI assistant."},
... {"role": "user", "content": "How are you?"},
... ]

prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
chat_input = tokenizer(prompt, return_tensors="pt").to(model.device)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'model' is not defined

Generate response

chat_outputs = model.generate(**chat_input, max_new_tokens=50)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'model' is not defined

Decode only the response part

response = tokenizer.decode(chat_outputs[0][chat_input['input_ids'].shape[-1]:], skip_special_tokens=True)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'chat_outputs' is not defined

print("\nAssistant Response:", response)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'response' is not defined

exit()

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>pip install git+https://github.com/shumingma/transformers.git
Collecting git+https://github.com/shumingma/transformers.git
Cloning https://github.com/shumingma/transformers.git to c:\users\target store\appdata\local\temp\pip-req-build-d9xji1me
Running command git clone --filter=blob:none --quiet https://github.com/shumingma/transformers.git 'C:\Users\TARGET STORE\AppData\Local\Temp\pip-req-build-d9xji1me'
Resolved https://github.com/shumingma/transformers.git to commit 4a01efe84d0120dc2545ff2de445082400d87407
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: filelock in c:\programdata\anaconda3\envs\1\lib\site-packages (from transformers==4.52.0.dev0) (3.18.0)
Requirement already satisfied: huggingface-hub<1.0,>=0.30.0 in c:\programdata\anaconda3\envs\1\lib\site-packages (from transformers==4.52.0.dev0) (0.30.2)
Requirement already satisfied: numpy>=1.17 in c:\programdata\anaconda3\envs\1\lib\site-packages (from transformers==4.52.0.dev0) (1.26.4)
Requirement already satisfied: packaging>=20.0 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers==4.52.0.dev0) (24.2)
Requirement already satisfied: pyyaml>=5.1 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers==4.52.0.dev0) (6.0.2)
Requirement already satisfied: regex!=2019.12.17 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers==4.52.0.dev0) (2024.11.6)
Requirement already satisfied: requests in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers==4.52.0.dev0) (2.32.3)
Requirement already satisfied: tokenizers<0.22,>=0.21 in c:\programdata\anaconda3\envs\1\lib\site-packages (from transformers==4.52.0.dev0) (0.21.1)
Requirement already satisfied: safetensors>=0.4.3 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers==4.52.0.dev0) (0.5.3)
Requirement already satisfied: tqdm>=4.27 in c:\users\target store\appdata\roaming\python\python311\site-packages (from transformers==4.52.0.dev0) (4.66.4)
Requirement already satisfied: fsspec>=2023.5.0 in c:\programdata\anaconda3\envs\1\lib\site-packages (from huggingface-hub<1.0,>=0.30.0->transformers==4.52.0.dev0) (2025.3.2)
Requirement already satisfied: typing-extensions>=3.7.4.3 in c:\programdata\anaconda3\envs\1\lib\site-packages (from huggingface-hub<1.0,>=0.30.0->transformers==4.52.0.dev0) (4.13.2)
Requirement already satisfied: colorama in c:\users\target store\appdata\roaming\python\python311\site-packages (from tqdm>=4.27->transformers==4.52.0.dev0) (0.4.6)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\target store\appdata\roaming\python\python311\site-packages (from requests->transformers==4.52.0.dev0) (3.4.1)
Requirement already satisfied: idna<4,>=2.5 in c:\users\target store\appdata\roaming\python\python311\site-packages (from requests->transformers==4.52.0.dev0) (3.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\target store\appdata\roaming\python\python311\site-packages (from requests->transformers==4.52.0.dev0) (2.3.0)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\target store\appdata\roaming\python\python311\site-packages (from requests->transformers==4.52.0.dev0) (2025.1.31)
Building wheels for collected packages: transformers
Building wheel for transformers (pyproject.toml) ... done
Created wheel for transformers: filename=transformers-4.52.0.dev0-py3-none-any.whl size=11414155 sha256=aa934a26bb3d90fcaba2594754596c10e6eee64ab691bb09fb91efeb561964e4
Stored in directory: C:\Users\TARGET STORE\AppData\Local\Temp\pip-ephem-wheel-cache-wv7ovhc7\wheels\2c\2a\7c\3be0c30fb51a7becc4bcbb536739ae9ed9cc7e633ffbfaf63b
Successfully built transformers
Installing collected packages: transformers
Attempting uninstall: transformers
Found existing installation: transformers 4.51.3
Uninstalling transformers-4.51.3:
Successfully uninstalled transformers-4.51.3
Successfully installed transformers-4.52.0.dev0

(1) C:\Users\TARGET STORE\Desktop\1\BitNet>python
Python 3.11.11 | packaged by Anaconda, Inc. | (main, Dec 11 2024, 16:34:19) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

اختار النموذج

model_id = "microsoft/bitnet-b1.58-2B-4T"

تحميل التوكنيزر (مع السماح بكود مخصص)

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)

تحميل النموذج على CPU مع دعم الكود المخصص

model = AutoModelForCausalLM.from_pretrained(
... model_id,
... torch_dtype=torch.float32, # استخدام float32 بدلاً من bfloat16 لتجنب مشاكل الـ CPU
... trust_remote_code=True
... ).to("cpu") # تحميل النموذج على المعالج
Could not locate the configuration_bitnet.py inside microsoft/bitnet-b1.58-2B-4T.
Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\auto_factory.py", line 531, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\configuration_auto.py", line 1144, in from_pretrained
config_class = get_class_from_dynamic_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\dynamic_module_utils.py", line 558, in get_class_from_dynamic_module
final_module = get_cached_module_file(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\dynamic_module_utils.py", line 362, in get_cached_module_file
resolved_module_file = cached_file(
^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\utils\hub.py", line 312, in cached_file
file = cached_files(path_or_repo_id=path_or_repo_id, filenames=[filename], **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\utils\hub.py", line 573, in cached_files
raise EnvironmentError(
OSError: microsoft/bitnet-b1.58-2B-4T does not appear to have a file named configuration_bitnet.py. Checkout 'https://huggingface.co/microsoft/bitnet-b1.58-2B-4T/tree/main'for available files.

رسالة محادثة بسيطة

messages = [
... {"role": "system", "content": "You are a helpful AI assistant."},
... {"role": "user", "content": "How are you?"}
... ]

تجهيز البرومبت باستخدام قالب المحادثة (Chat Template)

prompt = tokenizer.apply_chat_template(
... messages,
... tokenize=False,
... add_generation_prompt=True
... )

تحويل البرومبت إلى مدخلات النموذج

chat_input = tokenizer(prompt, return_tensors="pt").to(model.device)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'model' is not defined

توليد الرد

chat_outputs = model.generate(
... **chat_input,
... max_new_tokens=100,
... do_sample=True,
... temperature=0.7
... )
Traceback (most recent call last):
File "", line 1, in
NameError: name 'model' is not defined

استخراج الرد فقط من الناتج

response = tokenizer.decode(
... chat_outputs[0][chat_input['input_ids'].shape[-1]:],
... skip_special_tokens=True
... )
Traceback (most recent call last):
File "", line 2, in
NameError: name 'chat_outputs' is not defined

طباعة الرد النهائي

print("\nAssistant Response:", response)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'response' is not defined

from transformers import AutoModelForCausalLM
path = "C:/Users/TARGET STORE/Desktop/1/bitnet-b1.58-2B-4T"
model = AutoModelForCausalLM.from_pretrained(path, device_map="auto")
You don't have a GPU available to load the model, the inference will be slow because of weight unpacking
Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\auto_factory.py", line 571, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 282, in _wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 4451, in from_pretrained
device_map = _get_device_map(model, device_map, max_memory, hf_quantizer, torch_dtype, keep_in_fp32_regex)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 1283, in _get_device_map
device_map = infer_auto_device_map(model, dtype=target_dtype, **device_map_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TARGET STORE\AppData\Roaming\Python\Python311\site-packages\accelerate\utils\modeling.py", line 1237, in infer_auto_device_map
module_sizes = compute_module_sizes(model, dtype=dtype, special_dtypes=special_dtypes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TARGET STORE\AppData\Roaming\Python\Python311\site-packages\accelerate\utils\modeling.py", line 790, in compute_module_sizes
special_dtypes_size = {key: dtype_byte_size(dtyp) for key, dtyp in special_dtypes.items()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TARGET STORE\AppData\Roaming\Python\Python311\site-packages\accelerate\utils\modeling.py", line 790, in
special_dtypes_size = {key: dtype_byte_size(dtyp) for key, dtyp in special_dtypes.items()}
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TARGET STORE\AppData\Roaming\Python\Python311\site-packages\accelerate\utils\modeling.py", line 170, in dtype_byte_size
raise ValueError(f"dtype is not a valid dtype: {dtype}.")
ValueError: dtype is not a valid dtype: None.

from transformers import AutoModelForCausalLM

تحديد مسار النموذج المحلي

path = "C:/Users/TARGET STORE/Desktop/1/bitnet-b1.58-2B-4T"

تحميل النموذج مع تحديد نوع البيانات

model = AutoModelForCausalLM.from_pretrained(path, torch_dtype="bfloat16", device_map="auto")
Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\auto_factory.py", line 571, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 282, in _wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 4470, in from_pretrained
) = cls._load_pretrained_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 4909, in _load_pretrained_model
disk_offload_index, cpu_offload_index = _load_state_dict_into_meta_model(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 806, in _load_state_dict_into_meta_model
_load_parameter_into_model(model, param_name, param.to(param_device))
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 694, in _load_parameter_into_model
module.load_state_dict({param_type: tensor}, strict=False, assign=True)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch\nn\modules\module.py", line 2139, in load_state_dict
load(self, state_dict)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch\nn\modules\module.py", line 2121, in load
module._load_from_state_dict(
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch\nn\modules\module.py", line 1991, in _load_from_state_dict
hook(state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch\nn\modules\module.py", line 72, in call
return self.hook(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\integrations\bitnet.py", line 256, in load_hook
state_dict[prefix + "weight"] = unpack_weights(state_dict[prefix + "weight"], dtype=self.weight.dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\eval_frame.py", line 489, in _fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\eval_frame.py", line 655, in catch_errors
return callback(frame, cache_entry, hooks, frame_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\convert_frame.py", line 727, in _convert_frame
result = inner_convert(frame, cache_entry, hooks, frame_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\convert_frame.py", line 383, in _convert_frame_assert
compiled_product = compile(
^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\convert_frame.py", line 646, in compile
guarded_code = compile_inner(code, one_graph, hooks, transform)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\utils.py", line 244, in time_wrapper
r = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\convert_frame.py", line 562, in compile_inner
out_code = transform_code_object(code, transform)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\bytecode_transformation.py", line 1033, in transform_code_object
transformations(instructions, code_options)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\convert_frame.py", line 151, in fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\convert_frame.py", line 527, in transform
tracer.run()
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\symbolic_convert.py", line 2128, in run
super().run()
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\symbolic_convert.py", line 818, in run
and self.step()
^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\symbolic_convert.py", line 781, in step
getattr(self, inst.opname)(inst)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\symbolic_convert.py", line 2243, in RETURN_VALUE
self.output.compile_subgraph(
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\output_graph.py", line 919, in compile_subgraph
self.compile_and_call_fx_graph(tx, list(reversed(stack_values)), root)
File "C:\ProgramData\anaconda3\envs\1\Lib\contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\output_graph.py", line 1087, in compile_and_call_fx_graph
compiled_fn = self.call_user_compiler(gm)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\utils.py", line 244, in time_wrapper
r = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\output_graph.py", line 1159, in call_user_compiler
raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\output_graph.py", line 1140, in call_user_compiler
compiled_fn = compiler_fn(gm, self.example_inputs())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\repro\after_dynamo.py", line 117, in debug_wrapper
compiled_gm = compiler_fn(gm, example_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_init
.py", line 1668, in call
return compile_fx(model
, inputs
, config_patches=self.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\compile_fx.py", line 1168, in compile_fx
return aot_autograd(
^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\backends\common.py", line 55, in compiler_fn
cg = aot_module_simplified(gm, example_inputs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_functorch\aot_autograd.py", line 887, in aot_module_simplified
compiled_fn = create_aot_dispatcher_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\utils.py", line 244, in time_wrapper
r = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_functorch\aot_autograd.py", line 600, in create_aot_dispatcher_function
compiled_fn = compiler_fn(flat_fn, fake_flat_args, aot_config, fw_metadata=fw_metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_functorch_aot_autograd\runtime_wrappers.py", line 425, in aot_wrapper_dedupe
return compiler_fn(flat_fn, leaf_flat_args, aot_config, fw_metadata=fw_metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_functorch_aot_autograd\runtime_wrappers.py", line 630, in aot_wrapper_synthetic_base
return compiler_fn(flat_fn, flat_args, aot_config, fw_metadata=fw_metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_functorch_aot_autograd\jit_compile_runtime_wrappers.py", line 97, in aot_dispatch_base
compiled_fw = compiler(fw_module, updated_flat_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\utils.py", line 244, in time_wrapper
r = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\compile_fx.py", line 1100, in fw_compiler_base
return inner_compile(
^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\repro\after_aot.py", line 83, in debug_wrapper
inner_compiled_fn = compiler_fn(gm, example_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\debug.py", line 305, in inner
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\compile_fx.py", line 320, in compile_fx_inner
compiled_graph = fx_codegen_and_compile(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\compile_fx.py", line 550, in fx_codegen_and_compile
compiled_fn = graph.compile_to_fn()
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\graph.py", line 1116, in compile_to_fn
return self.compile_to_module().call
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\utils.py", line 244, in time_wrapper
r = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\graph.py", line 1066, in compile_to_module
self.codegen_with_cpp_wrapper() if self.cpp_wrapper else self.codegen()
^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\graph.py", line 1043, in codegen
self.scheduler.codegen()
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_dynamo\utils.py", line 244, in time_wrapper
r = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\scheduler.py", line 2213, in codegen
self.get_backend(device).codegen_nodes(node.get_nodes())
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 2987, in codegen_nodes
kernel_group.finalize_kernel(cpp_kernel_proxy, nodes)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 3025, in finalize_kernel
new_kernel.codegen_loops(code, ws)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 2927, in codegen_loops
self.codegen_loops_impl(self.loop_nest, code, worksharing)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 1497, in codegen_loops_impl
gen_loops(loop_nest.root)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 1469, in gen_loops
gen_loop(loop, in_reduction)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 1489, in gen_loop
gen_loops(loop.inner, loop.is_reduction())
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 1469, in gen_loops
gen_loop(loop, in_reduction)
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 1482, in gen_loop
loop_lines = loop.lines()
^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codegen\cpp.py", line 3285, in lines
elif not self.reduction_var_map and codecache.is_gcc():
^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codecache.py", line 959, in is_gcc
return bool(re.search(r"(gcc|g++)", cpp_compiler()))
^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codecache.py", line 902, in cpp_compiler
return cpp_compiler_search(search)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\torch_inductor\codecache.py", line 929, in cpp_compiler_search
raise exc.InvalidCxxCompiler()
torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised:
InvalidCxxCompiler: No working C++ compiler found in torch._inductor.config.cpp.cxx: (None, 'g++')

Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information

You can suppress this exception and fall back to eager by setting:
import torch._dynamo
torch._dynamo.config.suppress_errors = True

import torch._dynamo
File "", line 1
import torch._dynamo
IndentationError: unexpected indent
torch._dynamo.config.suppress_errors = True
File "", line 1
torch._dynamo.config.suppress_errors = True
IndentationError: unexpected indent

import torch._dynamo
File "", line 1
import torch._dynamo
^^
SyntaxError: invalid syntax
torch._dynamo.config.suppress_errors = True
File "", line 1
torch._dynamo.config.suppress_errors = True
^^
SyntaxError: invalid syntax
def example():
... print("Hello")
... print("World")
...
from transformers import AutoModelForCausalLM
path = "C:/Users/TARGET STORE/Desktop/1/bitnet-b1.58-2B-4T"
model = AutoModelForCausalLM.from_pretrained(path, device_map="auto")
Traceback (most recent call last):
File "", line 1, in
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\models\auto\auto_factory.py", line 571, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 282, in _wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 4451, in from_pretrained
device_map = _get_device_map(model, device_map, max_memory, hf_quantizer, torch_dtype, keep_in_fp32_regex)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\anaconda3\envs\1\Lib\site-packages\transformers\modeling_utils.py", line 1283, in _get_device_map
device_map = infer_auto_device_map(model, dtype=target_dtype, **device_map_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TARGET STORE\AppData\Roaming\Python\Python311\site-packages\accelerate\utils\modeling.py", line 1237, in infer_auto_device_map
module_sizes = compute_module_sizes(model, dtype=dtype, special_dtypes=special_dtypes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TARGET STORE\AppData\Roaming\Python\Python311\site-packages\accelerate\utils\modeling.py", line 790, in compute_module_sizes
special_dtypes_size = {key: dtype_byte_size(dtyp) for key, dtyp in special_dtypes.items()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TARGET STORE\AppData\Roaming\Python\Python311\site-packages\accelerate\utils\modeling.py", line 790, in
special_dtypes_size = {key: dtype_byte_size(dtyp) for key, dtyp in special_dtypes.items()}
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\TARGET STORE\AppData\Roaming\Python\Python311\site-packages\accelerate\utils\modeling.py", line 170, in dtype_byte_size
raise ValueError(f"dtype is not a valid dtype: {dtype}.")
ValueError: dtype is not a valid dtype: None.

!bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"

[ ]
1

[ ]
1

[ ]
1

[1]
56s
1
!bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
--2025-04-20 00:26:18-- https://apt.llvm.org/llvm.sh
Resolving apt.llvm.org (apt.llvm.org)... 199.232.194.49, 199.232.198.49, 2a04:4e42:4c::561, ...
Connecting to apt.llvm.org (apt.llvm.org)|199.232.194.49|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7394 (7.2K) [application/octet-stream]
Saving to: ‘STDOUT’

  •               100%[===================>]   7.22K  --.-KB/s    in 0s
    

2025-04-20 00:26:19 (67.7 MB/s) - written to stdout [7394/7394]

  • CURRENT_LLVM_STABLE=19
  • BASE_URL=http://apt.llvm.org
  • NEW_DEBIAN_DISTROS=("trixie" "unstable")
  • LLVM_VERSION=19
  • ALL=0
    ++ lsb_release -is
  • DISTRO=Ubuntu
    ++ lsb_release -cs
  • VERSION_CODENAME=jammy
    ++ lsb_release -sr
  • VERSION=22.04
  • UBUNTU_CODENAME=
  • CODENAME_FROM_ARGUMENTS=
  • source /etc/os-release
    ++ PRETTY_NAME='Ubuntu 22.04.4 LTS'
    ++ NAME=Ubuntu
    ++ VERSION_ID=22.04
    ++ VERSION='22.04.4 LTS (Jammy Jellyfish)'
    ++ VERSION_CODENAME=jammy
    ++ ID=ubuntu
    ++ ID_LIKE=debian
    ++ HOME_URL=https://www.ubuntu.com/
    ++ SUPPORT_URL=https://help.ubuntu.com/
    ++ BUG_REPORT_URL=https://bugs.launchpad.net/ubuntu/
    ++ PRIVACY_POLICY_URL=https://www.ubuntu.com/legal/terms-and-policies/privacy-policy
    ++ UBUNTU_CODENAME=jammy
  • DISTRO=ubuntu
  • is_new_debian=0
  • [[ ubuntu == \d\e\b\i\a\n ]]
  • needed_binaries=(lsb_release wget gpg)
  • [[ 0 -eq 0 ]]
  • needed_binaries+=(add-apt-repository)
  • missing_binaries=()
  • using_curl=
  • for binary in "${needed_binaries[@]}"
  • command -v lsb_release
  • for binary in "${needed_binaries[@]}"
  • command -v wget
  • for binary in "${needed_binaries[@]}"
  • command -v gpg
  • for binary in "${needed_binaries[@]}"
  • command -v add-apt-repository
  • [[ 0 -gt 0 ]]
  • case ${DISTRO} in
  • [[ -n jammy ]]
  • CODENAME=jammy
  • [[ -n jammy ]]
  • LINKNAME=-jammy
  • '[' 0 -ge 1 ']'
  • getopts :hm:n: arg
  • [[ 0 -ne 0 ]]
  • declare -A LLVM_VERSION_PATTERNS
  • LLVM_VERSION_PATTERNS[9]=-9
  • LLVM_VERSION_PATTERNS[10]=-10
  • LLVM_VERSION_PATTERNS[11]=-11
  • LLVM_VERSION_PATTERNS[12]=-12
  • LLVM_VERSION_PATTERNS[13]=-13
  • LLVM_VERSION_PATTERNS[14]=-14
  • LLVM_VERSION_PATTERNS[15]=-15
  • LLVM_VERSION_PATTERNS[16]=-16
  • LLVM_VERSION_PATTERNS[17]=-17
  • LLVM_VERSION_PATTERNS[18]=-18
  • LLVM_VERSION_PATTERNS[19]=-19
  • LLVM_VERSION_PATTERNS[20]=-20
  • LLVM_VERSION_PATTERNS[21]=
  • '[' '!' _ ']'
  • LLVM_VERSION_STRING=-19
  • [[ -n jammy ]]
  • REPO_NAME='deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main'
  • wget -q --method=HEAD http://apt.llvm.org/jammy
  • [[ ! -f /etc/apt/trusted.gpg.d/apt.llvm.org.asc ]]
  • [[ -z '' ]]
  • wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key
  • tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v1.4.12 (GNU/Linux)

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
bXb5c6gCHESH5PXwPU4jQEE7Ib9J6sbk7ZT2Mw==
=j+4q
-----END PGP PUBLIC KEY BLOCK-----
++ apt-key list
++ grep -i llvm

  • [[ -z /etc/apt/trusted.gpg.d/apt.llvm.org.asc
    uid [ unknown] Sylvestre Ledru - Debian LLVM packages [email protected] ]]
  • [[ jammy == \b\o\o\k\w\o\r\m ]]
  • [[ 0 -eq 1 ]]
  • add-apt-repository -y 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main'
    Repository: 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main'
    Description:
    Archive for codename: llvm-toolchain-jammy-19 components: main
    More info: http://apt.llvm.org/jammy/
    Adding repository.
    Adding deb entry to /etc/apt/sources.list.d/archive_uri-http_apt_llvm_org_jammy_-jammy.list
    Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-http_apt_llvm_org_jammy_-jammy.list
    Get:1 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease [3,632 B]
    Get:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease [1,581 B]
    Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
    Get:5 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 Packages [1,604 kB]
    Hit:6 http://archive.ubuntu.com/ubuntu jammy InRelease
    Get:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
    Get:3 https://apt.llvm.org/jammy llvm-toolchain-jammy-19 InRelease [6,833 B]
    Get:8 https://r2u.stat.illinois.edu/ubuntu jammy InRelease [6,555 B]
    Hit:9 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease
    Get:10 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 Packages [12.6 kB]
    Hit:11 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease
    Hit:12 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease
    Get:13 https://r2u.stat.illinois.edu/ubuntu jammy/main all Packages [8,843 kB]
    Hit:14 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
    Get:15 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1,243 kB]
    Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [3,140 kB]
    Get:17 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2,788 kB]
    Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,542 kB]
    Get:19 https://r2u.stat.illinois.edu/ubuntu jammy/main amd64 Packages [2,694 kB]
    Fetched 22.1 MB in 5s (4,429 kB/s)
    Reading package lists... Done
    W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)
  • apt-get update
    Hit:1 https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/ InRelease
    Hit:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 InRelease
    Hit:4 http://archive.ubuntu.com/ubuntu jammy InRelease
    Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
    Hit:6 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
    Hit:7 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
    Hit:3 https://apt.llvm.org/jammy llvm-toolchain-jammy-19 InRelease
    Hit:8 https://r2u.stat.illinois.edu/ubuntu jammy InRelease
    Hit:9 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease
    Hit:10 https://ppa.launchpadcontent.net/graphics-drivers/ppa/ubuntu jammy InRelease
    Hit:11 https://ppa.launchpadcontent.net/ubuntugis/ppa/ubuntu jammy InRelease
    Reading package lists... Done
    W: Skipping acquire of configured file 'main/source/Sources' as repository 'https://r2u.stat.illinois.edu/ubuntu jammy InRelease' does not seem to provide it (sources.list entry misspelt?)
  • PKG='clang-19 lldb-19 lld-19 clangd-19'
  • [[ 0 -eq 1 ]]
  • apt-get install -y clang-19 lldb-19 lld-19 clangd-19
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following additional packages will be installed:
    libabsl20210324 libc-ares2 libclang-common-19-dev libclang-cpp19
    libclang-rt-19-dev libclang1-19 libgrpc++1 libgrpc10 libipt2 liblldb-19
    libllvm19 libpfm4 llvm-19 llvm-19-dev llvm-19-linker-tools llvm-19-runtime
    llvm-19-tools python3-lldb-19 python3-pygments python3-yaml
    Suggested packages:
    clang-19-doc wasi-libc llvm-19-doc python-pygments-doc ttf-bitstream-vera
    The following NEW packages will be installed:
    clang-19 clangd-19 libabsl20210324 libc-ares2 libclang-common-19-dev
    libclang-cpp19 libclang-rt-19-dev libclang1-19 libgrpc++1 libgrpc10 libipt2
    liblldb-19 libllvm19 libpfm4 lld-19 lldb-19 llvm-19 llvm-19-dev
    llvm-19-linker-tools llvm-19-runtime llvm-19-tools python3-lldb-19
    python3-pygments python3-yaml
    0 upgraded, 24 newly installed, 0 to remove and 37 not upgraded.
    Need to get 140 MB of archives.
    After this operation, 802 MB of additional disk space will be used.
    Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 python3-yaml amd64 5.4.1-1ubuntu1 [129 kB]
    Get:1 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 libllvm19 amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [28.8 MB]
    Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 libabsl20210324 amd64 0
    20210324.2-2 [387 kB]
    Get:9 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libc-ares2 amd64 1.18.1-1ubuntu0.22.04.3 [45.1 kB]
    Get:10 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libgrpc10 amd64 1.30.2-3build6 [1,470 kB]
    Get:12 http://archive.ubuntu.com/ubuntu jammy/universe amd64 libgrpc++1 amd64 1.30.2-3build6 [402 kB]
    Get:13 http://archive.ubuntu.com/ubuntu jammy/main amd64 libipt2 amd64 2.0.5-1 [46.4 kB]
    Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libpfm4 amd64 4.11.1+git32-gd0b85fb-1ubuntu0.1 [345 kB]
    Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-pygments all 2.11.2+dfsg-2ubuntu0.1 [750 kB]
    Get:3 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 libclang-cpp19 amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [14.4 MB]
    Get:4 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 libclang-common-19-dev amd64 1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75 [772 kB]
    Get:5 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 llvm-19-linker-tools amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [1,414 kB]
    Get:7 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 libclang1-19 amd64 1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75 [8,400 kB]
    Get:8 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 clang-19 amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [150 kB]
    Get:11 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 clangd-19 amd64 1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75 [3,567 kB]
    Get:15 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 libclang-rt-19-dev amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [4,012 kB]
    Get:17 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 liblldb-19 amd64 1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75 [4,469 kB]
    Get:18 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 lld-19 amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [1,503 kB]
    Get:19 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 python3-lldb-19 amd64 1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75 [193 kB]
    Get:20 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 lldb-19 amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [1,333 kB]
    Get:21 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 llvm-19-runtime amd64 1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75 [624 kB]
    Get:22 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 llvm-19 amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [17.9 MB]
    Get:23 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 llvm-19-tools amd64 1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75 [576 kB]
    Get:24 https://apt.llvm.org/jammy llvm-toolchain-jammy-19/main amd64 llvm-19-dev amd64 1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75 [48.2 MB]
    Fetched 140 MB in 7s (20.3 MB/s)
    Selecting previously unselected package python3-yaml.
    (Reading database ... 126332 files and directories currently installed.)
    Preparing to unpack .../00-python3-yaml_5.4.1-1ubuntu1_amd64.deb ...
    Unpacking python3-yaml (5.4.1-1ubuntu1) ...
    Selecting previously unselected package libllvm19:amd64.
    Preparing to unpack .../01-libllvm19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking libllvm19:amd64 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package libclang-cpp19.
    Preparing to unpack .../02-libclang-cpp19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking libclang-cpp19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package libclang-common-19-dev:amd64.
    Preparing to unpack .../03-libclang-common-19-dev_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking libclang-common-19-dev:amd64 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package llvm-19-linker-tools.
    Preparing to unpack .../04-llvm-19-linker-tools_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking llvm-19-linker-tools (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package libclang1-19.
    Preparing to unpack .../05-libclang1-19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking libclang1-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package clang-19.
    Preparing to unpack .../06-clang-19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking clang-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package libabsl20210324:amd64.
    Preparing to unpack .../07-libabsl20210324_0
    20210324.2-2_amd64.deb ...
    Unpacking libabsl20210324:amd64 (020210324.2-2) ...
    Selecting previously unselected package libc-ares2:amd64.
    Preparing to unpack .../08-libc-ares2_1.18.1-1ubuntu0.22.04.3_amd64.deb ...
    Unpacking libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.3) ...
    Selecting previously unselected package libgrpc10:amd64.
    Preparing to unpack .../09-libgrpc10_1.30.2-3build6_amd64.deb ...
    Unpacking libgrpc10:amd64 (1.30.2-3build6) ...
    Selecting previously unselected package libgrpc++1:amd64.
    Preparing to unpack .../10-libgrpc++1_1.30.2-3build6_amd64.deb ...
    Unpacking libgrpc++1:amd64 (1.30.2-3build6) ...
    Selecting previously unselected package clangd-19.
    Preparing to unpack .../11-clangd-19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking clangd-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package libclang-rt-19-dev:amd64.
    Preparing to unpack .../12-libclang-rt-19-dev_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking libclang-rt-19-dev:amd64 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package libipt2.
    Preparing to unpack .../13-libipt2_2.0.5-1_amd64.deb ...
    Unpacking libipt2 (2.0.5-1) ...
    Selecting previously unselected package liblldb-19.
    Preparing to unpack .../14-liblldb-19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking liblldb-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package lld-19.
    Preparing to unpack .../15-lld-19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking lld-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package python3-lldb-19.
    Preparing to unpack .../16-python3-lldb-19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking python3-lldb-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package lldb-19.
    Preparing to unpack .../17-lldb-19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking lldb-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package llvm-19-runtime.
    Preparing to unpack .../18-llvm-19-runtime_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking llvm-19-runtime (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package libpfm4:amd64.
    Preparing to unpack .../19-libpfm4_4.11.1+git32-gd0b85fb-1ubuntu0.1_amd64.deb ...
    Unpacking libpfm4:amd64 (4.11.1+git32-gd0b85fb-1ubuntu0.1) ...
    Selecting previously unselected package llvm-19.
    Preparing to unpack .../20-llvm-19_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking llvm-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package python3-pygments.
    Preparing to unpack .../21-python3-pygments_2.11.2+dfsg-2ubuntu0.1_all.deb ...
    Unpacking python3-pygments (2.11.2+dfsg-2ubuntu0.1) ...
    Selecting previously unselected package llvm-19-tools.
    Preparing to unpack .../22-llvm-19-tools_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking llvm-19-tools (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Selecting previously unselected package llvm-19-dev.
    Preparing to unpack .../23-llvm-19-dev_1%3a19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75_amd64.deb ...
    Unpacking llvm-19-dev (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up libllvm19:amd64 (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up libclang1-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up libclang-common-19-dev:amd64 (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up python3-yaml (5.4.1-1ubuntu1) ...
    Setting up libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.3) ...
    Setting up python3-pygments (2.11.2+dfsg-2ubuntu0.1) ...
    Setting up libpfm4:amd64 (4.11.1+git32-gd0b85fb-1ubuntu0.1) ...
    Setting up libipt2 (2.0.5-1) ...
    Setting up libabsl20210324:amd64 (020210324.2-2) ...
    Setting up libclang-rt-19-dev:amd64 (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up llvm-19-linker-tools (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up llvm-19-runtime (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up lld-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up llvm-19-tools (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up libclang-cpp19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up liblldb-19 (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up clang-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up libgrpc10:amd64 (1.30.2-3build6) ...
    Setting up llvm-19 (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up python3-lldb-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up libgrpc++1:amd64 (1.30.2-3build6) ...
    Setting up clangd-19 (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up lldb-19 (1:19.1.7++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Setting up llvm-19-dev (1:19.1.7
    ++20250114103320+cd708029e0b2-1exp120250114103432.75) ...
    Processing triggers for man-db (2.10.2-1) ...
    Processing triggers for libc-bin (2.35-0ubuntu3.8) ...
    /sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link

/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link

Ubuntu clang version 19.1.7 (++20250114103320+cd708029e0b2-1exp120250114103432.75)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment