Add files via upload

This commit is contained in:
Cyberes 2022-09-21 23:37:20 -06:00 committed by GitHub
parent e1f42cb916
commit cf8439e9e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"
]
},