Problem with "convert-pth-to-ggml.py"

#1
by Adrian1978 - opened

Hi guys, Hope you can help me.
I followed the instructions of: https://agi-sphere.com/install-llama-mac/
It works nice until:

"Step 6: Convert and quantize model file
Convert the file to the ggml format using the following command.
./venv/bin/python convert-pth-to-ggml.py models/7B/ 1
This is going to take a while. A file called models/7B//ggml-model-f16.bin should be created."

There it gives me an error message:
"/Users/AE/llama.cpp/venv/bin/python: can't open file '/Users/AE/llama.cpp/convert-pth-to-ggml.py': [Errno 2] No such file or directory"

Where and how can I find this file - I looked for it - it is not on my computer. What can I do?
Kind regards,
Adrian

Probably not relevant anymore, but I'll answer for the sake of anyone who is dealing with legacy models.

The issue you're facing is that when you ran the command git clone https://github.com/ggerganov/llama.cpp as instructed in step 3, it downloaded the newest version of llama.cpp at the time. This version is different to the version used in the article, and no longer contains a file named convert-pth-to-ggml.py.

To resolve this, you'd need to switch to the version used in the article. This info is not explicitly provided, but based on the publication date, it could not have been newer than revision 2e8265a

To switch to this version, navigate to llama.cpp in your terminal and run the command:

git checkout 2e8265a

Your output should look something like this:

Note: switching to '2e8265a'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 2e8265ae convert.py : add missing abstract methods for quantized data (#2491)

You will now see convert-pth-to-ggml.py in the root of llama.cpp. You can verify that the file exists by running this command:

test -f convert-pth-to-ggml.py && echo "File exists" || echo "File does not exist"

Because you're now on a different version of llama.cpp, you'll need to rerun this command from step 3:

make

You may now retry step 6 and everything should work.

Sign up or log in to comment