Team Ai
Apppublic

MLVLab/Human_Object_Interaction

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
1likes
upload_checkpoint_hugginface.ipynb124 linesDownload Raw Back to root
1{2 "cells": [3  {4   "cell_type": "code",5   "execution_count": 2,6   "id": "a19d0964-4c83-4bc9-b59f-f04a57ca020f",7   "metadata": {},8   "outputs": [9    {10     "data": {11      "application/vnd.jupyter.widget-view+json": {12       "model_id": "5dba33c11d7a4f708b5d6a03869ccb30",13       "version_major": 2,14       "version_minor": 015      },16      "text/plain": [17       "VBox(children=(HTML(value='<center> <img\\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.sv…"18      ]19     },20     "metadata": {},21     "output_type": "display_data"22    }23   ],24   "source": [25    "from huggingface_hub import notebook_login\n",26    " \n",27    "notebook_login()"28   ]29  },30  {31   "cell_type": "code",32   "execution_count": 4,33   "id": "4b0ba848-4799-476d-b1d6-16a7cde1f4ad",34   "metadata": {},35   "outputs": [36    {37     "name": "stderr",38     "output_type": "stream",39     "text": [40      "Cloning https://huggingface.co/jhp/hoi into local empty directory.\n"41     ]42    }43   ],44   "source": [45    "from huggingface_hub import Repository\n",46    " \n",47    "repo = Repository('CPC_HOTR', clone_from='jhp/hoi')"48   ]49  },50  {51   "cell_type": "code",52   "execution_count": 9,53   "id": "5d092b5a-99b3-4a4c-9ef4-90724eb665ef",54   "metadata": {},55   "outputs": [56    {57     "data": {58      "application/vnd.jupyter.widget-view+json": {59       "model_id": "b51f83592a414a1ea646717c434e2a23",60       "version_major": 2,61       "version_minor": 062      },63      "text/plain": [64       "checkpoint.pth:   0%|          | 0.00/301M [00:00<?, ?B/s]"65      ]66     },67     "metadata": {},68     "output_type": "display_data"69    },70    {71     "data": {72      "text/plain": [73       "'https://huggingface.co/jhp/hoi/tree/main/./'"74      ]75     },76     "execution_count": 9,77     "metadata": {},78     "output_type": "execute_result"79    }80   ],81   "source": [82    "from huggingface_hub import HfApi\n",83    "api = HfApi()\n",84    "api.upload_folder(\n",85    "    folder_path=\"./checkpoints/\",\n",86    "    repo_id=\"jhp/hoi\",\n",87    "    path_in_repo=\"./\",\n",88    "    # allow_patterns=\"*.txt\", # Upload all local text files\n",89    "    # delete_patterns=\"*.txt\", # Delete all remote text files before\n",90    ")"91   ]92  },93  {94   "cell_type": "code",95   "execution_count": null,96   "id": "82eedf6b-21a2-4dad-bc7d-6f3631525ff2",97   "metadata": {},98   "outputs": [],99   "source": []100  }101 ],102 "metadata": {103  "kernelspec": {104   "display_name": "Python 3 (ipykernel)",105   "language": "python",106   "name": "python3"107  },108  "language_info": {109   "codemirror_mode": {110    "name": "ipython",111    "version": 3112   },113   "file_extension": ".py",114   "mimetype": "text/x-python",115   "name": "python",116   "nbconvert_exporter": "python",117   "pygments_lexer": "ipython3",118   "version": "3.9.17"119  }120 },121 "nbformat": 4,122 "nbformat_minor": 5123}124