Skip to content

convert-pth-to-ggml.py error with "Got unsupported ScalarType BFloat16" #398

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
austinchau opened this issue Mar 22, 2023 · 2 comments
Closed
Labels
need more info The OP should provide more details about the issue

Comments

@austinchau
Copy link

austinchau commented Mar 22, 2023

Trying to convert "chavinlo/alpaca-native" alpaca native model's (https://huggingface.co/chavinlo/alpaca-native) weights to ggml but got this error -

Processing part 0

Processing variable: model.embed_tokens.weight with shape: torch.Size([32001, 4096]) and type: torch.float32
Processing variable: model.layers.0.self_attn.q_proj.weight with shape: torch.Size([4096, 4096]) and type: torch.float32
Processing variable: model.layers.0.self_attn.k_proj.weight with shape: torch.Size([4096, 4096]) and type: torch.float32
Processing variable: model.layers.0.self_attn.v_proj.weight with shape: torch.Size([4096, 4096]) and type: torch.float32
Processing variable: model.layers.0.self_attn.o_proj.weight with shape: torch.Size([4096, 4096]) and type: torch.float32
Processing variable: model.layers.0.self_attn.rotary_emb.inv_freq with shape: torch.Size([64]) and type: torch.bfloat16
Traceback (most recent call last):
File "/Users/domeie/projects/llama.cpp/convert-pth-to-ggml.py", line 157, in
main()
File "/Users/domeie/projects/llama.cpp/convert-pth-to-ggml.py", line 151, in main
process_and_write_variables(fout, model, ftype)
File "/Users/domeie/projects/llama.cpp/convert-pth-to-ggml.py", line 109, in process_and_write_variables
data = datao.numpy().squeeze()
TypeError: Got unsupported ScalarType BFloat16

@austinchau austinchau changed the title convert-pth-to-ggml.py error with "Got unsupported ScalarType BFloat16" running on "chavinlo/alpaca-native" alpaca native model convert-pth-to-ggml.py error with "Got unsupported ScalarType BFloat16" Mar 22, 2023
@gjmulder gjmulder added the need more info The OP should provide more details about the issue label Mar 22, 2023
@gjmulder
Copy link
Collaborator

gjmulder commented Mar 22, 2023

Please review and use our issue template to provide more details so we can better understand your problem and answer you.

@prusnak
Copy link
Collaborator

prusnak commented Apr 16, 2023

The scripts have been rewritten from scratch. Try the new convert.py script from master.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
need more info The OP should provide more details about the issue
Projects
None yet
Development

No branches or pull requests

3 participants