After manually downloading the model from huggingface, how do I put the model file into the specified path?
I need to run chatGLM3 locally, and then I just run the following code
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm3-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm3-6b", trust_remote_code=True, device='cuda')
model = model.eval()
response, history = model.chat(tokeniser, "Hello", history=[])
Running the above code will first download around 10GB of model files from huggingface. But the problem is, huggingface’s download speed is too slow. So I tried to download it manually: THUDM/chatglm3-6b at main
But the problem is that huggingface has a weird local directory structure:
╰─➤ fd -a -u pytorch_model | grep chatglm3-6b
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/snapshots/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model-00007-of-00007.bin
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/snapshots/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model-00003-of-00007.bin
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/snapshots/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model-00006-of-00007.bin
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/snapshots/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model-00004-of-00007.bin
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/snapshots/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model-00001-of-00007.bin
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/snapshots/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model.bin.index.json
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/snapshots/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model-00002-of-00007.bin
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/snapshots/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model-00005-of-00007.bin
/home/pon/.cache/huggingface/hub/models--THUDM--chatglm3-6b/.no_exist/e46a14881eae613281abbd266ee918e93a56018f/pytorch_model.bin
There is an inexplicable string of snapshots/e46a14881eae613281abbd266ee918e93a56018f
!!! so, after I download the model files manually, how do I know which path to put them in? Where can I find out if it is e46a14881eae613281abbd266ee918e93a56018f or e46a14881eae613281abbd266ee918e93a56018w?