{ "cells": [ { "cell_type": "code", "execution_count": 28, "id": "9e9f1a9c-62e7-42c1-aadc-83fa2a02e3e0", "metadata": {}, "outputs": [], "source": [ "import os\n", "import shutil\n", "path = \"/mnt/data1/archives/hola/rnd-autosupervision/\"\n", "dir = [\"nabirds\"]" ] }, { "cell_type": "code", "execution_count": 6, "id": "165edf87-d8b6-492f-83b9-329ac5b704e4", "metadata": {}, "outputs": [], "source": [ "sub_dir = os.listdir(path + \"imagenette2\")" ] }, { "cell_type": "code", "execution_count": 5, "id": "78ee288e-19e4-4d62-84fe-69953afba2ab", "metadata": {}, "outputs": [], "source": [ "import subprocess\n" ] }, { "cell_type": "code", "execution_count": null, "id": "818be5a1-873d-4a41-8757-85696143bfce", "metadata": {}, "outputs": [], "source": [ "[os.mkdir(dir[i] + sub_dir[j] ) for i in ]" ] }, { "cell_type": "code", "execution_count": 25, "id": "e3049cd3-d334-415a-8946-219b97916e43", "metadata": {}, "outputs": [], "source": [ "from subprocess import call\n", "\n", "def cp_dir(source, target):\n", " call(['cp', '-a', source, target]) # Linux" ] }, { "cell_type": "code", "execution_count": 29, "id": "3ccfa582-910d-4d67-b57d-5f540b96434c", "metadata": {}, "outputs": [], "source": [ "from distutils.dir_util import copy_tree\n", "for d in dir:\n", " d_update = d\n", " if d == \"nabirds\":\n", " d_update = \"nabirds-400\"\n", " for sub in sub_dir:\n", " if sub!=\"log\":\n", " source_path = path + d_update + \"/\" + sub + \"/checkpoints\"\n", " to_directory = d + \"/\" + sub\n", " copy_tree(source_path, to_directory)\n", " # print(d + \"/\" + sub)\n", " # os.makedirs(\"./\" + d + \"/\" + sub)" ] }, { "cell_type": "code", "execution_count": 31, "id": "d6f8f2a8-f944-4870-8e61-b4e88d8a2444", "metadata": {}, "outputs": [], "source": [ "from huggingface_hub import HfApi\n", "api = HfApi()" ] }, { "cell_type": "code", "execution_count": null, "id": "9a0fa3ca-2c6e-43d8-8f13-3516b2ebfab6", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "42cf78263b094d4d8bb60f5bf8a00232", "version_major": 2, "version_minor": 0 }, "text/plain": [ "epoch=199-step=7200-v4.ckpt: 0%| | 0.00/184M [00:00