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

简介: 这篇文章介绍了在使用HuggingFace模型库时遇到的`Repo id`格式错误问题,并提供了将相对路径改为正确的绝对路径的解决办法。

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.

一,前言

复现chatGLM的时候报了这个错。

二,解决办法

1,已下载的模型路径不对

这个报错实际上是本地找不到模型导致的,可以检查一下看看。

2,HuggingFace模型路径不对

model = AutoModel.from_pretrained(“./THUDM/chatglm-6b”, trust_remote_code=True).quantize(8).half().cuda()
比如这个这个,就用了相对地址应该用绝对地址
model = AutoModel.from_pretrained(“HuggingFace/THUDM/chatglm-6b”, trust_remote_code=True).quantize(8).half().cuda()

相关文章
|
7月前
|
开发工具 git
*** Please tell me who you are.Run git config --global user.email “you@example.com“ git confi
*** Please tell me who you are.Run git config --global user.email “you@example.com“ git confi
|
7月前
Centos8 Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:
Centos8 Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist:
240 1
centos8 Failed to download metadata for repo ‘base‘: Cannot download repomd.xml
centos8 Failed to download metadata for repo ‘base‘: Cannot download repomd.xml
512 1
|
8月前
|
开发工具 git
git报错 Unable to create ‘D:/project/xxx/.git/index.lock‘: File exists.
git报错 Unable to create ‘D:/project/xxx/.git/index.lock‘: File exists.
358 1
|
缓存 Linux 开发工具
【已解决】Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist
【已解决】Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist
12692 1
【已解决】Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist
CEH v8~v11 Module Slides 和 Lab Manual 下载
CEH v8~v11 Module Slides 和 Lab Manual 下载
86 0
|
Linux 开发工具 Docker
Docker报错: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist
Docker报错: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist
367 0
|
开发工具 git
Can‘t find third_party/gtest. Run git submodule update --init, or disable with CMake -DBUILD_TEST
Can‘t find third_party/gtest. Run git submodule update --init, or disable with CMake -DBUILD_TEST
122 0
|
Linux Go
centos8 appstream大坑Failed to download metadata for repo appstream: Cannot prepare internal mirrorlis
centos8 appstream大坑Failed to download metadata for repo appstream: Cannot prepare internal mirrorlis
344 0
|
开发工具 git
Git: Cannot update paths and switch to branch 'feature' at the same time.
Git: Cannot update paths and switch to branch 'feature' at the same time.
365 0