这个是个普遍问题,例如: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文件夹。不知道这么简单的问题为什么大家讲不清楚。