huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form ‘repo_name‘ or ‘nam

huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form ‘repo_name’ or ‘namespace/repo_name’: ‘./THUDM/chatglm-6b’. Use repo_type argument if needed.

I. Introduction

This error was reported when chatGLM was reproduced.

Second, the solution

1. The path of the downloaded model is wrong

This error is actually caused by the model not being found locally, you can check it.

2. The HuggingFace model path is wrong

model = AutoModel.from_pretrained(“ ./THUDM/chatglm-6b ”, trust_remote_code=True).quantize(8).half().cuda()
For example, this one uses a relative address and should use an absolute address
model = AutoModel. from_pretrained(" HuggingFace/THUDM/chatglm-6b ", trust_remote_code=True).quantize(8).half().cuda()

Guess you like

Origin blog.csdn.net/qq_51116518/article/details/130299886