Add files via upload

Former-commit-id: c972afb73c7d134bba085778ed96d444082a67bc [formerly cf8439e9e3]
Former-commit-id: 3557427a8bd9b591561f3766ed05560653c1c2d2
This commit is contained in:
Cyberes 2022-09-21 23:37:20 -06:00 committed by GitHub
parent 36de6554cb
commit 1fea3f7c4a
1 changed files with 8 additions and 7 deletions

View File

@ -21,10 +21,12 @@
"outputs": [],
"source": [
"# Install\n",
"!pip install huggingface-hub wget\n",
"%cd /notebooks/\n",
"!pip install huggingface-hub\n",
"!apt update\n",
"!apt install -y git-lfs\n",
"!mkdir -p /notebooks/sd-concepts-library"
"!mkdir -p /notebooks/sd-concepts-library\n",
"!mkdir -p /notebooks/sd-concepts-library/repositories"
]
},
{
@ -38,9 +40,6 @@
"outputs": [],
"source": [
"%cd /notebooks/sd-concepts-library\n",
"import requests\n",
"import os\n",
"import wget\n",
"from huggingface_hub import HfApi\n",
"\n",
"api = HfApi()\n",
@ -50,8 +49,10 @@
"i = 1\n",
"for model_info in models_list:\n",
" print(f'\\nCloning {model_info.modelId} | {i}/{len(models_list)}')\n",
" url = f'https://huggingface.co/{model_info.modelId}'\n",
" !git clone $url\n",
" model_name = model_info.modelId.replace('sd-concepts-library/', '')\n",
" !git clone --depth=1 https://huggingface.co/{model_info.modelId} /notebooks/sd-concepts-library/repositories/{model_name}\n",
" !rm -rf /notebooks/sd-concepts-library/repositories/{model_name}/.git*\n",
" !mv /notebooks/sd-concepts-library/repositories/{model_name}/learned_embeds.bin /notebooks/sd-concepts-library/\"{model_name}.pt\"\n",
" i = i + 1"
]
},