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
|
6 |
+
"metadata": {
|
7 |
+
"tags": []
|
8 |
+
},
|
9 |
+
"source": [
|
10 |
+
"### General HunterDesigner Notebook Actualizado V.1.0\n",
|
11 |
+
"[](https://www.facebook.com/jhilmitar/)\n",
|
13 |
+
"[](https://www.facebook.com/hunterdesignerbol)\n",
|
15 |
+
"[](https://www.facebook.com/hunterdesignerbol)\n",
|
17 |
+
"<img src=\"https://emoji.discadia.com/emojis/00b5ebd1-84cf-41dd-a3bd-91c59f31bd70.PNG\" width=\"20\" height=\"20\"/>\n",
|
18 |
+
"<img src=\"https://emoji.discadia.com/emojis/00b5ebd1-84cf-41dd-a3bd-91c59f31bd70.PNG\" width=\"20\" height=\"20\"/>\n",
|
19 |
+
"<img src=\"https://i.pinimg.com/originals/7d/07/a2/7d07a255678962d30d8717dcf5dbd266.gif\" width=60% height=50%> \n",
|
20 |
+
"> ¡Hola! Si tienes algún problema al ejecutar este Notebook, no dudes en contactarme. Estoy abierto a sugerencias y modificaciones para crear una comunidad más libre. ¡Será un placer ayudarte! <img src=\"https://emoji.discadia.com/emojis/bdf70476-e7fb-41dd-9341-b28608e7f00d.GIF\" width=\"20\" height=\"20\"/>\n",
|
21 |
+
"<font color=\"#1AC851\"><br>\n",
|
22 |
+
"<small><font color=gray> v27-09-23A </small></font></font>\n"
|
23 |
+
]
|
24 |
+
},
|
25 |
+
{
|
26 |
+
"cell_type": "markdown",
|
27 |
+
"id": "2a86fcac-7907-4ab9-8287-d21b241e1b89",
|
28 |
+
"metadata": {},
|
29 |
+
"source": [
|
30 |
+
"### <img src=\"https://cdn3.emoji.gg/emojis/2868-announcement.gif\" width=\"25\" height=\"25\"> SESION VIVA EN ANDROID\n",
|
31 |
+
"#### Ejecute esta celda para mantener viva la pestaña en el dispositivo móvil (antes de ejecutar la celda de inicio)"
|
32 |
+
]
|
33 |
+
},
|
34 |
+
{
|
35 |
+
"cell_type": "code",
|
36 |
+
"execution_count": null,
|
37 |
+
"id": "8dc184cd-25e2-48b1-bdfb-d7b2ef6c0056",
|
38 |
+
"metadata": {
|
39 |
+
"tags": []
|
40 |
+
},
|
41 |
+
"outputs": [],
|
42 |
+
"source": [
|
43 |
+
"%%html\n",
|
44 |
+
"<b>Presione reproducir en el reproductor de música para mantener viva la pestaña antes de ejecutar la celda de inicio (usa solo 13 MB de datos)</b><br/>\n",
|
45 |
+
"<audio src=\"https://raw.githubusercontent.com/KoboldAI/KoboldAI-Client/main/colab/silence.m4a\" controls>"
|
46 |
+
]
|
47 |
+
},
|
48 |
+
{
|
49 |
+
"cell_type": "markdown",
|
50 |
+
"id": "dfd4fb94-9951-40ab-be3a-f9641e782b62",
|
51 |
+
"metadata": {},
|
52 |
+
"source": [
|
53 |
+
"### <img src=\"https://emoji.discadia.com/emojis/788f3a39-7ecf-4aee-bac0-d7c0dbbf02a3.gif\" width=\"25\" height=\"25\"> EMPEZAR AQUÍ \n",
|
54 |
+
"#### Si ya usaste este Notebook antes en la sesión actual, verifica que la carpeta `sdf_web` no se encuentre para poder ejecutar el código de abajo. Si ya está en tu sesión, puedes saltar a la celda de **Inicio Rápido**"
|
55 |
+
]
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"cell_type": "code",
|
59 |
+
"execution_count": null,
|
60 |
+
"id": "5c1d32b2-c01c-4e10-82a4-591cd87d9c05",
|
61 |
+
"metadata": {
|
62 |
+
"tags": []
|
63 |
+
},
|
64 |
+
"outputs": [],
|
65 |
+
"source": [
|
66 |
+
"import os\n",
|
67 |
+
"import time\n",
|
68 |
+
"import zipfile\n",
|
69 |
+
"import datetime\n",
|
70 |
+
"from IPython.display import HTML, clear_output, display\n",
|
71 |
+
"from IPython.utils import capture\n",
|
72 |
+
"\n",
|
73 |
+
"commandline_arguments = \" --ngrok 2VOvWtXsocjLqHIBaECsKoW3rgE_2qyjkyz66CJYLNHmZbAGt --skip-torch-cuda-test --enable-insecure-extension-access --opt-sdp-attention --listen --no-half-vae --disable-safe-unpickle --disable-nan-check --theme dark --no-hashing --gradio-queue\"\n",
|
74 |
+
"try:\n",
|
75 |
+
" start_colab\n",
|
76 |
+
"except:\n",
|
77 |
+
" start_colab = int(time.time())-5\n",
|
78 |
+
"clear_output()\n",
|
79 |
+
"inicio = time.time()\n",
|
80 |
+
"!pwd \n",
|
81 |
+
"\n",
|
82 |
+
"# Obtener la ruta actual\n",
|
83 |
+
"ruta_actual = os.getcwd()\n",
|
84 |
+
"\n",
|
85 |
+
"# CONFIG DIR (not recommended to change unless you know what you're doing)\n",
|
86 |
+
"models_dir = f\"/home/studio-lab-user/sdf_web/models/Stable-diffusion\"\n",
|
87 |
+
"source_dir = f\"/home/studio-lab-user/sdf_web\"\n",
|
88 |
+
"# ---------------------------------------------------------------------\n",
|
89 |
+
"\n",
|
90 |
+
"print(\"🚀 Descargando SD modificado por HunterDesigner... Por favor, no detengas este proceso bajo ninguna circunstancia...\\n\", end='')\n",
|
91 |
+
"if not os.path.exists(source_dir):\n",
|
92 |
+
" with capture.capture_output() as cap:\n",
|
93 |
+
" !conda install -c conda-forge libglib -y & conda update -n base conda -y\n",
|
94 |
+
" !pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio===2.0.2+cu118 -f https://download.pytorch.org/whl/cu118/torch_stable.html\n",
|
95 |
+
" !wget https://huggingface.co/datasets/HUNTERDEBASTADOR/models2/resolve/main/sdf_web.zip\n",
|
96 |
+
" with zipfile.ZipFile('sdf_web.zip', 'r') as zip_ref:\n",
|
97 |
+
" zip_ref.extractall('')\n",
|
98 |
+
" !pip install pytorch_lightning gradio omegaconf safetensors kornia tqdm mutagen ngrok ultralytics\n",
|
99 |
+
" !rm -r sdf_web.zip\n",
|
100 |
+
" del cap\n",
|
101 |
+
"\n",
|
102 |
+
" # Colab 🤝 Gradio (Colab timer integration for gradio) by NoCrypt\n",
|
103 |
+
" !echo -n {start_colab} > /home/studio-lab-user/sdf_web/static/colabTimer.txt\n",
|
104 |
+
"\n",
|
105 |
+
" \n",
|
106 |
+
"clear_output()"
|
107 |
+
]
|
108 |
+
},
|
109 |
+
{
|
110 |
+
"cell_type": "markdown",
|
111 |
+
"id": "656cb7e3",
|
112 |
+
"metadata": {},
|
113 |
+
"source": [
|
114 |
+
"### <img src=\"https://cdn3.emoji.gg/emojis/7555-cowroll.gif\" width=\"25\" height=\"25\"> **MODELOS REALISTAS**"
|
115 |
+
]
|
116 |
+
},
|
117 |
+
{
|
118 |
+
"cell_type": "code",
|
119 |
+
"execution_count": null,
|
120 |
+
"id": "0fe8c3a4",
|
121 |
+
"metadata": {},
|
122 |
+
"outputs": [],
|
123 |
+
"source": [
|
124 |
+
"#Model CARGAR MODELOS Y LORAS\n",
|
125 |
+
" print(\"📦 Descargando Modelos de HunterDesigner\\n\", end='')\n",
|
126 |
+
"!conda install -y -c conda-forge libglib ffmpeg aria2\n",
|
127 |
+
"!pip install mediapipe\n",
|
128 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/145885 -d /home/studio-lab-user/sdf_web/models/Stable-diffusion/ -o epiCPhotoGasm.safetensors\n",
|
129 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/126344 -d /home/studio-lab-user/sdf_web/models/Stable-diffusion/ -o OMEGACENTAURI.safetensors\n",
|
130 |
+
"!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/51913 -d /home/studio-lab-user/sdf_web/models/Stable-diffusion/ -o EdgeOfRealism.safetensors\n",
|
131 |
+
"#!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/130072 -d /home/studio-lab-user/sdf_web/models/Stable-diffusion/ -o RealisticVisionV5.safetensors\n",
|
132 |
+
"#!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/160495 -d /home/studio-lab-user/sdf_web/models/Stable-diffusion/ -o AnalogMadnessv6.safetensors\n",
|
133 |
+
"#!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/143906 -d /home/studio-lab-user/sdf_web/models/Stable-diffusion/ -o EpicRealism_v5.safetensors\n",
|
134 |
+
"\n",
|
135 |
+
"\n",
|
136 |
+
"##epiCPhotoGasm\n",
|
137 |
+
"#https://civitai.com/api/download/models/145885\n",
|
138 |
+
"##OMEGA CENTAURI\n",
|
139 |
+
"#https://civitai.com/api/download/models/126344\n",
|
140 |
+
"##Edge Of Realism fp16 baked VAE\n",
|
141 |
+
"#https://civitai.com/api/download/models/51913\n",
|
142 |
+
"##Realistic Vision V5.1\n",
|
143 |
+
"#https://civitai.com/api/download/models/130072\n",
|
144 |
+
"##Analog Madness v6\n",
|
145 |
+
"#https://civitai.com/api/download/models/160495\n",
|
146 |
+
"##EPICREALISM 5\n",
|
147 |
+
"#https://civitai.com/api/download/models/143906\n",
|
148 |
+
"##CyberRealistic V3\n",
|
149 |
+
"#https://civitai.com/api/download/models/138176\n",
|
150 |
+
"\n",
|
151 |
+
"#Lora\n",
|
152 |
+
"%cd /home/studio-lab-user/sdf_web/models/Lora\n",
|
153 |
+
"!curl -Lo /home/studio-lab-user/sdf_web/models/Lora/add_detail.safetensors https://huggingface.co/Kizi-Art/Lora-Clone/resolve/main/add_detail.safetensors\n",
|
154 |
+
"!wget --content-disposition https://civitai.com/api/download/models/128212\n",
|
155 |
+
"!wget --content-disposition https://civitai.com/api/download/models/128752\n",
|
156 |
+
"!wget --content-disposition https://civitai.com/api/download/models/179730\n",
|
157 |
+
"!wget --content-disposition https://civitai.com/api/download/models/87153\n",
|
158 |
+
"!wget --content-disposition https://civitai.com/api/download/models/171989\n",
|
159 |
+
"!wget --content-disposition https://civitai.com/api/download/models/46885\n",
|
160 |
+
"!wget --content-disposition https://civitai.com/api/download/models/129643\n",
|
161 |
+
"!wget --content-disposition https://civitai.com/api/download/models/109808\n",
|
162 |
+
"!wget --content-disposition https://civitai.com/api/download/models/62833\n",
|
163 |
+
"!wget --content-disposition https://civitai.com/api/download/models/95006\n",
|
164 |
+
"!curl -Lo /home/studio-lab-user/sdf_web/models/Lora/ https://huggingface.co/gemasai/FilmG2/resolve/main/FilmG2.safetensors\n",
|
165 |
+
"!wget --content-disposition https://civitai.com/api/download/models/16576\n",
|
166 |
+
"\n",
|
167 |
+
"#VAE\n",
|
168 |
+
"!curl -Lo /home/studio-lab-user/sdf_web/models/VAE/kl-f8-anime2.ckpt https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/vae/kl-f8-anime2.ckpt\n",
|
169 |
+
"!curl -Lo /home/studio-lab-user/sdf_web/models/VAE/vae-ft-mse-840000-ema-pruned.ckpt https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt\n",
|
170 |
+
"clear_output()\n",
|
171 |
+
"print(\"📦 Se Descargo exitosamente todos los modelos\\n\", end='')"
|
172 |
+
]
|
173 |
+
},
|
174 |
+
{
|
175 |
+
"cell_type": "markdown",
|
176 |
+
"id": "ad2befe3-2b7f-45c4-a1b6-24696fc56d47",
|
177 |
+
"metadata": {},
|
178 |
+
"source": [
|
179 |
+
"### <img src=\"https://cdn3.emoji.gg/emojis/7555-cowroll.gif\" width=\"25\" height=\"25\"> **Inicio Rápido**\n",
|
180 |
+
"#### Usa esta celda para iniciar Stable Diffusion si ya está descargado. Puedes iniciar aquí cuando se detiene la celda anterior."
|
181 |
+
]
|
182 |
+
},
|
183 |
+
{
|
184 |
+
"cell_type": "code",
|
185 |
+
"execution_count": null,
|
186 |
+
"id": "4fe92b97-071d-4da5-8fc2-b6e289625b33",
|
187 |
+
"metadata": {
|
188 |
+
"tags": []
|
189 |
+
},
|
190 |
+
"outputs": [],
|
191 |
+
"source": [
|
192 |
+
"import os\n",
|
193 |
+
"import time\n",
|
194 |
+
"import datetime\n",
|
195 |
+
"from IPython.display import clear_output\n",
|
196 |
+
"\n",
|
197 |
+
"try:\n",
|
198 |
+
" start_colab\n",
|
199 |
+
"except:\n",
|
200 |
+
" start_colab = int(time.time()) - 5\n",
|
201 |
+
"!pip install pytorch_lightning gradio omegaconf safetensors kornia tqdm mutagen ngrok ultralytics\n",
|
202 |
+
"clear_output()\n",
|
203 |
+
"\n",
|
204 |
+
"ruta_actual = os.getcwd()\n",
|
205 |
+
"\n",
|
206 |
+
"# CONFIG DIR (not recommended to change unless you know what you're doing)\n",
|
207 |
+
"models_dir = f\"/home/studio-lab-user/sdf_web/models/Stable-diffusion\"\n",
|
208 |
+
"source_dir = f\"/home/studio-lab-user/sdf_web/\"\n",
|
209 |
+
"\n",
|
210 |
+
"inicio = time.time()\n",
|
211 |
+
"!echo -n {start_colab} > /home/studio-lab-user/sdf_web/static/colabTimer.txt\n",
|
212 |
+
"\n",
|
213 |
+
"print(\"✅ Iniciando Stable Diffusion by HunterDesigner\\n\", end='')\n",
|
214 |
+
"%cd /home/studio-lab-user/sdf_web/\n",
|
215 |
+
"!python webui.py --ngrok 2VOvWtXsocjLqHIBaECsKoW3rgE_2qyjkyz66CJYLNHmZbAGt --skip-torch-cuda-test --enable-insecure-extension-access --opt-sdp-attention --listen --no-half-vae --disable-safe-unpickle --disable-nan-check --theme dark --no-hashing --gradio-queue"
|
216 |
+
]
|
217 |
+
},
|
218 |
+
{
|
219 |
+
"cell_type": "markdown",
|
220 |
+
"id": "9c02e956-5769-4be9-96e9-fea479706e91",
|
221 |
+
"metadata": {},
|
222 |
+
"source": [
|
223 |
+
"### Descarga todas las imagenes generadas"
|
224 |
+
]
|
225 |
+
},
|
226 |
+
{
|
227 |
+
"cell_type": "code",
|
228 |
+
"execution_count": null,
|
229 |
+
"id": "fdeece9b-7e0a-4c93-aec2-6d96b95cdc84",
|
230 |
+
"metadata": {
|
231 |
+
"tags": []
|
232 |
+
},
|
233 |
+
"outputs": [],
|
234 |
+
"source": [
|
235 |
+
"# Descargar y comprimir todas las salidas\n",
|
236 |
+
"import zipfile\n",
|
237 |
+
"import os\n",
|
238 |
+
"\n",
|
239 |
+
"def create_zip_archive(source_dir, output_path):\n",
|
240 |
+
" with zipfile.ZipFile(output_path, 'w', zipfile.ZIP_DEFLATED) as zipf:\n",
|
241 |
+
" for root, dirs, files in os.walk(source_dir):\n",
|
242 |
+
" for file in files:\n",
|
243 |
+
" file_path = os.path.join(root, file)\n",
|
244 |
+
" zipf.write(file_path, os.path.relpath(file_path, source_dir))\n",
|
245 |
+
"\n",
|
246 |
+
"# Especificar el directorio de origen y la ruta de salida\n",
|
247 |
+
"source_dir = '/home/studio-lab-user/sdf_web/outputs'\n",
|
248 |
+
"output_path = '/home/studio-lab-user/outputs.zip'\n",
|
249 |
+
"\n",
|
250 |
+
"# Crear el archivo ZIP\n",
|
251 |
+
"create_zip_archive(source_dir, output_path)"
|
252 |
+
]
|
253 |
+
},
|
254 |
+
{
|
255 |
+
"cell_type": "markdown",
|
256 |
+
"id": "364e78a6-1b16-4336-8439-c0eb0b94c4ed",
|
257 |
+
"metadata": {},
|
258 |
+
"source": [
|
259 |
+
"# <font color=\"red\"> Estas celdas solo son para el mantenimiento del Notebook </font> - \n",
|
260 |
+
"# NO sirven para ejecutar ninguna función relacionada con Stable Diffusion"
|
261 |
+
]
|
262 |
+
},
|
263 |
+
{
|
264 |
+
"cell_type": "markdown",
|
265 |
+
"id": "c12aa52e-fc8c-4480-826b-e9a9573bcee5",
|
266 |
+
"metadata": {},
|
267 |
+
"source": [
|
268 |
+
"### Compruebe el almacenamiento disponible (si el almacenamiento está lleno, puede causar problemas)"
|
269 |
+
]
|
270 |
+
},
|
271 |
+
{
|
272 |
+
"cell_type": "code",
|
273 |
+
"execution_count": null,
|
274 |
+
"id": "439692fe-f99d-4703-aa6d-27a8bcc8a775",
|
275 |
+
"metadata": {
|
276 |
+
"tags": []
|
277 |
+
},
|
278 |
+
"outputs": [],
|
279 |
+
"source": [
|
280 |
+
"!df -h | grep -E 'Avail|home'"
|
281 |
+
]
|
282 |
+
},
|
283 |
+
{
|
284 |
+
"cell_type": "markdown",
|
285 |
+
"id": "e2379128-f432-4226-a011-3a61005ddd08",
|
286 |
+
"metadata": {},
|
287 |
+
"source": [
|
288 |
+
"## Eliminar y vaciar la carpeta `OUTPUT`"
|
289 |
+
]
|
290 |
+
},
|
291 |
+
{
|
292 |
+
"cell_type": "code",
|
293 |
+
"execution_count": null,
|
294 |
+
"id": "b8a56c3a-f0af-4c87-bf83-c99942a3a3b0",
|
295 |
+
"metadata": {},
|
296 |
+
"outputs": [],
|
297 |
+
"source": [
|
298 |
+
"!rm -rf /home/studio-lab-user/sdf_web/outputs/*"
|
299 |
+
]
|
300 |
+
},
|
301 |
+
{
|
302 |
+
"cell_type": "markdown",
|
303 |
+
"id": "510f601a-173e-4806-b05f-15902c65e717",
|
304 |
+
"metadata": {},
|
305 |
+
"source": [
|
306 |
+
"## Eliminar y vaciar la carpeta `MODELS`"
|
307 |
+
]
|
308 |
+
},
|
309 |
+
{
|
310 |
+
"cell_type": "code",
|
311 |
+
"execution_count": null,
|
312 |
+
"id": "8ac13a1e-906a-4da8-b98b-0e300ab5b8b4",
|
313 |
+
"metadata": {},
|
314 |
+
"outputs": [],
|
315 |
+
"source": [
|
316 |
+
"!rm -rf /home/studio-lab-user/sdf_web/models/Stable-diffusion/*"
|
317 |
+
]
|
318 |
+
},
|
319 |
+
{
|
320 |
+
"cell_type": "markdown",
|
321 |
+
"id": "1d0a3313-0c65-44ef-b89e-459fa779e84b",
|
322 |
+
"metadata": {},
|
323 |
+
"source": [
|
324 |
+
"### COMIENCE A LIMPIAR TODO SOLO SI TIENE UN <font color=\"red\"> ERROR </font>"
|
325 |
+
]
|
326 |
+
},
|
327 |
+
{
|
328 |
+
"cell_type": "markdown",
|
329 |
+
"id": "a3996dac",
|
330 |
+
"metadata": {},
|
331 |
+
"source": [
|
332 |
+
"#### Compruebe el almacenamiento disponible (si el almacenamiento está lleno, puede causar problemas)"
|
333 |
+
]
|
334 |
+
},
|
335 |
+
{
|
336 |
+
"cell_type": "code",
|
337 |
+
"execution_count": null,
|
338 |
+
"id": "5ad6a08b-34a4-4a73-b618-38715a895bd2",
|
339 |
+
"metadata": {
|
340 |
+
"tags": []
|
341 |
+
},
|
342 |
+
"outputs": [],
|
343 |
+
"source": [
|
344 |
+
"!df -h | grep -E 'Avail|home'"
|
345 |
+
]
|
346 |
+
},
|
347 |
+
{
|
348 |
+
"cell_type": "markdown",
|
349 |
+
"id": "381279ee",
|
350 |
+
"metadata": {},
|
351 |
+
"source": [
|
352 |
+
"#### Lista todas las carpetas y tamaños"
|
353 |
+
]
|
354 |
+
},
|
355 |
+
{
|
356 |
+
"cell_type": "code",
|
357 |
+
"execution_count": null,
|
358 |
+
"id": "aaea3473-1ac6-40d8-98c2-a29386ca147e",
|
359 |
+
"metadata": {
|
360 |
+
"tags": []
|
361 |
+
},
|
362 |
+
"outputs": [],
|
363 |
+
"source": [
|
364 |
+
"!du -h --max-depth=1 /home/studio-lab-user/"
|
365 |
+
]
|
366 |
+
},
|
367 |
+
{
|
368 |
+
"cell_type": "markdown",
|
369 |
+
"id": "26239982",
|
370 |
+
"metadata": {},
|
371 |
+
"source": [
|
372 |
+
"#### Limpiar eliminar todo, caché y Stable Diffusion"
|
373 |
+
]
|
374 |
+
},
|
375 |
+
{
|
376 |
+
"cell_type": "code",
|
377 |
+
"execution_count": null,
|
378 |
+
"id": "ab02c781-46ea-4f07-8c4b-f329069d903b",
|
379 |
+
"metadata": {
|
380 |
+
"tags": []
|
381 |
+
},
|
382 |
+
"outputs": [],
|
383 |
+
"source": [
|
384 |
+
"!rm -r /home/studio-lab-user/sdf_web\n",
|
385 |
+
"!rm -r /home/studio-lab-user/.cache\n",
|
386 |
+
"!rm -r /home/studio-lab-user/.conda"
|
387 |
+
]
|
388 |
+
},
|
389 |
+
{
|
390 |
+
"cell_type": "markdown",
|
391 |
+
"id": "7b0f500d-0af2-457b-bc13-fb222f675832",
|
392 |
+
"metadata": {},
|
393 |
+
"source": [
|
394 |
+
"### Crear el `env` si fue eliminado"
|
395 |
+
]
|
396 |
+
},
|
397 |
+
{
|
398 |
+
"cell_type": "code",
|
399 |
+
"execution_count": null,
|
400 |
+
"id": "98a14c37-58e5-4ca6-9fe9-02f14ff707c3",
|
401 |
+
"metadata": {
|
402 |
+
"tags": []
|
403 |
+
},
|
404 |
+
"outputs": [],
|
405 |
+
"source": [
|
406 |
+
"!conda create --name default -y\n",
|
407 |
+
"!conda install -c conda-forge libglib -y"
|
408 |
+
]
|
409 |
+
},
|
410 |
+
{
|
411 |
+
"cell_type": "markdown",
|
412 |
+
"id": "49cb0194-771e-46ef-a274-bcd34fd55b74",
|
413 |
+
"metadata": {},
|
414 |
+
"source": [
|
415 |
+
"### Muestra la version actual de `Torch` y `Torchvision` con su version de `Cuda`"
|
416 |
+
]
|
417 |
+
},
|
418 |
+
{
|
419 |
+
"cell_type": "code",
|
420 |
+
"execution_count": null,
|
421 |
+
"id": "47d905dd-a987-459a-8d28-3d2294203541",
|
422 |
+
"metadata": {
|
423 |
+
"tags": []
|
424 |
+
},
|
425 |
+
"outputs": [],
|
426 |
+
"source": [
|
427 |
+
"import torch\n",
|
428 |
+
"import torchvision\n",
|
429 |
+
"print(torch.__version__)\n",
|
430 |
+
"print(torchvision.__version__)"
|
431 |
+
]
|
432 |
+
}
|
433 |
+
],
|
434 |
+
"metadata": {
|
435 |
+
"kernelspec": {
|
436 |
+
"display_name": "default:Python",
|
437 |
+
"language": "python",
|
438 |
+
"name": "conda-env-default-py"
|
439 |
+
},
|
440 |
+
"language_info": {
|
441 |
+
"codemirror_mode": {
|
442 |
+
"name": "ipython",
|
443 |
+
"version": 3
|
444 |
+
},
|
445 |
+
"file_extension": ".py",
|
446 |
+
"mimetype": "text/x-python",
|
447 |
+
"name": "python",
|
448 |
+
"nbconvert_exporter": "python",
|
449 |
+
"pygments_lexer": "ipython3",
|
450 |
+
"version": "3.9.16"
|
451 |
+
}
|
452 |
+
},
|
453 |
+
"nbformat": 4,
|
454 |
+
"nbformat_minor": 5
|
455 |
+
}
|