Update as_safetensors+fp16.ipynb
Browse files
as_safetensors+fp16.ipynb
CHANGED
@@ -115,6 +115,7 @@
|
|
115 |
"import urllib.parse\n",
|
116 |
"import urllib.request\n",
|
117 |
"import wget\n",
|
|
|
118 |
"\n",
|
119 |
"models = \"Specify_the_model_in_this_way_if_the_model_is_on_My_Drive.safetensors, https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/wd-1-4-anime_e1.ckpt, https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/wd-1-4-anime_e1.yaml\" #@param {type:\"string\"}\n",
|
120 |
"models = [m.strip() for m in models.split(\",\")]\n",
|
@@ -122,6 +123,7 @@
|
|
122 |
" if 0 < len(urllib.parse.urlparse(model).scheme): # if model is url\n",
|
123 |
" wget.download(model)\n",
|
124 |
" elif model.endswith((\".ckpt\", \".safetensors\", \".yaml\", \".pt\")):\n",
|
|
|
125 |
" shutil.copy(\"/content/drive/MyDrive/\" + model, \"/content/\" + model) # get the model from mydrive\n",
|
126 |
" else:\n",
|
127 |
" print(f\"\\\"{model}\\\"はURLではなく、正しい形式のファイルでもありません\")"
|
|
|
115 |
"import urllib.parse\n",
|
116 |
"import urllib.request\n",
|
117 |
"import wget\n",
|
118 |
+
"import os\n",
|
119 |
"\n",
|
120 |
"models = \"Specify_the_model_in_this_way_if_the_model_is_on_My_Drive.safetensors, https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/wd-1-4-anime_e1.ckpt, https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/wd-1-4-anime_e1.yaml\" #@param {type:\"string\"}\n",
|
121 |
"models = [m.strip() for m in models.split(\",\")]\n",
|
|
|
123 |
" if 0 < len(urllib.parse.urlparse(model).scheme): # if model is url\n",
|
124 |
" wget.download(model)\n",
|
125 |
" elif model.endswith((\".ckpt\", \".safetensors\", \".yaml\", \".pt\")):\n",
|
126 |
+
" os.makedirs("/content/" + model, exist_ok=True)\n",
|
127 |
" shutil.copy(\"/content/drive/MyDrive/\" + model, \"/content/\" + model) # get the model from mydrive\n",
|
128 |
" else:\n",
|
129 |
" print(f\"\\\"{model}\\\"はURLではなく、正しい形式のファイルでもありません\")"
|