llama.cpp icon indicating copy to clipboard operation
llama.cpp copied to clipboard

convert : get general.name from model dir, not its parent

Open cebtenzzre opened this issue 1 year ago • 5 comments

When I converted dl/Open-Orca_Mistral-7b-OpenOrca, convert.py would set general.name to dl. Now it sets it to Open-Orca_Mistral-7b-OpenOrca like convert-hf-to-gguf.py would.

Am I missing something? I don't understand if the previous behavior was intentional. TheBloke's models on HF don't seem to be affected by this... cc @TheBloke in case you have an opinion?

cebtenzzre avatar Feb 20 '24 18:02 cebtenzzre

Originally this is from https://github.com/ggerganov/llama.cpp/commit/8f8c28e89cb9531211783da697d6e7c445e2af1d. My guess is that it was done this way due to the directory structure of the original llama-2 distribution files.

slaren avatar Feb 20 '24 18:02 slaren

My guess is that it was done this way due to the directory structure of the original llama-2 distribution files.

Yes, that was the intention. It's not the smartest logic, so probably it can be improved. But I like to think that convert.py's main purpose is to convert the original models released by Meta. So it should be compatible in some way or another with the directory structure of those models

ggerganov avatar Feb 20 '24 19:02 ggerganov

My guess is that it was done this way due to the directory structure of the original llama-2 distribution files.

Where do I get these? I know about https://github.com/facebookresearch/llama but their download.sh just downloads files to a folder with a name like "llama-2-7b" (MODEL_PATH) in the current directory (TARGET_FOLDER of ".").

cebtenzzre avatar Feb 20 '24 19:02 cebtenzzre

Could it be clearly explained how the expected folder structure is meant to be created, so that I can verify that convert.py sets general.name correctly in all cases? So far it seems to me that some manual operations are required to result in the name of the parent directory being relevant, Meta checkpoints or otherwise.

cebtenzzre avatar Apr 10 '24 13:04 cebtenzzre

I'm pretty sure it's safe to merge as I was trying to do the same a while ago as well... and gg thinks it's safe to do so based on his directory structure.

Will merge soon unless someone else can see any issue.

(Context: Was going though list of all approved but not yet merged https://github.com/ggerganov/llama.cpp/pulls?q=is%3Apr+is%3Aopen+review%3Aapproved PRs. Do have a check.)

mofosyne avatar May 14 '24 05:05 mofosyne