Blackeyes0u0 commited on
Commit Β·
b3ecc60
1
Parent(s): fadb2d1
hf space
Browse filesFiles changed (3)
- hf_space.ipynbAdded+148
- hf_space2.ipynbAdded+148
- test.ipynbDeleted
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148{ "cells": [ { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "68716bf0c6534512aa0e010ae73e1546", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='<center> <img\\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.svβ¦" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from huggingface_hub import notebook_login\n", " \n", "notebook_login()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "RepoUrl('https://huggingface.co/Soran/CLIP_LoRA_SimCSE', endpoint='https://huggingface.co', repo_type='model', repo_id='Soran/CLIP_LoRA_SimCSE')" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from huggingface_hub import create_repo\n", " \n", "# Repository μμ±\n", "REPO_NAME = 'CLIP_LoRA_SimCSE'\n", "create_repo('CLIP_LoRA_SimCSE')\n", "\n", "# , repo_type='model', repo_id='Soran/CLIP_LoRA_SimCSE')" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Cloning https://huggingface.co/Soran/CLIP_LoRA_SimCSE into local empty directory.\n" ] } ], "source": [ "from huggingface_hub import Repository\n", "\n", "repo = Repository('/Users/juniverse/Desktop/pointcloud/huggingface_space/model', clone_from='Soran/CLIP_LoRA_SimCSE')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!cp -r model/* /Users/juniverse/Desktop/pointcloud/huggingface_space/model" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "\n", "# repo.git_add()\n", "# repo.git_commit('Initial commit')\n", "# repo.git_push()\n", "\n" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "ename": "TypeError", "evalue": "upload_file() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb μ
6\u001b[0m line \u001b[0;36m4\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mhuggingface_hub\u001b[39;00m \u001b[39mimport\u001b[39;00m upload_file, delete_file\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m \u001b[39m# LOCAL_FILE_PATH = '/Users/juniverse/Downloads/CLIP_LoRA_CSE_15.pt'\u001b[39;00m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m \u001b[39m# νμΌμ μ§μ μ
λ‘λ\u001b[39;00m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m upload_file(\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m \u001b[39m'\u001b[39;49m\u001b[39m/Users/juniverse/Downloads/CLIP_LoRA_CSE_15.pt\u001b[39;49m\u001b[39m'\u001b[39;49m,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=5'>6</a>\u001b[0m path_in_repo\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39m./model\u001b[39;49m\u001b[39m'\u001b[39;49m,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=6'>7</a>\u001b[0m repo_id\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39mSoran/CLIP_LoRA_SimCSE\u001b[39;49m\u001b[39m'\u001b[39;49m,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=7'>8</a>\u001b[0m )\n", "File \u001b[0;32m~/opt/anaconda3/envs/veda/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:118\u001b[0m, in \u001b[0;36mvalidate_hf_hub_args.<locals>._inner_fn\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[39mif\u001b[39;00m check_use_auth_token:\n\u001b[1;32m 116\u001b[0m kwargs \u001b[39m=\u001b[39m smoothly_deprecate_use_auth_token(fn_name\u001b[39m=\u001b[39mfn\u001b[39m.\u001b[39m\u001b[39m__name__\u001b[39m, has_token\u001b[39m=\u001b[39mhas_token, kwargs\u001b[39m=\u001b[39mkwargs)\n\u001b[0;32m--> 118\u001b[0m \u001b[39mreturn\u001b[39;00m fn(\u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n", "File \u001b[0;32m~/opt/anaconda3/envs/veda/lib/python3.8/site-packages/huggingface_hub/hf_api.py:849\u001b[0m, in \u001b[0;36mfuture_compatible.<locals>._inner\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 846\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mrun_as_future(fn, \u001b[39mself\u001b[39m, \u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n\u001b[1;32m 848\u001b[0m \u001b[39m# Otherwise, call the function normally\u001b[39;00m\n\u001b[0;32m--> 849\u001b[0m \u001b[39mreturn\u001b[39;00m fn(\u001b[39mself\u001b[39;49m, \u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n", "\u001b[0;31mTypeError\u001b[0m: upload_file() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given" ] } ], "source": [ "from huggingface_hub import upload_file, delete_file\n", "# LOCAL_FILE_PATH = '/Users/juniverse/Downloads/CLIP_LoRA_CSE_15.pt'\n", "# νμΌμ μ§μ μ
λ‘λ\n", "upload_file(\n", " '/Users/juniverse/Downloads/CLIP_LoRA_CSE_15.pt',\n", " path_in_repo='./model',\n", " repo_id='Soran/CLIP_LoRA_SimCSE',\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "veda", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.17" } }, "nbformat": 4, "nbformat_minor": 2}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148{ "cells": [ { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "68716bf0c6534512aa0e010ae73e1546", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='<center> <img\\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.svβ¦" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from huggingface_hub import notebook_login\n", " \n", "notebook_login()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "RepoUrl('https://huggingface.co/Soran/CLIP_LoRA_SimCSE', endpoint='https://huggingface.co', repo_type='model', repo_id='Soran/CLIP_LoRA_SimCSE')" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from huggingface_hub import create_repo\n", " \n", "# Repository μμ±\n", "REPO_NAME = 'CLIP_LoRA_SimCSE'\n", "create_repo('CLIP_LoRA_SimCSE')\n", "\n", "# , repo_type='model', repo_id='Soran/CLIP_LoRA_SimCSE')" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Cloning https://huggingface.co/Soran/CLIP_LoRA_SimCSE into local empty directory.\n" ] } ], "source": [ "from huggingface_hub import Repository\n", "\n", "repo = Repository('/Users/juniverse/Desktop/pointcloud/huggingface_space/model', clone_from='Soran/CLIP_LoRA_SimCSE')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!cp -r model/* /Users/juniverse/Desktop/pointcloud/huggingface_space/model" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "\n", "# repo.git_add()\n", "# repo.git_commit('Initial commit')\n", "# repo.git_push()\n", "\n" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "ename": "TypeError", "evalue": "upload_file() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb μ
6\u001b[0m line \u001b[0;36m4\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mhuggingface_hub\u001b[39;00m \u001b[39mimport\u001b[39;00m upload_file, delete_file\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m \u001b[39m# LOCAL_FILE_PATH = '/Users/juniverse/Downloads/CLIP_LoRA_CSE_15.pt'\u001b[39;00m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m \u001b[39m# νμΌμ μ§μ μ
λ‘λ\u001b[39;00m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m upload_file(\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m \u001b[39m'\u001b[39;49m\u001b[39m/Users/juniverse/Downloads/CLIP_LoRA_CSE_15.pt\u001b[39;49m\u001b[39m'\u001b[39;49m,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=5'>6</a>\u001b[0m path_in_repo\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39m./model\u001b[39;49m\u001b[39m'\u001b[39;49m,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=6'>7</a>\u001b[0m repo_id\u001b[39m=\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39mSoran/CLIP_LoRA_SimCSE\u001b[39;49m\u001b[39m'\u001b[39;49m,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/juniverse/Desktop/pointcloud/huggingface_space/Custom_Youtube_Algorithm/test.ipynb#W5sZmlsZQ%3D%3D?line=7'>8</a>\u001b[0m )\n", "File \u001b[0;32m~/opt/anaconda3/envs/veda/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:118\u001b[0m, in \u001b[0;36mvalidate_hf_hub_args.<locals>._inner_fn\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[39mif\u001b[39;00m check_use_auth_token:\n\u001b[1;32m 116\u001b[0m kwargs \u001b[39m=\u001b[39m smoothly_deprecate_use_auth_token(fn_name\u001b[39m=\u001b[39mfn\u001b[39m.\u001b[39m\u001b[39m__name__\u001b[39m, has_token\u001b[39m=\u001b[39mhas_token, kwargs\u001b[39m=\u001b[39mkwargs)\n\u001b[0;32m--> 118\u001b[0m \u001b[39mreturn\u001b[39;00m fn(\u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n", "File \u001b[0;32m~/opt/anaconda3/envs/veda/lib/python3.8/site-packages/huggingface_hub/hf_api.py:849\u001b[0m, in \u001b[0;36mfuture_compatible.<locals>._inner\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 846\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mrun_as_future(fn, \u001b[39mself\u001b[39m, \u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n\u001b[1;32m 848\u001b[0m \u001b[39m# Otherwise, call the function normally\u001b[39;00m\n\u001b[0;32m--> 849\u001b[0m \u001b[39mreturn\u001b[39;00m fn(\u001b[39mself\u001b[39;49m, \u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n", "\u001b[0;31mTypeError\u001b[0m: upload_file() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given" ] } ], "source": [ "from huggingface_hub import upload_file, delete_file\n", "# LOCAL_FILE_PATH = '/Users/juniverse/Downloads/CLIP_LoRA_CSE_15.pt'\n", "# νμΌμ μ§μ μ
λ‘λ\n", "upload_file(\n", " '/Users/juniverse/Downloads/CLIP_LoRA_CSE_15.pt',\n", " path_in_repo='./model',\n", " repo_id='Soran/CLIP_LoRA_SimCSE',\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "veda", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.17" } }, "nbformat": 4, "nbformat_minor": 2}hf_space.ipynbAdded+148
hf_space2.ipynbAdded+148
test.ipynbDeleted