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()

相关文章
|
3月前
|
开发工具 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
|
3月前
|
网络协议 Linux 虚拟化
CentOS 8 错误: Error setting up base repository
CentOS 8 错误: Error setting up base repository
|
3月前
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:
180 1
|
3月前
【完美解决】Github action报错remote: Write access to repository not granted.
【完美解决】Github action报错remote: Write access to repository not granted.
521 1
|
10月前
centos8 Failed to download metadata for repo ‘base‘: Cannot download repomd.xml
centos8 Failed to download metadata for repo ‘base‘: Cannot download repomd.xml
390 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
12162 1
【已解决】Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist
|
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
327 0
错误:为 repo ‘appstream‘ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist
repos.d中更新一下源,使用vault.centos.org代替mirror.centos.org。执行以下两行代码进行修改。
950 2
错误:为 repo ‘appstream‘ 下载元数据失败 : Cannot prepare internal mirrorlist: No URLs in mirrorlist
|
开发工具 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
113 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
308 0