From fdd8ec29da25edb7b9009dc271d794abe39a9b43 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 26 Apr 2024 10:25:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/models/downloading.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/models/downloading.md b/docs/models/downloading.md index 42269b4..535279d 100644 --- a/docs/models/downloading.md +++ b/docs/models/downloading.md @@ -24,9 +24,18 @@ from diffusers import DiffusionPipeline pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0") ``` -执行上面脚本时,请设置环境变量: +#### 设置环境变量 (二选一) +- 执行上面脚本时,请设置环境变量: ```bash -export HF_ENDPOINT=https://ai.gitee.com/huggingface +export HF_ENDPOINT=https://hf-api.gitee.com export HF_HOME=~/.cache/gitee-ai ``` + +- 在代码头部粘贴以下代码: +```python +import os +os.environ["HF_HOME"] = "~/.cache/gitee-ai" +os.environ["HF_ENDPOINT"] = "https://hf-api.gitee.com" +``` + -- Gitee