-
Notifications
You must be signed in to change notification settings - Fork 5.2k
手动下载的模型放到哪个位置? #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
随便放在哪里都行。。在加载的时候设置好本地路径即可。 |
不得行呢,这样会报错:
是我姿势没对吗? |
同样遇到了这个问题 |
you should download all files from here, except those you have downloaded from tsinghua cloud |
I have downloaded all files from huggingface. mypath = "G:/chatGLM-6B/model"
tokenizer = AutoTokenizer.from_pretrained(mypath, trust_remote_code=True) it returns:
It seems that some errors occur in my cache setting |
Path name on Windows should be specially treated (just Google this). Pathlib package or replacing "/" with "\" might be possible to solve your problem. |
看报错应该是路径识别有点异常。程序觉得传递的路径有问题(Windows格式),Linux下是/开头而且不会有冒号。 |
问题应该已解决,目前我的解决方案是,首先用AutoModel,把模型名称填入进去,然后等待模型下载好后,把模型从~/.cache/xxx 路径下,复制到项目目录,然后修改脚本,这样是可以启动的,直接通过云盘下载的模型,缺少一些文件,不能直接启动 @yaleimeng @feixyz10 @helloxz @Ling-YangHui |
哦。。我们从huggingface下载的。所以没遇到 |
云盘只有大文件,只要去huggingface下把小文件下齐就好了,我亲测可行 |
%USERPROFILE%.cache\huggingface\hub\models--THUDM--chatglm-6b\snapshots下有一个或多个名字像git版本号的目录,放最新的那个下面就可以了 |
问题解决了吗? |
@nikshe 是否文件没有下齐全?除了8个权重文件,hugging face 目录下所有的小文件都要放在模型目录里。看这个报错是模型目录里没有 |
这8个bin文件要用cat把他们连起来吗,我显示找不到模型文件,但连起来又说读取失败: root@2227e6c2b8b1:/work/chatglm-6b/ChatGLM-6B# python cli_demo.py |
我的解决了,原来是缺少 pytorch_model.bin.index.json |
我这边必须填写window的绝对路径 |
能分享一下本地运行模型文件的代码吗 |
我的模型文件是齐全的,路径也是正确的,但是也报错。最后我把keras卸载了,就没有问题了。好神奇啊! |
我这边在wsl里面,都需要改成绝对路径,两行都要改。 |
mypath = 'G:\\chatGLM-6B\\model' 这样试试 双斜杠'\\'试试 |
以下是我本地运行方法 第一次,联网运行
后面就可以离线加载
|
我的报错信息: 我的代码: 我使用的是wsl,下载的模型放在/data/chatglm-6b-int4下 |
This change works in cli_demo.py:
Firstly I downloaded these .bin files from THU cloud and other files in chatglm-6b folder from huggingface, and an OSError showed when running cli_demo.py. |
我也是一样的情况,给了地址,他还是走缓存 |
Please follow the instructions at https://github.com/THUDM/ChatGLM-6B#%E4%BB%8E%E6%9C%AC%E5%9C%B0%E5%8A%A0%E8%BD%BD%E6%A8%A1%E5%9E%8B |
改为
后报错
|
在demo.py import之后增加/修改 import os
model_path = os.path.join(".", "models")
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModel.from_pretrained(model_path, trust_remote_code=True).half().cuda()
model = model.eval() 然后把从hugfacing上git clone好的文件放到models目录下。这个linux和windows都可以用。 |
模型参数没用缓存,但为什么模型本身加载的py还用的缓存啊,咋解决 |
哈哈哈我今天遇到一样的情况 , 为什么最后会加个盘符啊?? |
linux环境上我将下载后的文件夹移动到项目中就可以了 |
看到有这一行说明:
我手动下载了模型,应该放到本地哪个文件夹呢?
The text was updated successfully, but these errors were encountered: