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

Convert.py @staticmethod #1327

Merged
merged 2 commits into from
May 5, 2023
Merged

Conversation

blecaillon
Copy link
Contributor

@blecaillon blecaillon commented May 4, 2023

At line 698, @staticmethod before lazy_rebuild_tensor_V2 throws error at unpickle.load() as not callable

otherwise throw error at unpickle.load() as not callable
@blecaillon blecaillon changed the title Line 698 has one #staticmethod and should not Conert.py @staticmethod May 4, 2023
@blecaillon blecaillon changed the title Conert.py @staticmethod Convert.py @staticmethod May 4, 2023
@ivanstepanovftw
Copy link
Collaborator

ivanstepanovftw commented May 4, 2023

Can you please share error message, OS name and python version? Just curious, can't reproduce..

Copy link
Collaborator

@ivanstepanovftw ivanstepanovftw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 709 should be removed too then

@blecaillon
Copy link
Contributor Author

So I am running Python 3.9 on macOs 13.3.1 (a)

Here is the error (once i comment line 698, working great:)):

LLama.cpp % python3 convertTest.py ../llama-7b
Loading model file ../llama-7b/pytorch_model-00001-of-00002.bin
Traceback (most recent call last):
File "Users/LLM/llama.cpp/convertTest.py", line 1173, in
main()
File "/Users/LLM/llama.cpp/convertTest.py", line 1153, in main
model_plus = load_some_model(args.model)
File "/Users/LLM/llama.cpp/convertTest.py", line 1079, in load_some_model
models_plus.append(lazy_load_file(path))
File "/Users/LLM/llama.cpp/convertTest.py", line 873, in lazy_load_file
return lazy_load_torch_file(fp, path)
File "/Users/LLM/llama.cpp/convertTest.py", line 745, in lazy_load_torch_file
model = unpickler.load()
TypeError: 'staticmethod' object is not callable

@ivanstepanovftw
Copy link
Collaborator

Reproduced with python 3.9 on fedora

@ivanstepanovftw ivanstepanovftw merged commit a90e96b into ggerganov:master May 5, 2023
KerfuffleV2 pushed a commit to KerfuffleV2/llama.cpp that referenced this pull request May 6, 2023
* Line 698 has one #staticmethod and should not

otherwise throw error at unpickle.load() as not callable

* Update convert.py

---------

Co-authored-by: Ivan Stepanov <ivanstepanovftw@gmail.com>
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