祗疼妳一个 发表于 2024-8-19 12:39:18

stable-diffusion-webui报OSError: Can‘t load tokenizer for ‘openai/cl

这个是个普遍问题,比方:Windows平台安装stable-diffusion-webui-1.7.0解决少工具包clip-vit-large-patch14 - 知乎
Stable Diffusion WebUI linux部署问题_oserror: can't load tokenizer for 'openai/clip-vit-CSDN博客 
但是我发现很多朋友是改代码中的绝对路径的,这非常不科学,为啥要用硬编码绝对路径呢?
详细的报错信息如下:
   OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'openai/clip-vit-large-patch14' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.

Stable diffusion model failed to load
解决方法实际很简单,在 stable-diffusion-webui根目录下的stable-diffusion-webui文件夹下创建openai文件夹,然后在一些镜像repo,如:clip-vit-large-patch14: Mirror of https://huggingface.co/openai/clip-vit-large-patch14
把repo clone到openai文件夹就行了。何必要用硬编码呢,完全违反软件工程实践。
比方我的根目录结构如下:
   .
├── CHANGELOG.md
├── CITATION.cff
├── CODEOWNERS
├── configs
├── embeddings
├── environment-wsl2.yaml
├── extensions
├── extensions-builtin
├── html
├── javascript
├── launch.py
├── LICENSE.txt
├── localizations
├── models
├── modules
├── package.json
├── pyproject.toml
├── README.md
├── requirements_npu.txt
├── requirements-test.txt
├── requirements.txt
├── requirements_versions.txt
├── screenshot.png
├── script.js
├── scripts
├── stable-diffusion-webui
├── style.css
├── test
├── textual_inversion_templates
├── webui.bat
├── webui-macos-env.sh
├── webui.py
├── webui.sh
├── webui-user.bat
└── webui-user.sh
则必要在标红的目录下新建openai文件夹。不知道这么简单的问题为什么大家讲不清晰。

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: stable-diffusion-webui报OSError: Can‘t load tokenizer for ‘openai/cl