File size: 2,533 Bytes
3e1b5ff |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "1353934d",
"metadata": {},
"outputs": [],
"source": [
"from huggingface_hub import HfApi"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "21302874",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\lbourdois\\Anaconda3\\lib\\site-packages\\huggingface_hub\\utils\\_experimental.py:58: UserWarning: 'plan_multi_commits' is experimental and might be subject to breaking changes in the future. You can disable this warning by setting `HF_HUB_DISABLE_EXPERIMENTAL_WARNING=1` as environment variable.\n",
" warnings.warn(\n",
"C:\\Users\\lbourdois\\Anaconda3\\lib\\site-packages\\huggingface_hub\\utils\\_experimental.py:58: UserWarning: 'HfApi.create_commits_on_pr' is experimental and might be subject to breaking changes in the future. You can disable this warning by setting `HF_HUB_DISABLE_EXPERIMENTAL_WARNING=1` as environment variable.\n",
" warnings.warn(\n",
"C:\\Users\\lbourdois\\Anaconda3\\lib\\site-packages\\huggingface_hub\\utils\\_deprecation.py:131: FutureWarning: 'create_commits_on_pr' (from 'huggingface_hub.hf_api') is deprecated and will be removed from version '0.27'. This is an experimental feature. Please use `upload_large_folder` instead.\n",
" warnings.warn(warning_message, FutureWarning)\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6cea70add0b64ab1a71ca23dd868c6af",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Enfants.zip: 0%| | 0.00/21.4G [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"api = HfApi()\n",
"api.upload_folder(\n",
" folder_path=r\"C:\\Users\\lbourdois\\Downloads\\tata\",\n",
" repo_id=\"FrancophonIA/CEFC-ORFEO\",\n",
" repo_type=\"dataset\",\n",
" multi_commits=True\n",
")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|