Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix many bugs #2

Merged
merged 1 commit into from
Sep 12, 2023
Merged

fix many bugs #2

merged 1 commit into from
Sep 12, 2023

Conversation

kroggen
Copy link
Contributor

@kroggen kroggen commented Sep 12, 2023

This PR fix many bugs:

  • convert_awq_to_bin.py: the tensor must be copied from GPU to CPU before converting to numpy

This is the error message:

$ python3 ../llama_cu_awq/convert_awq_to_bin.py pytorch_model.bin files
model.embed_tokens.weight <class 'torch.Tensor'>
torch.Size([32000, 4096]) torch.float16
Traceback (most recent call last):
  File "/root/models/../llama_cu_awq/convert_awq_to_bin.py", line 31, in <module>
    f.write(value.numpy().tobytes())
TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
  • gets_s and open_s are Windows specific
  • \\ does not work on Linux, but / works on Windows as file separator (at least it used to)

If some of these are not OK, you can further fix them

@ankan-ban ankan-ban merged commit 7a456ba into ankan-ban:main Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants