MartialTerran commited on
Commit
c5692af
·
verified ·
1 Parent(s): 6004f53

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -3
README.md CHANGED
@@ -1,3 +1,37 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Since Huggingface has omitte to publish a standalone SmolLM2_360M_model.py to load and finetune and run inference of the released model weights at https://huggingface.co/HuggingFaceTB/SmolLM2-360M/
2
+ I have attempte to construct a model.py that can load and at least inference mode the weights. The SmolLM2_360M_model.py runs but is unable to load the safetensors data. Here is the encountered error:
3
+
4
+ C:\Users\User\OneDrive\Desktop\SmolLM2>python SmolLM2_360M_model_debugging.py
5
+ Warning: SentencePiece not found, using rudimentary BPE tokenizer. Install SentencePiece for better performance.
6
+
7
+ A module that was compiled using NumPy 1.x cannot be run in
8
+ NumPy 2.1.3 as it may crash. To support both 1.x and 2.x
9
+ versions of NumPy, modules must be compiled with NumPy 2.0.
10
+ Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
11
+
12
+ If you are a user of the module, the easiest solution will be to
13
+ downgrade to 'numpy<2' or try to upgrade the affected module.
14
+ We expect that some modules will need time to support NumPy 2.
15
+
16
+ Traceback (most recent call last): File "C:\Users\User\OneDrive\Desktop\SmolLM2\SmolLM2_360M_model_debugging.py", line 470, in <module>
17
+ model = SmolLM2_360M(config_path)
18
+ File "C:\Users\User\OneDrive\Desktop\SmolLM2\SmolLM2_360M_model_debugging.py", line 243, in __init__
19
+ self.embed_tokens = nn.Embedding(self.vocab_size, self.hidden_size)
20
+ File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\sparse.py", line 142, in __init__
21
+ self.weight = Parameter(torch.empty((num_embeddings, embedding_dim), **factory_kwargs),
22
+ C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\sparse.py:142: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.)
23
+ self.weight = Parameter(torch.empty((num_embeddings, embedding_dim), **factory_kwargs),
24
+ An error occurred while loading weights: File does not contain tensor lm_head.weight
25
+
26
+ C:\Users\User\OneDrive\Desktop\SmolLM2>
27
+
28
+ So, what is the story with safetensors "File does not contain tensor lm_head.weight"
29
+
30
+ Is there a python script for inspecting the safetensors file?
31
+
32
+ Why does model.safetensors file "not contain tensor lm_head.weight"?
33
+
34
+
35
+ ---
36
+ license: apache-2.0
37
+ ---