Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Pretrained Models များကို မျှဝေခြင်း","local":"sharing-pretrained-models","sections":[{"title":"push_to_hub API ကို အသုံးပြုခြင်း","local":"using-the-pushtohub-api","sections":[],"depth":2},{"title":"huggingface_hub Python library ကို အသုံးပြုခြင်း","local":"using-the-huggingfacehub-python-library","sections":[],"depth":2},{"title":"Web Interface ကို အသုံးပြုခြင်း","local":"using-the-web-interface","sections":[],"depth":2},{"title":"Model Files များကို Upload လုပ်ခြင်း","local":"uploading-the-model-files","sections":[{"title":"upload_file ချဉ်းကပ်မှု","local":"the-uploadfile-approach","sections":[],"depth":3},{"title":"Repository Class","local":"the-repository-class","sections":[],"depth":3},{"title":"Git-based ချဉ်းကပ်မှု","local":"the-git-based-approach","sections":[],"depth":3}],"depth":2},{"title":"ဝေါဟာရ ရှင်းလင်းချက် (Glossary)","local":"ဝဟရ-ရငလငခက-glossary","sections":[],"depth":2}],"depth":1}"> | |
| <link href="/docs/course/pr_1114/my/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/entry/start.14794ee9.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/scheduler.893fe8c9.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/singletons.10fda3ce.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/index.bce52c8a.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/paths.89c82153.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/entry/app.a133f5c6.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/preload-helper.b1a719fd.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/index.b1df2166.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/nodes/0.510afdc1.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/each.e59479a4.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/nodes/32.d3664306.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/Tip.385bb05f.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.762ed9cc.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/Youtube.ec5d7916.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/CodeBlock.6cef0479.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/CourseFloatingBanner.c1c08878.js"> | |
| <link rel="modulepreload" href="/docs/course/pr_1114/my/_app/immutable/chunks/FrameworkSwitchCourse.4480e339.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{"title":"Pretrained Models များကို မျှဝေခြင်း","local":"sharing-pretrained-models","sections":[{"title":"push_to_hub API ကို အသုံးပြုခြင်း","local":"using-the-pushtohub-api","sections":[],"depth":2},{"title":"huggingface_hub Python library ကို အသုံးပြုခြင်း","local":"using-the-huggingfacehub-python-library","sections":[],"depth":2},{"title":"Web Interface ကို အသုံးပြုခြင်း","local":"using-the-web-interface","sections":[],"depth":2},{"title":"Model Files များကို Upload လုပ်ခြင်း","local":"uploading-the-model-files","sections":[{"title":"upload_file ချဉ်းကပ်မှု","local":"the-uploadfile-approach","sections":[],"depth":3},{"title":"Repository Class","local":"the-repository-class","sections":[],"depth":3},{"title":"Git-based ချဉ်းကပ်မှု","local":"the-git-based-approach","sections":[],"depth":3}],"depth":2},{"title":"ဝေါဟာရ ရှင်းလင်းချက် (Glossary)","local":"ဝဟရ-ရငလငခက-glossary","sections":[],"depth":2}],"depth":1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <div class="bg-white leading-none border border-gray-100 rounded-lg flex p-0.5 w-56 text-sm mb-4"><a class="flex justify-center flex-1 py-1.5 px-2.5 focus:outline-none !no-underline rounded-l bg-red-50 dark:bg-transparent text-red-600" href="?fw=pt"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><defs><clipPath id="a"><rect x="3.05" y="0.5" width="25.73" height="31" fill="none"></rect></clipPath></defs><g clip-path="url(#a)"><path d="M24.94,9.51a12.81,12.81,0,0,1,0,18.16,12.68,12.68,0,0,1-18,0,12.81,12.81,0,0,1,0-18.16l9-9V5l-.84.83-6,6a9.58,9.58,0,1,0,13.55,0ZM20.44,9a1.68,1.68,0,1,1,1.67-1.67A1.68,1.68,0,0,1,20.44,9Z" fill="#ee4c2c"></path></g></svg> Pytorch </a><a class="flex justify-center flex-1 py-1.5 px-2.5 focus:outline-none !no-underline rounded-r text-gray-500 filter grayscale" href="?fw=tf"><svg class="mr-1.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width="0.94em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 274"><path d="M145.726 42.065v42.07l72.861 42.07v-42.07l-72.86-42.07zM0 84.135v42.07l36.43 21.03V105.17L0 84.135zm109.291 21.035l-36.43 21.034v126.2l36.43 21.035v-84.135l36.435 21.035v-42.07l-36.435-21.034V105.17z" fill="#E55B2D"></path><path d="M145.726 42.065L36.43 105.17v42.065l72.861-42.065v42.065l36.435-21.03v-84.14zM255.022 63.1l-36.435 21.035v42.07l36.435-21.035V63.1zm-72.865 84.135l-36.43 21.035v42.07l36.43-21.036v-42.07zm-36.43 63.104l-36.436-21.035v84.135l36.435-21.035V210.34z" fill="#ED8E24"></path><path d="M145.726 0L0 84.135l36.43 21.035l109.296-63.105l72.861 42.07L255.022 63.1L145.726 0zm0 126.204l-36.435 21.03l36.435 21.036l36.43-21.035l-36.43-21.03z" fill="#F8BF3C"></path></svg> TensorFlow </a></div> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 max-sm:gap-0.5 h-6 max-sm:h-5 px-2 max-sm:px-1.5 text-[11px] max-sm:text-[9px] font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0"><svg class="w-3 h-3 max-sm:w-2.5 max-sm:h-2.5" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-6 max-sm:h-5 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible w-3 h-3 max-sm:w-2.5 max-sm:h-2.5 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="sharing-pretrained-models" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#sharing-pretrained-models"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Pretrained Models များကို မျှဝေခြင်း</span></h1> <div class="flex space-x-1 absolute z-10 right-0 top-0" style=""><a href="https://discuss.huggingface.co/t/chapter-4-questions" target="_blank"><img alt="Ask a Question" class="!m-0" src="https://img.shields.io/badge/Ask%20a%20question-ffcb4c.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgLTEgMTA0IDEwNiI+PGRlZnM+PHN0eWxlPi5jbHMtMXtmaWxsOiMyMzFmMjA7fS5jbHMtMntmaWxsOiNmZmY5YWU7fS5jbHMtM3tmaWxsOiMwMGFlZWY7fS5jbHMtNHtmaWxsOiMwMGE5NGY7fS5jbHMtNXtmaWxsOiNmMTVkMjI7fS5jbHMtNntmaWxsOiNlMzFiMjM7fTwvc3R5bGU+PC9kZWZzPjx0aXRsZT5EaXNjb3Vyc2VfbG9nbzwvdGl0bGU+PGcgaWQ9IkxheWVyXzIiPjxnIGlkPSJMYXllcl8zIj48cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik01MS44NywwQzIzLjcxLDAsMCwyMi44MywwLDUxYzAsLjkxLDAsNTIuODEsMCw1Mi44MWw1MS44Ni0uMDVjMjguMTYsMCw1MS0yMy43MSw1MS01MS44N1M4MCwwLDUxLjg3LDBaIi8+PHBhdGggY2xhc3M9ImNscy0yIiBkPSJNNTIuMzcsMTkuNzRBMzEuNjIsMzEuNjIsMCwwLDAsMjQuNTgsNjYuNDFsLTUuNzIsMTguNEwzOS40LDgwLjE3YTMxLjYxLDMxLjYxLDAsMSwwLDEzLTYwLjQzWiIvPjxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTc3LjQ1LDMyLjEyYTMxLjYsMzEuNiwwLDAsMS0zOC4wNSw0OEwxOC44Niw4NC44MmwyMC45MS0yLjQ3QTMxLjYsMzEuNiwwLDAsMCw3Ny40NSwzMi4xMloiLz48cGF0aCBjbGFzcz0iY2xzLTQiIGQ9Ik03MS42MywyNi4yOUEzMS42LDMxLjYsMCwwLDEsMzguOCw3OEwxOC44Niw4NC44MiwzOS40LDgwLjE3QTMxLjYsMzEuNiwwLDAsMCw3MS42MywyNi4yOVoiLz48cGF0aCBjbGFzcz0iY2xzLTUiIGQ9Ik0yNi40Nyw2Ny4xMWEzMS42MSwzMS42MSwwLDAsMSw1MS0zNUEzMS42MSwzMS42MSwwLDAsMCwyNC41OCw2Ni40MWwtNS43MiwxOC40WiIvPjxwYXRoIGNsYXNzPSJjbHMtNiIgZD0iTTI0LjU4LDY2LjQxQTMxLjYxLDMxLjYxLDAsMCwxLDcxLjYzLDI2LjI5YTMxLjYxLDMxLjYxLDAsMCwwLTQ5LDM5LjYzbC0zLjc2LDE4LjlaIi8+PC9nPjwvZz48L3N2Zz4="></a> <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter4/section3_pt.ipynb" target="_blank"><img alt="Open In Colab" class="!m-0" src="https://colab.research.google.com/assets/colab-badge.svg"></a> <a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter4/section3_pt.ipynb" target="_blank"><img alt="Open In Studio Lab" class="!m-0" src="https://studiolab.sagemaker.aws/studiolab.svg"></a></div> <p data-svelte-h="svelte-1n7uk7d">အောက်ပါအဆင့်တွေမှာ pretrained models တွေကို 🤗 Hub ကို အလွယ်ဆုံးနည်းလမ်းတွေနဲ့ ဘယ်လိုမျှဝေရမလဲဆိုတာ ကျွန်တော်တို့ လေ့လာသွားပါမယ်။ models တွေကို Hub မှာ တိုက်ရိုက်မျှဝေပြီး update လုပ်တာကို ရိုးရှင်းစေတဲ့ ကိရိယာတွေနဲ့ utility တွေ ရရှိနိုင်ပြီး၊ အောက်မှာ ကျွန်တော်တို့ လေ့လာသွားပါမယ်။</p> <iframe class="w-full xl:w-4/6 h-80" src="https://www.youtube-nocookie.com/embed/9yY3RB_GSPM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> <p data-svelte-h="svelte-18gebuw">models တွေကို train လုပ်တဲ့ သုံးစွဲသူအားလုံးကို community နဲ့ မျှဝေခြင်းဖြင့် ပံ့ပိုးကူညီဖို့ ကျွန်တော်တို့ တိုက်တွန်းပါတယ်။ အလွန်တိကျတဲ့ datasets တွေပေါ်မှာ train လုပ်ထားတဲ့ models တွေကိုတောင် မျှဝေခြင်းက တခြားသူတွေကို အချိန်နဲ့ compute resources တွေ သက်သာစေပြီး အသုံးဝင်တဲ့ trained artifacts တွေကို ရယူအသုံးပြုနိုင်စေပါလိမ့်မယ်။ ဒါ့အပြင်၊ တခြားသူတွေ လုပ်ခဲ့တဲ့ အလုပ်တွေကနေလည်း သင်အကျိုးခံစားနိုင်ပါတယ်။</p> <p data-svelte-h="svelte-1wet0sy">model repositories အသစ်တွေ ဖန်တီးဖို့ နည်းလမ်းသုံးသွယ် ရှိပါတယ်။</p> <ul data-svelte-h="svelte-l4lzuo"><li><code>push_to_hub</code> API ကို အသုံးပြုခြင်း</li> <li><code>huggingface_hub</code> Python library ကို အသုံးပြုခြင်း</li> <li>web interface ကို အသုံးပြုခြင်း</li></ul> <p data-svelte-h="svelte-17jzeev">repository တစ်ခု ဖန်တီးပြီးတာနဲ့ git နဲ့ git-lfs ကို အသုံးပြုပြီး files တွေ upload လုပ်နိုင်ပါတယ်။ အောက်ပါအပိုင်းတွေမှာ model repositories တွေ ဖန်တီးပုံနဲ့ files တွေ upload လုပ်ပုံကို ကျွန်တော်တို့ ပြသသွားပါမယ်။</p> <h2 class="relative group"><a id="using-the-pushtohub-api" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#using-the-pushtohub-api"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>push_to_hub API ကို အသုံးပြုခြင်း</span></h2> <iframe class="w-full xl:w-4/6 h-80" src="https://www.youtube-nocookie.com/embed/Zh0FfmVrKX0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> <p data-svelte-h="svelte-ja5cxe">Hub ကို files တွေ upload လုပ်ဖို့ အလွယ်ကူဆုံးနည်းလမ်းက <code>push_to_hub</code> API ကို အကျိုးရှိရှိ အသုံးပြုခြင်းပါပဲ။</p> <p data-svelte-h="svelte-dpv113">ဆက်မသွားခင်မှာ၊ authentication token တစ်ခုကို generate လုပ်ဖို့ လိုအပ်ပါလိမ့်မယ်။ ဒါမှ <code>huggingface_hub</code> API က သင်ဘယ်သူလဲဆိုတာနဲ့ ဘယ် namespaces တွေမှာ write access ရှိတယ်ဆိုတာ သိမှာပါ။ သင် <code>transformers</code> install လုပ်ထားတဲ့ environment တစ်ခုမှာ ရှိနေကြောင်း သေချာပါစေ (<a href="/course/chapter0">Setup</a> မှာ ကြည့်ပါ)။ သင် notebook ထဲမှာဆိုရင် login လုပ်ဖို့ အောက်ပါ function ကို အသုံးပြုနိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login | |
| notebook_login()<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-m945tt">terminal မှာဆိုရင်တော့ အောက်ပါအတိုင်း run နိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->huggingface-cli login<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1rcx7j8">နည်းလမ်းနှစ်ခုလုံးမှာ သင့်ရဲ့ username နဲ့ password ကို ထည့်သွင်းဖို့ တောင်းဆိုပါလိမ့်မယ်။ ဒါတွေက Hub ကို log in လုပ်ဖို့ သင်အသုံးပြုတဲ့ အတူတူပါပဲ။ သင်မှာ Hub profile မရှိသေးဘူးဆိုရင် <a href="https://huggingface.co/join" rel="nofollow">ဒီနေရာ</a> မှာ တစ်ခု ဖန်တီးသင့်ပါတယ်။</p> <p data-svelte-h="svelte-tf6d8d">ကောင်းပြီ! အခု သင့်ရဲ့ authentication token ကို cache folder ထဲမှာ သိမ်းဆည်းထားပါပြီ။ repository အချို့ကို ဖန်တီးကြရအောင်!</p> <p data-svelte-h="svelte-eiqyww">သင် <code>Trainer</code> API ကို အသုံးပြုပြီး model တစ်ခုကို train လုပ်ခဲ့တယ်ဆိုရင်၊ ဒါကို Hub ကို upload လုပ်ဖို့ အလွယ်ကူဆုံးနည်းလမ်းက သင့် <code>TrainingArguments</code> ကို သတ်မှတ်တဲ့အခါ <code>push_to_hub=True</code> လို့ သတ်မှတ်ပေးဖို့ပါပဲ။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments | |
| training_args = TrainingArguments( | |
| <span class="hljs-string">"bert-finetuned-mrpc"</span>, save_strategy=<span class="hljs-string">"epoch"</span>, push_to_hub=<span class="hljs-literal">True</span> | |
| )<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1pofn4g">သင် <code>trainer.train()</code> ကို ခေါ်တဲ့အခါ၊ <code>Trainer</code> က သင့် model ကို သိမ်းဆည်းတိုင်း (ဒီနေရာမှာတော့ epoch တိုင်း) သင့် namespace ထဲက repository တစ်ခုမှာ Hub ကို upload လုပ်ပါလိမ့်မယ်။ အဲဒီ repository ကို သင်ရွေးချယ်ခဲ့တဲ့ output directory (ဒီနေရာမှာ <code>bert-finetuned-mrpc</code>) အတိုင်း နာမည်ပေးထားပါလိမ့်မယ်။ ဒါပေမယ့် <code>hub_model_id = "a_different_name"</code> နဲ့ မတူညီတဲ့ နာမည်တစ်ခုကို ရွေးချယ်နိုင်ပါတယ်။</p> <p data-svelte-h="svelte-uaipb0">သင်အဖွဲ့ဝင်ဖြစ်တဲ့ organization တစ်ခုကို သင့် model ကို upload လုပ်ဖို့အတွက် <code>hub_model_id = "my_organization/my_repo_name"</code> နဲ့ ထည့်ပေးလိုက်ရုံပါပဲ။</p> <p data-svelte-h="svelte-3jh411">သင့် training ပြီးဆုံးသွားတာနဲ့၊ သင့် model ရဲ့ နောက်ဆုံး version ကို upload လုပ်ဖို့ နောက်ဆုံး <code>trainer.push_to_hub()</code> ကို လုပ်သင့်ပါတယ်။ ဒါက အသုံးပြုခဲ့တဲ့ hyperparameters တွေနဲ့ evaluation results တွေကို ဖော်ပြတဲ့ model card တစ်ခုကိုလည်း relevant metadata တွေအားလုံးနဲ့အတူ generate လုပ်ပေးပါလိမ့်မယ်။ ဒီလို model card တစ်ခုမှာ သင်တွေ့ရမယ့် content ဥပမာတစ်ခုကတော့ ဒီမှာပါ…</p> <div class="flex justify-center" data-svelte-h="svelte-1lhrimn"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/model_card.png" alt="An example of an auto-generated model card." width="100%"></div> <p data-svelte-h="svelte-129afpo">အနိမ့်အဆင့်မှာဆိုရင် Model Hub ကို model တွေ၊ tokenizers တွေနဲ့ configuration objects တွေမှာရှိတဲ့ ၎င်းတို့ရဲ့ <code>push_to_hub()</code> method ကနေ တိုက်ရိုက် ဝင်ရောက်ကြည့်ရှုနိုင်ပါတယ်။ ဒီ method က repository ဖန်တီးတာနဲ့ model နဲ့ tokenizer files တွေကို repository ကို တိုက်ရိုက် push လုပ်တာ နှစ်ခုလုံးကို လုပ်ဆောင်ပေးပါတယ်။ အောက်မှာ ကျွန်တော်တို့တွေ့ရမယ့် API နဲ့ မတူဘဲ၊ manual handling လုံးဝမလိုအပ်ပါဘူး။</p> <p data-svelte-h="svelte-uhkqse">ဒါက ဘယ်လိုအလုပ်လုပ်တယ်ဆိုတာ သိဖို့အတွက်၊ ပထမဆုံး model တစ်ခုနဲ့ tokenizer တစ်ခုကို initialize လုပ်ကြရအောင်…</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForMaskedLM, AutoTokenizer | |
| checkpoint = <span class="hljs-string">"camembert-base"</span> | |
| model = AutoModelForMaskedLM.from_pretrained(checkpoint) | |
| tokenizer = AutoTokenizer.from_pretrained(checkpoint)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-v0pube">ဒီ models တွေနဲ့ သင်ဘာမဆိုလုပ်ဆောင်နိုင်ပါတယ်၊ tokenizer ကို tokens တွေထည့်တာ၊ model ကို train လုပ်တာ၊ fine-tune လုပ်တာ။ ရရှိလာတဲ့ model, weights, နဲ့ tokenizer တွေနဲ့ သင်ကျေနပ်သွားတာနဲ့၊ <code>model</code> object မှာ တိုက်ရိုက်ရရှိနိုင်တဲ့ <code>push_to_hub()</code> method ကို အကျိုးရှိရှိ အသုံးပြုနိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->model.push_to_hub(<span class="hljs-string">"dummy-model"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-z4b0dr">ဒါက သင့် profile မှာ <code>dummy-model</code> repository အသစ်တစ်ခုကို ဖန်တီးပေးပြီး သင့် model files တွေနဲ့ ဖြည့်ပေးပါလိမ့်မယ်။ | |
| tokenizer နဲ့လည်း အတူတူလုပ်ပါ၊ ဒါမှ files အားလုံးဟာ ဒီ repository မှာ ရရှိနိုင်ပါလိမ့်မယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->tokenizer.push_to_hub(<span class="hljs-string">"dummy-model"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-gxkhe1">သင် organization တစ်ခုမှာ အဖွဲ့ဝင်ဆိုရင်၊ အဲဒီ organization ရဲ့ namespace ကို upload လုပ်ဖို့ <code>organization</code> argument ကို သတ်မှတ်ပေးလိုက်ရုံပါပဲ။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->tokenizer.push_to_hub(<span class="hljs-string">"dummy-model"</span>, organization=<span class="hljs-string">"huggingface"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-r9cduf">သင် သီးခြား Hugging Face token တစ်ခုကို အသုံးပြုချင်တယ်ဆိုရင်၊ <code>push_to_hub()</code> method ကိုလည်း သတ်မှတ်ပေးနိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->tokenizer.push_to_hub(<span class="hljs-string">"dummy-model"</span>, organization=<span class="hljs-string">"huggingface"</span>, use_auth_token=<span class="hljs-string">"<TOKEN>"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-5tq7q9">အခု သင်အခုမှ upload လုပ်ထားတဲ့ model ကို ရှာဖို့ Model Hub: <em><a href="https://huggingface.co/user-or-organization/dummy-model" rel="nofollow">https://huggingface.co/user-or-organization/dummy-model</a></em> ကို သွားပါ။</p> <p data-svelte-h="svelte-c2jhlk">“Files and versions” tab ကို နှိပ်ပြီး အောက်ပါ screenshot မှာ မြင်ရတဲ့ files တွေကို သင်တွေ့ရပါလိမ့်မယ်။</p> <div class="flex justify-center" data-svelte-h="svelte-19u1vyv"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/push_to_hub_dummy_model.png" alt="Dummy model containing both the tokenizer and model files." width="80%"></div> <blockquote class="tip"><p data-svelte-h="svelte-11awxa">✏️ <strong>စမ်းသပ်ကြည့်ပါ!</strong> <code>bert-base-cased</code> checkpoint နဲ့ ဆက်စပ်နေတဲ့ model နဲ့ tokenizer ကို ယူပြီး <code>push_to_hub()</code> method ကို အသုံးပြုပြီး သင့် namespace ထဲက repo တစ်ခုကို upload လုပ်ပါ။ repo ဟာ သင့် page မှာ မှန်ကန်စွာ ပေါ်လာခြင်းရှိမရှိ နှစ်ကြိမ်စစ်ဆေးပြီးမှ ဖျက်ပစ်ပါ။</p></blockquote> <p data-svelte-h="svelte-u9m6p4">သင်တွေ့ခဲ့ရတဲ့အတိုင်း၊ <code>push_to_hub()</code> method က arguments အများအပြားကို လက်ခံပါတယ်။ ဒါကြောင့် သီးခြား repository ဒါမှမဟုတ် organization namespace ကို upload လုပ်တာ၊ ဒါမှမဟုတ် မတူညီတဲ့ API token တစ်ခုကို အသုံးပြုတာတွေ လုပ်ဆောင်နိုင်ပါတယ်။ ဖြစ်နိုင်ခြေရှိတဲ့ အရာတွေအကြောင်း သိရှိဖို့ <a href="https://huggingface.co/transformers/model_sharing" rel="nofollow">🤗 Transformers documentation</a> မှာ တိုက်ရိုက်ရရှိနိုင်တဲ့ method specification ကို ကြည့်ရှုဖို့ ကျွန်တော်တို့ အကြံပြုပါတယ်။</p> <p data-svelte-h="svelte-1e6z1y5"><code>push_to_hub()</code> method က <a href="https://github.com/huggingface/huggingface_hub" rel="nofollow"><code>huggingface_hub</code></a> Python package ကို အထောက်အပံ့ပေးထားပါတယ်။ ဒီ package က Hugging Face Hub ကို တိုက်ရိုက် API ကို ပေးပါတယ်။ ဒါကို 🤗 Transformers နဲ့ အခြား machine learning libraries များစွာ (ဥပမာ- <a href="https://github.com/allenai/allennlp" rel="nofollow"><code>allenlp</code></a> လိုမျိုး) ထဲမှာ ပေါင်းစပ်ထားပါတယ်။ ဒီအခန်းမှာ 🤗 Transformers integration ကို အာရုံစိုက်ပေမယ့်၊ ဒါကို သင်ရဲ့ကိုယ်ပိုင် code ဒါမှမဟုတ် library ထဲကို ပေါင်းစပ်တာက ရိုးရှင်းပါတယ်။</p> <p data-svelte-h="svelte-98ajwj">သင်အခုမှ ဖန်တီးခဲ့တဲ့ repository ကို files တွေ ဘယ်လို upload လုပ်ရမယ်ဆိုတာ သိဖို့ နောက်ဆုံးအပိုင်းကို သွားလိုက်ပါ။</p> <h2 class="relative group"><a id="using-the-huggingfacehub-python-library" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#using-the-huggingfacehub-python-library"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>huggingface_hub Python library ကို အသုံးပြုခြင်း</span></h2> <p data-svelte-h="svelte-1r1ipux"><code>huggingface_hub</code> Python library ဟာ model တွေနဲ့ datasets hub တွေအတွက် ကိရိယာအစုံအလင်ကို ပေးတဲ့ package တစ်ခု ဖြစ်ပါတယ်။ Hub ပေါ်က repositories တွေအကြောင်း အချက်အလက်ရယူတာ၊ ၎င်းတို့ကို စီမံခန့်ခွဲတာလိုမျိုး အသုံးများတဲ့ လုပ်ငန်းတွေအတွက် ရိုးရှင်းတဲ့ methods တွေနဲ့ classes တွေကို ပေးထားပါတယ်။ repositories တွေရဲ့ content ကို စီမံခန့်ခွဲဖို့နဲ့ သင်ရဲ့ project တွေနဲ့ libraries တွေထဲမှာ Hub ကို ပေါင်းစပ်ဖို့အတွက် git ရဲ့ အပေါ်မှာ အလုပ်လုပ်တဲ့ ရိုးရှင်းတဲ့ APIs တွေကို ပေးထားပါတယ်။</p> <p data-svelte-h="svelte-99aou6"><code>push_to_hub</code> API ကို အသုံးပြုတာနဲ့ ဆင်တူစွာ၊ ဒါက သင့် API token ကို သင့် cache မှာ သိမ်းဆည်းထားဖို့ လိုအပ်ပါလိမ့်မယ်။ ဒါကို လုပ်ဆောင်ဖို့အတွက်၊ ယခင်အပိုင်းမှာ ဖော်ပြခဲ့တဲ့အတိုင်း CLI ကနေ <code>login</code> command ကို အသုံးပြုဖို့ လိုအပ်ပါလိမ့်မယ် (Google Colab မှာ run နေတယ်ဆိုရင် ဒီ commands တွေကို <code>!</code> character နဲ့ အရှေ့ကနေ ထည့်သွင်းဖို့ သေချာပါစေ)။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->huggingface-cli login<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-40ekbx"><code>huggingface_hub</code> package က ကျွန်တော်တို့ရဲ့ ရည်ရွယ်ချက်အတွက် အသုံးဝင်တဲ့ methods တွေနဲ့ classes အများအပြားကို ပေးထားပါတယ်။ ပထမဆုံး၊ repository ဖန်တီးခြင်း၊ ဖျက်ပစ်ခြင်း စသည်တို့ကို စီမံခန့်ခွဲရန် methods အချို့ရှိပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> ( | |
| <span class="hljs-comment"># User management</span> | |
| login, | |
| logout, | |
| whoami, | |
| <span class="hljs-comment"># Repository creation and management</span> | |
| create_repo, | |
| delete_repo, | |
| update_repo_visibility, | |
| <span class="hljs-comment"># And some methods to retrieve/change information about the content</span> | |
| list_models, | |
| list_datasets, | |
| list_metrics, | |
| list_repo_files, | |
| upload_file, | |
| delete_file, | |
| )<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-l6x3fp">ထို့အပြင်၊ ၎င်းသည် local repository တစ်ခုကို စီမံခန့်ခွဲရန် အလွန်အစွမ်းထက်သော <code>Repository</code> class ကို ပေးထားသည်။ ၎င်းတို့ကို အကျိုးရှိရှိ အသုံးပြုပုံကို နားလည်ရန် နောက်အပိုင်းအနည်းငယ်တွင် ဤ methods များနှင့် class ကို ကျွန်တော်တို့ လေ့လာသွားပါမယ်။</p> <p data-svelte-h="svelte-pxvjrs"><code>create_repo</code> method ကို အသုံးပြုပြီး Hub မှာ repository အသစ်တစ်ခု ဖန်တီးနိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> create_repo | |
| create_repo(<span class="hljs-string">"dummy-model"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1ibwyei">ဒါက သင့် namespace မှာ <code>dummy-model</code> repository ကို ဖန်တီးပေးပါလိမ့်မယ်။ သင်ကြိုက်နှစ်သက်ရင် <code>organization</code> argument ကို အသုံးပြုပြီး repository က ဘယ် organization နဲ့ သက်ဆိုင်တယ်ဆိုတာ သတ်မှတ်နိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> create_repo | |
| create_repo(<span class="hljs-string">"dummy-model"</span>, organization=<span class="hljs-string">"huggingface"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1glwtfx">ဒါက သင်အဲဒီ organization မှာ အဖွဲ့ဝင်ဖြစ်တယ်ဆိုရင် <code>dummy-model</code> repository ကို <code>huggingface</code> namespace မှာ ဖန်တီးပေးပါလိမ့်မယ်။</p> <p data-svelte-h="svelte-8ry2ya">အသုံးဝင်နိုင်တဲ့ အခြား arguments တွေကတော့…</p> <ul data-svelte-h="svelte-fmdkke"><li><code>private</code>၊ repository ကို တခြားသူတွေ မြင်နိုင်မမြင်နိုင် သတ်မှတ်ဖို့။</li> <li><code>token</code>၊ သင် cache မှာ သိမ်းထားတဲ့ token ကို သတ်မှတ်ထားတဲ့ token တစ်ခုနဲ့ override လုပ်ချင်ရင်။</li> <li><code>repo_type</code>၊ model အစား <code>dataset</code> ဒါမှမဟုတ် <code>space</code> တစ်ခုကို ဖန်တီးချင်ရင်။ လက်ခံနိုင်တဲ့ တန်ဖိုးတွေကတော့ <code>"dataset"</code> နဲ့ <code>"space"</code> ဖြစ်ပါတယ်။</li></ul> <p data-svelte-h="svelte-1a2uu8p">repository ကို ဖန်တီးပြီးတာနဲ့၊ ကျွန်တော်တို့ files တွေ ထည့်သွင်းသင့်ပါတယ်။ ဒါကို ဘယ်လိုနည်းလမ်းသုံးခုနဲ့ ကိုင်တွယ်နိုင်မလဲဆိုတာ သိဖို့ နောက်အပိုင်းကို သွားလိုက်ပါ။</p> <h2 class="relative group"><a id="using-the-web-interface" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#using-the-web-interface"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Web Interface ကို အသုံးပြုခြင်း</span></h2> <p data-svelte-h="svelte-15j2s27">web interface က Hub မှာ repositories တွေကို တိုက်ရိုက်စီမံခန့်ခွဲဖို့ ကိရိယာတွေကို ပေးထားပါတယ်။ interface ကို အသုံးပြုပြီး၊ သင် repositories တွေ လွယ်လွယ်ကူကူ ဖန်တီးနိုင်တယ်၊ files တွေ ထည့်နိုင်တယ် (ကြီးမားတဲ့ files တွေတောင်မှ!)၊ models တွေကို လေ့လာနိုင်တယ်၊ diffs တွေကို မြင်နိုင်တယ်၊ ပြီးတော့ တခြားအများကြီး လုပ်နိုင်ပါတယ်။</p> <p data-svelte-h="svelte-1cmghye">repository အသစ်တစ်ခု ဖန်တီးဖို့ <a href="https://huggingface.co/new" rel="nofollow">huggingface.co/new</a> ကို သွားပါ။</p> <div class="flex justify-center" data-svelte-h="svelte-4qsgxt"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/new_model.png" alt="Page showcasing the model used for the creation of a new model repository." width="80%"></div> <p data-svelte-h="svelte-1lrmtyt">ပထမဆုံး၊ repository ရဲ့ ပိုင်ရှင်ကို သတ်မှတ်ပါ၊ ဒါက သင်ကိုယ်တိုင် ဒါမှမဟုတ် သင်နဲ့ ဆက်စပ်နေတဲ့ organization တစ်ခုခု ဖြစ်နိုင်ပါတယ်။ သင် organization တစ်ခုကို ရွေးချယ်ရင်၊ model ကို organization ရဲ့ page မှာ ဖော်ပြထားမှာဖြစ်ပြီး organization ရဲ့ အဖွဲ့ဝင်တိုင်းက repository ကို ပံ့ပိုးကူညီနိုင်ပါလိမ့်မယ်။</p> <p data-svelte-h="svelte-cglpza">နောက်တစ်ခုကတော့ သင့် model ရဲ့ နာမည်ကို ထည့်သွင်းပါ။ ဒါက repository ရဲ့ နာမည်လည်း ဖြစ်ပါလိမ့်မယ်။ နောက်ဆုံးအနေနဲ့၊ သင်ရဲ့ model ကို public ဒါမှမဟုတ် private ဖြစ်စေချင်လားဆိုတာ သတ်မှတ်နိုင်ပါတယ်။ Private models တွေကို အများပြည်သူမြင်ကွင်းကနေ ဝှက်ထားပါတယ်။</p> <p data-svelte-h="svelte-1gch7tz">သင့် model repository ကို ဖန်တီးပြီးတာနဲ့၊ အောက်ပါကဲ့သို့ page တစ်ခုကို သင်တွေ့ရပါလိမ့်မယ်။</p> <div class="flex justify-center" data-svelte-h="svelte-1xh6nig"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/empty_model.png" alt="An empty model page after creating a new repository." width="80%"></div> <p data-svelte-h="svelte-176qwh4">ဒီနေရာမှာ သင့် model ကို လက်ခံထားမှာ ဖြစ်ပါတယ်။ ဒါကို စတင်ဖြည့်ဆည်းဖို့၊ web interface ကနေ README file တစ်ခုကို တိုက်ရိုက်ထည့်သွင်းနိုင်ပါတယ်။</p> <div class="flex justify-center" data-svelte-h="svelte-1jm8l0p"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/dummy_model.png" alt="The README file showing the Markdown capabilities." width="80%"></div> <p data-svelte-h="svelte-luudb2">README file က Markdown နဲ့ ရေးထားပါတယ်၊ လွတ်လပ်စွာ ဖန်တီးနိုင်ပါတယ်။ ဒီအခန်းရဲ့ တတိယအပိုင်းက model card တစ်ခုတည်ဆောက်ခြင်းအတွက် ရည်ရွယ်ပါတယ်။ ဒါတွေက သင့် model ကို တန်ဖိုးရှိစေရာမှာ အရေးပါပါတယ်၊ ဘာလို့လဲဆိုတော့ ဒါတွေက သင့် model က ဘာတွေလုပ်နိုင်လဲဆိုတာကို တခြားသူတွေကို ပြောပြတဲ့ နေရာဖြစ်လို့ပါပဲ။</p> <p data-svelte-h="svelte-15qo4o1">“Files and versions” tab ကို သင်ကြည့်လိုက်ရင်၊ အဲဒီမှာ files အများကြီး မရှိသေးတာကို သင်တွေ့ရပါလိမ့်မယ်၊ သင်အခုမှ ဖန်တီးခဲ့တဲ့ <em>README.md</em> နဲ့ ကြီးမားတဲ့ files တွေကို ခြေရာခံထားတဲ့ <em>.gitattributes</em> file ပဲ ရှိပါသေးတယ်။</p> <div class="flex justify-center" data-svelte-h="svelte-1kuf5jc"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/files.png" alt="The 'Files and versions' tab only shows the .gitattributes and README.md files." width="80%"></div> <p data-svelte-h="svelte-czn948">files အသစ်တွေ ဘယ်လိုထည့်ရမလဲဆိုတာကို နောက်မှာ ကျွန်တော်တို့ လေ့လာသွားပါမယ်။</p> <h2 class="relative group"><a id="uploading-the-model-files" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#uploading-the-model-files"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Model Files များကို Upload လုပ်ခြင်း</span></h2> <p data-svelte-h="svelte-51gf8">Hugging Face Hub မှာ files တွေကို စီမံခန့်ခွဲတဲ့ system က ပုံမှန် files တွေအတွက် git ကို အခြေခံထားပြီး၊ ကြီးမားတဲ့ files တွေအတွက် git-lfs (<a href="https://git-lfs.github.com/" rel="nofollow">Git Large File Storage</a>) ကို အခြေခံထားပါတယ်။</p> <p data-svelte-h="svelte-r8szk8">နောက်အပိုင်းမှာ Hub ကို files တွေ upload လုပ်ဖို့ နည်းလမ်းသုံးခုကို ကျွန်တော်တို့ လေ့လာသွားပါမယ်- <code>huggingface_hub</code> ကို အသုံးပြုခြင်းနဲ့ git commands တွေကို အသုံးပြုခြင်းတို့ ဖြစ်ပါတယ်။</p> <h3 class="relative group"><a id="the-uploadfile-approach" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#the-uploadfile-approach"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>upload_file ချဉ်းကပ်မှု</span></h3> <p data-svelte-h="svelte-15jqpxs"><code>upload_file</code> ကို အသုံးပြုတာက သင့် system မှာ git နဲ့ git-lfs install လုပ်ထားဖို့ မလိုအပ်ပါဘူး။ ဒါက HTTP POST requests တွေကို အသုံးပြုပြီး files တွေကို 🤗 Hub ကို တိုက်ရိုက် push လုပ်ပါတယ်။ ဒီနည်းလမ်းရဲ့ ကန့်သတ်ချက်ကတော့ 5GB ထက်ကြီးတဲ့ files တွေကို ကိုင်တွယ်နိုင်ခြင်း မရှိပါဘူး။ | |
| သင့် files တွေက 5GB ထက်ကြီးတယ်ဆိုရင် အောက်မှာ အသေးစိတ်ဖော်ပြထားတဲ့ အခြားနည်းလမ်းနှစ်ခုကို လိုက်နာပါ။</p> <p data-svelte-h="svelte-12kh68y">API ကို အောက်ပါအတိုင်း အသုံးပြုနိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> upload_file | |
| upload_file( | |
| <span class="hljs-string">"<path_to_file>/config.json"</span>, | |
| path_in_repo=<span class="hljs-string">"config.json"</span>, | |
| repo_id=<span class="hljs-string">"<namespace>/dummy-model"</span>, | |
| )<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-cs1vc7">ဒါက <code><path_to_file></code> မှာရှိတဲ့ <code>config.json</code> file ကို repository ရဲ့ root ကို <code>config.json</code> အနေနဲ့ <code>dummy-model</code> repository ကို upload လုပ်ပါလိမ့်မယ်။</p> <p data-svelte-h="svelte-8ry2ya">အသုံးဝင်နိုင်တဲ့ အခြား arguments တွေကတော့…</p> <ul data-svelte-h="svelte-1bxby49"><li><code>token</code>၊ သင် cache မှာ သိမ်းထားတဲ့ token ကို သတ်မှတ်ထားတဲ့ token တစ်ခုနဲ့ override လုပ်ချင်ရင်။</li> <li><code>repo_type</code>၊ model အစား <code>dataset</code> ဒါမှမဟုတ် <code>space</code> တစ်ခုကို upload လုပ်ချင်ရင်။ လက်ခံနိုင်တဲ့ တန်ဖိုးတွေကတော့ <code>"dataset"</code> နဲ့ <code>"space"</code> ဖြစ်ပါတယ်။</li></ul> <h3 class="relative group"><a id="the-repository-class" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#the-repository-class"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Repository Class</span></h3> <p data-svelte-h="svelte-17hdyva"><code>Repository</code> class က local repository တစ်ခုကို git-like နည်းလမ်းနဲ့ စီမံခန့်ခွဲပါတယ်။ ဒါက ကျွန်တော်တို့ လိုအပ်တဲ့ features အားလုံးကို ပေးဖို့အတွက် git နဲ့ ဖြစ်နိုင်တဲ့ ခက်ခဲတဲ့အချက်အများစုကို abstract လုပ်ထားပါတယ်။</p> <p data-svelte-h="svelte-3c4c0">ဒီ class ကို အသုံးပြုဖို့အတွက် git နဲ့ git-lfs install လုပ်ထားဖို့ လိုအပ်ပါတယ်။ ဒါကြောင့် မစတင်ခင် git-lfs ကို install လုပ်ပြီး set up လုပ်ထားကြောင်း သေချာပါစေ (<a href="https://git-lfs.github.com/" rel="nofollow">ဒီနေရာမှာ</a> install လုပ်နည်းလမ်းညွှန်တွေကို ကြည့်ပါ)။</p> <p data-svelte-h="svelte-1uy6tfw">ကျွန်တော်တို့ အခုမှ ဖန်တီးခဲ့တဲ့ repository နဲ့ စတင်လုပ်ဆောင်ဖို့၊ remote repository ကို clone လုပ်ခြင်းဖြင့် local folder တစ်ခုထဲကို initialize လုပ်နိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> Repository | |
| repo = Repository(<span class="hljs-string">"<path_to_dummy_folder>"</span>, clone_from=<span class="hljs-string">"<namespace>/dummy-model"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1pyqrbe">ဒါက ကျွန်တော်တို့ရဲ့ working directory မှာ <code><path_to_dummy_folder></code> folder ကို ဖန်တီးလိုက်ပါတယ်။ ဒီ folder မှာ <code>.gitattributes</code> file တစ်ခုတည်းသာ ပါဝင်ပါတယ်၊ ဘာလို့လဲဆိုတော့ repository ကို <code>create_repo</code> ကနေ instantiate လုပ်တဲ့အခါ ဖန်တီးခဲ့တဲ့ တစ်ခုတည်းသော file ဖြစ်လို့ပါပဲ။</p> <p data-svelte-h="svelte-167sazr">ဒီအချိန်ကစပြီး၊ ကျွန်တော်တို့ဟာ ရိုးရာ git methods အများအပြားကို အကျိုးရှိရှိ အသုံးပြုနိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->repo.git_pull() | |
| repo.git_add() | |
| repo.git_commit() | |
| repo.git_push() | |
| repo.git_tag()<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-19scv63">နဲ့ တခြားအရာတွေ! ရရှိနိုင်တဲ့ methods အားလုံးကို ခြုံငုံသုံးသပ်ဖို့ <a href="https://github.com/huggingface/huggingface_hub/tree/main/src/huggingface_hub#advanced-programmatic-repository-management" rel="nofollow">ဒီနေရာမှာ</a> ရရှိနိုင်တဲ့ <code>Repository</code> documentation ကို ကြည့်ရှုဖို့ ကျွန်တော်တို့ အကြံပြုပါတယ်။</p> <p data-svelte-h="svelte-1a0ezq7">လက်ရှိမှာ၊ Hub ကို push လုပ်ချင်တဲ့ model တစ်ခုနဲ့ tokenizer တစ်ခု ရှိပါတယ်။ ကျွန်တော်တို့ repository ကို အောင်မြင်စွာ clone လုပ်ခဲ့ပြီးဖြစ်လို့၊ အဲဒီ repository ထဲမှာ files တွေကို သိမ်းဆည်းနိုင်ပါတယ်။</p> <p data-svelte-h="svelte-1idxqnx">နောက်ဆုံးပြောင်းလဲမှုတွေကို pull လုပ်ခြင်းဖြင့် ကျွန်တော်တို့ရဲ့ local clone က နောက်ဆုံးအခြေအနေဖြစ်ကြောင်း အရင်ဆုံး သေချာစေပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->repo.git_pull()<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-iv9lfy">ဒါပြီးတာနဲ့ model နဲ့ tokenizer files တွေကို သိမ်းဆည်းပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->model.save_pretrained(<span class="hljs-string">"<path_to_dummy_folder>"</span>) | |
| tokenizer.save_pretrained(<span class="hljs-string">"<path_to_dummy_folder>"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1ot7c6a"><code><path_to_dummy_folder></code> မှာ model နဲ့ tokenizer files အားလုံး အခုပါဝင်နေပါပြီ။ files တွေကို staging area ကို ထည့်တာ၊ commit လုပ်တာနဲ့ Hub ကို push လုပ်တာလိုမျိုး ပုံမှန် git workflow ကို ကျွန်တော်တို့ လိုက်နာပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->repo.git_add() | |
| repo.git_commit(<span class="hljs-string">"Add model and tokenizer files"</span>) | |
| repo.git_push()<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1q9pjp4">ဂုဏ်ယူပါတယ်! သင် Hub မှာ ပထမဆုံး files တွေကို push လုပ်ခဲ့ပါပြီ။</p> <h3 class="relative group"><a id="the-git-based-approach" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#the-git-based-approach"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Git-based ချဉ်းကပ်မှု</span></h3> <p data-svelte-h="svelte-1yayb62">ဒါက files တွေ upload လုပ်ဖို့ အလွန်ရိုးရှင်းတဲ့ နည်းလမ်းဖြစ်ပါတယ်- ကျွန်တော်တို့ git နဲ့ git-lfs ကို တိုက်ရိုက်အသုံးပြုပါမယ်။ ခက်ခဲတဲ့အချက်အများစုကို ယခင်ချဉ်းကပ်မှုတွေက abstract လုပ်ထားပြီးဖြစ်ပေမယ့်၊ အောက်ပါ method မှာ သတိထားရမယ့် အချက်အချို့ရှိတဲ့အတွက် ပိုမိုရှုပ်ထွေးတဲ့ use-case တစ်ခုကို ကျွန်တော်တို့ လိုက်နာပါမယ်။</p> <p data-svelte-h="svelte-1456ecs">ဒီ class ကို အသုံးပြုဖို့အတွက် git နဲ့ git-lfs install လုပ်ထားဖို့ လိုအပ်ပါတယ်။ ဒါကြောင့် မစတင်ခင် <a href="https://git-lfs.github.com/" rel="nofollow">git-lfs</a> ကို install လုပ်ပြီး set up လုပ်ထားကြောင်း သေချာပါစေ (ဒီနေရာမှာ install လုပ်နည်းလမ်းညွှန်တွေကို ကြည့်ပါ)။</p> <p data-svelte-h="svelte-1uprohi">ပထမဆုံး git-lfs ကို initialize လုပ်ခြင်းဖြင့် စတင်ပါ။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->git lfs install<!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->Updated git hooks. | |
| Git LFS initialized.<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-8cp3b5">ဒါပြီးတာနဲ့၊ ပထမအဆင့်ကတော့ သင်ရဲ့ model repository ကို clone လုပ်ဖို့ပါပဲ။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->git <span class="hljs-built_in">clone</span> https://huggingface.co/<namespace>/<your-model-id><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-wv3omh">ကျွန်တော့် username က <code>lysandre</code> ဖြစ်ပြီး model name က <code>dummy</code> ကို အသုံးပြုခဲ့တဲ့အတွက်၊ ကျွန်တော့်အတွက် command က အောက်ပါအတိုင်း ဖြစ်ပါလိမ့်မယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->git clone https:<span class="hljs-regexp">//</span>huggingface.co<span class="hljs-regexp">/lysandre/</span>dummy<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-15v3nqd">ကျွန်တော့် working directory မှာ <em>dummy</em> လို့ခေါ်တဲ့ folder တစ်ခု အခုရှိပါပြီ။ folder ထဲကို <code>cd</code> လုပ်ပြီး contents တွေကို ကြည့်နိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-built_in">cd</span> dummy && <span class="hljs-built_in">ls</span><!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->README.md<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-pix6xx">သင် Hugging Face Hub ရဲ့ <code>create_repo</code> method ကို အသုံးပြုပြီး repository ကို အခုမှ ဖန်တီးခဲ့တာဆိုရင်၊ ဒီ folder မှာ hidden <code>.gitattributes</code> file တစ်ခုတည်းသာ ပါဝင်သင့်ပါတယ်။ သင် web interface ကို အသုံးပြုပြီး repository တစ်ခု ဖန်တီးဖို့ ယခင်အပိုင်းက ညွှန်ကြားချက်တွေကို လိုက်နာခဲ့တယ်ဆိုရင်တော့၊ folder မှာ hidden <code>.gitattributes</code> file နဲ့အတူ <em>README.md</em> file တစ်ခု ပါဝင်သင့်ပါတယ်။</p> <p data-svelte-h="svelte-skzlhi">configuration file တစ်ခု၊ vocabulary file တစ်ခု ဒါမှမဟုတ် kilobytes အနည်းငယ်အောက်ရှိတဲ့ မည်သည့် file ကိုမဆို ပုံမှန်အရွယ်အစားရှိတဲ့ file တစ်ခုကို ထည့်သွင်းတာက မည်သည့် git-based system မှာမဆို လုပ်ဆောင်ရမယ့်အတိုင်း အတိအကျပါပဲ။ သို့သော်လည်း၊ ပိုကြီးမားတဲ့ files တွေကို <em>huggingface.co</em> ကို push လုပ်နိုင်ဖို့ git-lfs ကနေတစ်ဆင့် register လုပ်ရပါမယ်။</p> <p data-svelte-h="svelte-1xukhwu">ကျွန်တော်တို့ရဲ့ dummy repository ကို commit လုပ်ချင်တဲ့ model တစ်ခုနဲ့ tokenizer တစ်ခုကို generate လုပ်ဖို့ Python ကို ခဏပြန်သွားကြရအောင်…</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForMaskedLM, AutoTokenizer | |
| checkpoint = <span class="hljs-string">"camembert-base"</span> | |
| model = AutoModelForMaskedLM.from_pretrained(checkpoint) | |
| tokenizer = AutoTokenizer.from_pretrained(checkpoint) | |
| <span class="hljs-comment"># Do whatever with the model, train it, fine-tune it...</span> | |
| model.save_pretrained(<span class="hljs-string">"<path_to_dummy_folder>"</span>) | |
| tokenizer.save_pretrained(<span class="hljs-string">"<path_to_dummy_folder>"</span>)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1t6lpy7">model နဲ့ tokenizer artifacts အချို့ကို သိမ်းဆည်းပြီးပြီဆိုတော့ <em>dummy</em> folder ကို ထပ်ကြည့်ကြရအောင်…</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-built_in">ls</span><!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->config.json pytorch_model.bin README.md sentencepiece.bpe.model special_tokens_map.json tokenizer_config.json tokenizer.json<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1c9m4ik">သင် file sizes တွေကို (ဥပမာ- <code>ls -lh</code> နဲ့) ကြည့်လိုက်ရင် model state dict file (<em>pytorch_model.bin</em>) က 400 MB ကျော်ရှိတဲ့ တစ်ခုတည်းသော ခြားနားချက်ဖြစ်တာကို သင်တွေ့ရပါလိမ့်မယ်။</p> <blockquote class="tip">✏️ web interface ကနေ repository ကို ဖန်တီးတဲ့အခါ၊ *.gitattributes* file ကို *.bin* နဲ့ *.h5* လိုမျိုး သတ်မှတ်ထားတဲ့ extensions တွေပါတဲ့ files တွေကို ကြီးမားတဲ့ files တွေအဖြစ် သတ်မှတ်ဖို့ အလိုအလျောက် set up လုပ်ထားပါတယ်။ ဒါကြောင့် သင့်ဘက်ကနေ မည်သည့် setup မှ မလိုအပ်ဘဲ git-lfs က ၎င်းတို့ကို ခြေရာခံပါလိမ့်မယ်။</blockquote> <p data-svelte-h="svelte-18rg0eq">အခု ကျွန်တော်တို့ဟာ ရိုးရာ Git repositories တွေနဲ့ ပုံမှန်လုပ်ဆောင်သလိုပဲ ဆက်လက်လုပ်ဆောင်နိုင်ပါပြီ။ <code>git add</code> command ကို အသုံးပြုပြီး files အားလုံးကို Git ရဲ့ staging environment ထဲကို ထည့်နိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->git add .<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-dmwybn">ပြီးရင် လက်ရှိ staged လုပ်ထားတဲ့ files တွေကို ကြည့်နိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->git status<!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->On branch main | |
| Your branch is up to <span class="hljs-built_in">date</span> with <span class="hljs-string">'origin/main'</span>. | |
| Changes to be committed: | |
| (use <span class="hljs-string">"git restore --staged <file>..."</span> to unstage) | |
| modified: .gitattributes | |
| new file: config.json | |
| new file: pytorch_model.bin | |
| new file: sentencepiece.bpe.model | |
| new file: special_tokens_map.json | |
| new file: tokenizer.json | |
| new file: tokenizer_config.json<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1lrkoz1">အလားတူပဲ၊ git-lfs က မှန်ကန်တဲ့ files တွေကို ခြေရာခံနေခြင်းရှိမရှိ ၎င်းရဲ့ <code>status</code> command ကို အသုံးပြုပြီး သေချာအောင် လုပ်နိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->git lfs status<!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->On branch main | |
| Objects to be pushed to origin/main: | |
| Objects to be committed: | |
| config.json (Git: bc20ff2) | |
| pytorch_model.bin (LFS: 35686c2) | |
| sentencepiece.bpe.model (LFS: 988bc5a) | |
| special_tokens_map.json (Git: cb23931) | |
| tokenizer.json (Git: 851ff3e) | |
| tokenizer_config.json (Git: f0f7783) | |
| Objects not staged <span class="hljs-keyword">for</span> commit: | |
| <!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1i1l4ge">files အားလုံးမှာ <code>Git</code> ကို handler အဖြစ်ရှိနေတာကို ကျွန်တော်တို့ တွေ့နိုင်ပါတယ်၊ <em>pytorch_model.bin</em> နဲ့ <em>sentencepiece.bpe.model</em> တို့မှလွဲ၍ <code>LFS</code> ကို handler အဖြစ်ရှိနေပါတယ်။ ကောင်းပါပြီ!</p> <p data-svelte-h="svelte-17zp751">နောက်ဆုံးအဆင့်တွေဖြစ်တဲ့ commit လုပ်ခြင်းနဲ့ <em>huggingface.co</em> remote repository ကို push လုပ်ခြင်းဆီ ဆက်သွားကြရအောင်…</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->git commit -m <span class="hljs-string">"First model version"</span><!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->[main b08aab1] First model version | |
| 7 files changed, 29027 insertions(+) | |
| 6 files changed, 36 insertions(+) | |
| create mode 100644 config.json | |
| create mode 100644 pytorch_model.bin | |
| create mode 100644 sentencepiece.bpe.model | |
| create mode 100644 special_tokens_map.json | |
| create mode 100644 tokenizer.json | |
| create mode 100644 tokenizer_config.json<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-ej86bp">push လုပ်တာက သင့် internet connection ရဲ့ မြန်နှုန်းနဲ့ သင့် files တွေရဲ့ အရွယ်အစားပေါ်မူတည်ပြီး အချိန်အနည်းငယ် ကြာနိုင်ပါတယ်။</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->git push<!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->Uploading LFS objects: 100% (1/1), 433 MB | 1.3 MB/s, <span class="hljs-keyword">done</span>. | |
| Enumerating objects: 11, <span class="hljs-keyword">done</span>. | |
| Counting objects: 100% (11/11), <span class="hljs-keyword">done</span>. | |
| Delta compression using up to 12 threads | |
| Compressing objects: 100% (9/9), <span class="hljs-keyword">done</span>. | |
| Writing objects: 100% (9/9), 288.27 KiB | 6.27 MiB/s, <span class="hljs-keyword">done</span>. | |
| Total 9 (delta 1), reused 0 (delta 0), pack-reused 0 | |
| To https://huggingface.co/lysandre/dummy | |
| 891b41d..b08aab1 main -> main<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-o5z6ti">ဒါပြီးတာနဲ့ model repository ကို ကျွန်တော်တို့ကြည့်လိုက်ရင်၊ အခုမှ ထည့်သွင်းထားတဲ့ files တွေအားလုံးကို ကျွန်တော်တို့ တွေ့မြင်နိုင်ပါပြီ။</p> <div class="flex justify-center" data-svelte-h="svelte-1v39mjb"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/full_model.png" alt="The 'Files and versions' tab now contains all the recently uploaded files." width="80%"></div> <p data-svelte-h="svelte-iqa4li">UI (User Interface) က သင့်ကို model files တွေနဲ့ commits တွေကို လေ့လာနိုင်စေပြီး commit တစ်ခုစီက ဖြစ်ပေါ်စေတဲ့ diffs တွေကို ကြည့်ရှုနိုင်စေပါတယ်။</p> <div class="flex justify-center" data-svelte-h="svelte-1g561m5"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter4/diffs.gif" alt="The diff introduced by the recent commit." width="80%"></div> <h2 class="relative group"><a id="ဝဟရ-ရငလငခက-glossary" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#ဝဟရ-ရငလငခက-glossary"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>ဝေါဟာရ ရှင်းလင်းချက် (Glossary)</span></h2> <ul data-svelte-h="svelte-1hph5x6"><li><strong>Pretrained Models</strong>: အကြီးစား ဒေတာအမြောက်အမြားဖြင့် ကြိုတင်လေ့ကျင့်ထားပြီးဖြစ်သော AI (Artificial Intelligence) မော်ဒယ်များ။</li> <li><strong>🤗 Hub (Hugging Face Hub)</strong>: AI မော်ဒယ်တွေ၊ datasets တွေနဲ့ demo တွေကို အခြားသူတွေနဲ့ မျှဝေဖို့၊ ရှာဖွေဖို့နဲ့ ပြန်လည်အသုံးပြုဖို့အတွက် အွန်လိုင်း platform တစ်ခု ဖြစ်ပါတယ်။</li> <li><strong><code>push_to_hub</code> API (Application Programming Interface)</strong>: Hugging Face Transformers library မှ ပံ့ပိုးပေးသော method တစ်ခုဖြစ်ပြီး trained models များနှင့် tokenizers များကို Hugging Face Hub သို့ အလွယ်တကူ upload လုပ်နိုင်စေသည်။</li> <li><strong><code>huggingface_hub</code> Python Library</strong>: Hugging Face Hub ကို အပြန်အလှန်ဆက်သွယ်ရန် (repositories ဖန်တီးခြင်း၊ files များ upload လုပ်ခြင်း စသည်ဖြင့်) ကိရိယာများနှင့် functions များကို ပံ့ပိုးပေးသော Python library။</li> <li><strong>Web Interface</strong>: Hugging Face Hub ဝက်ဘ်ဆိုဒ်၏ ဂရပ်ဖစ်အခြေခံ အသုံးပြုသူမျက်နှာပြင်။</li> <li><strong>Git</strong>: Version control system တစ်ခုဖြစ်ပြီး code changes များကို ခြေရာခံရန်နှင့် developer အများအပြား ပူးပေါင်းလုပ်ဆောင်နိုင်ရန် ဒီဇိုင်းထုတ်ထားသည်။</li> <li><strong>Git-LFS (Git Large File Storage)</strong>: Git repositories များတွင် ကြီးမားသော files များကို ထိရောက်စွာ ကိုင်တွယ်ရန်အတွက် extension တစ်ခု။</li> <li><strong>Compute Resources</strong>: AI/ML model များကို လေ့ကျင့်ရန်နှင့် အသုံးပြုရန်အတွက် လိုအပ်သော ကွန်ပျူတာ hardware (ဥပမာ- CPU, GPU, memory)။</li> <li><strong>Trained Artifacts</strong>: လေ့ကျင့်ထားသော AI model များ၊ ၎င်းတို့၏ weights များ၊ tokenizers များ စသည်ဖြင့် အသုံးပြုနိုင်သော output များ။</li> <li><strong>Model Repositories</strong>: Hugging Face Hub တွင် AI model များကို သိမ်းဆည်းထားသော Git repositories များ။</li> <li><strong>Authentication Token</strong>: အသုံးပြုသူတစ်ဦး၏ အထောက်အထားကို စစ်ဆေးရန်နှင့် ၎င်းတို့၏ permissions များကို အတည်ပြုရန် အသုံးပြုသော လုံခြုံရေး token။</li> <li><strong><code>huggingface-cli login</code></strong>: Hugging Face CLI (Command Line Interface) မှတစ်ဆင့် Hub ကို login လုပ်ရန် command။</li> <li><strong>CLI (Command Line Interface)</strong>: ကွန်ပျူတာပရိုဂရမ်တစ်ခုနှင့် text-based commands များ အသုံးပြု၍ အပြန်အလှန်ဆက်သွယ်သော နည်းလမ်း။</li> <li><strong>Notebook</strong>: Jupyter Notebook သို့မဟုတ် Google Colab ကဲ့သို့သော interactive computing environment။</li> <li><strong><code>notebook_login()</code> Function</strong>: Jupyter/Colab Notebooks များတွင် Hugging Face Hub ကို login လုပ်ရန် <code>huggingface_hub</code> library မှ function။</li> <li><strong>Cache Folder</strong>: အနာဂတ်တွင် မြန်ဆန်စွာ ဝင်ရောက်ကြည့်ရှုနိုင်ရန် ဒေတာများကို ယာယီသိမ်းဆည်းထားသော နေရာ။</li> <li><strong>Namespace</strong>: Hugging Face Hub တွင် အသုံးပြုသူများ သို့မဟုတ် organization များအတွက် ထူးခြားသော ID သို့မဟုတ် ခွဲခြားသတ်မှတ်မှု။</li> <li><strong><code>Trainer</code> API</strong>: Hugging Face Transformers library မှ model များကို ထိရောက်စွာ လေ့ကျင့်ရန်အတွက် ဒီဇိုင်းထုတ်ထားသော မြင့်မားသောအဆင့် (high-level) API။</li> <li><strong><code>TrainingArguments</code></strong>: Trainer API တွင် training process အတွက် parameters များကို သတ်မှတ်ရန် အသုံးပြုသော class။</li> <li><strong><code>bert-finetuned-mrpc</code></strong>: MRPC dataset တွင် fine-tuned လုပ်ထားသော BERT model ကို ဖော်ပြသော အမည်။</li> <li><strong><code>save_strategy="epoch"</code></strong>: Model ကို epoch တိုင်း သိမ်းဆည်းရန် သတ်မှတ်ခြင်း။</li> <li><strong><code>push_to_hub=True</code></strong>: Model ကို Hugging Face Hub သို့ အလိုအလျောက် push လုပ်ရန် သတ်မှတ်ခြင်း။</li> <li><strong><code>trainer.train()</code></strong>: Trainer API ကို အသုံးပြု၍ model ကို လေ့ကျင့်ရန် method။</li> <li><strong><code>trainer.push_to_hub()</code></strong>: Trainer API ကို အသုံးပြု၍ လက်ရှိ training အခြေအနေကို Hub သို့ push လုပ်ရန် method။</li> <li><strong>Model Card</strong>: Hugging Face Hub တွင် မော်ဒယ်တစ်ခုစီအတွက် ပါရှိသော အချက်အလက်များပါသည့် စာမျက်နှာ။ ၎င်းတွင် မော်ဒယ်ကို မည်သို့လေ့ကျင့်ခဲ့သည်၊ မည်သည့် datasets များကို အသုံးပြုခဲ့သည်၊ ၎င်း၏ ကန့်သတ်ချက်များ၊ ဘက်လိုက်မှုများ (biases) နှင့် အသုံးပြုနည်းများ ပါဝင်သည်။</li> <li><strong>Metadata</strong>: ဒေတာအကြောင်းအရာများကို ဖော်ပြသော ဒေတာ (ဥပမာ- hyperparameters, evaluation results)။</li> <li><strong>Hyperparameters</strong>: Model ကို လေ့ကျင့်ရာတွင် အသုံးပြုသော ပြင်ပ parameters များ (ဥပမာ- learning rate, batch size)။</li> <li><strong>Evaluation Results</strong>: Model ၏ စွမ်းဆောင်ရည်ကို တိုင်းတာသော ရလဒ်များ (ဥပမာ- accuracy, F1 score)။</li> <li><strong>Keras</strong>: TensorFlow အပေါ်တွင် တည်ဆောက်ထားသော open-source deep learning library တစ်ခု။</li> <li><strong><code>PushToHubCallback</code></strong>: Keras models များကို Hub သို့ push လုပ်ရန်အတွက် Hugging Face Transformers library မှ callback class။</li> <li><strong><code>model.fit()</code></strong>: Keras မှာ model ကို လေ့ကျင့်ရန် method။</li> <li><strong><code>hub_model_id</code></strong>: Hub ပေါ်ရှိ model repository အတွက် သတ်မှတ်ထားသော ID။</li> <li><strong>Organization Namespace</strong>: Hugging Face Hub တွင် organization တစ်ခုအတွက် သတ်မှတ်ထားသော namespace။</li> <li><strong>Configuration Objects</strong>: model ၏ ဖွဲ့စည်းပုံနှင့် parameters များကို သိမ်းဆည်းထားသော object များ။</li> <li><strong><code>push_to_hub()</code> Method (Model/Tokenizer/Config)</strong>: model, tokenizer, သို့မဟုတ် configuration object များပေါ်တွင် တိုက်ရိုက်ရရှိနိုင်သော method ဖြစ်ပြီး ၎င်းတို့ကို Hub သို့ push လုပ်ရန်။</li> <li><strong><code>AutoModelForMaskedLM</code> / <code>TFAutoModelForMaskedLM</code></strong>: Masked Language Modeling (MLM) အတွက် AutoModel classes များ (PyTorch/TensorFlow)။</li> <li><strong><code>AutoTokenizer</code></strong>: Hugging Face Transformers library မှာ ပါဝင်တဲ့ class တစ်ခုဖြစ်ပြီး မော်ဒယ်အမည်ကို အသုံးပြုပြီး သက်ဆိုင်ရာ tokenizer ကို အလိုအလျောက် load လုပ်ပေးသည်။</li> <li><strong><code>from_pretrained()</code></strong>: Pretrained model သို့မဟုတ် tokenizer ကို Hub မှ load လုပ်ရန် method။</li> <li><strong>Weights</strong>: Model ၏ လေ့ကျင့်ပြီးသား parameters များ။</li> <li><strong><code>dummy-model</code></strong>: ဥပမာပြရန်အတွက် အသုံးပြုသော model repository အမည်။</li> <li><strong>API Token</strong>: Access token ကို ရည်ညွှန်းသည်။</li> <li><strong><code>use_auth_token</code> Argument</strong>: authentication token ကို <code>push_to_hub()</code> method သို့ တိုက်ရိုက်ပေးရန် argument။</li> <li><strong><code>bert-base-cased</code></strong>: BERT model ၏ base version, cased text (အကြီးအသေး ခွဲခြားသော) ဖြင့် လေ့ကျင့်ထားသော checkpoint identifier။</li> <li><strong><code>model_sharing</code> (Transformers documentation)</strong>: Transformers documentation ရှိ model မျှဝေခြင်းနှင့် ပတ်သက်သော အပိုင်း။</li> <li><strong><code>allenlp</code> (Library)</strong>: NLP သုတေသနနှင့် အပလီကေးရှင်းများအတွက် အသုံးပြုသော open-source deep learning library။</li> <li><strong><code>login</code>, <code>logout</code>, <code>whoami</code> (User Management)</strong>: <code>huggingface_hub</code> library မှ user account ကို စီမံခန့်ခွဲရန် functions များ။</li> <li><strong><code>create_repo</code>, <code>delete_repo</code>, <code>update_repo_visibility</code> (Repository Management)</strong>: <code>huggingface_hub</code> library မှ repository များကို ဖန်တီး၊ ဖျက်ပစ်၊ မြင်နိုင်စွမ်းကို ပြောင်းလဲရန် functions များ။</li> <li><strong><code>list_models</code>, <code>list_datasets</code>, <code>list_metrics</code>, <code>list_repo_files</code>, <code>upload_file</code>, <code>delete_file</code> (Content Information)</strong>: <code>huggingface_hub</code> library မှ Hub ပေါ်ရှိ content အကြောင်း အချက်အလက်များ ရယူရန်/ပြောင်းလဲရန် functions များ။</li> <li><strong><code>private</code> Argument (create_repo)</strong>: Repository ကို public သို့မဟုတ် private အဖြစ် သတ်မှတ်ရန် argument။</li> <li><strong><code>repo_type</code> Argument (create_repo)</strong>: Repository အမျိုးအစားကို သတ်မှတ်ရန် argument (ဥပမာ- <code>"model"</code>, <code>"dataset"</code>, <code>"space"</code>)။</li> <li><strong>Space (Hugging Face Space)</strong>: AI demo များကို host လုပ်ရန်အတွက် Hugging Face Hub တွင်ရှိသော platform။</li> <li><strong>Owner</strong>: Repository ကို ပိုင်ဆိုင်သော အသုံးပြုသူ သို့မဟုတ် organization။</li> <li><strong>Affiliated with</strong>: ဆက်စပ်မှုရှိသော။</li> <li><strong>README File (README.md)</strong>: project တစ်ခု သို့မဟုတ် repository တစ်ခုအကြောင်း အချက်အလက်များပါဝင်သော စာသားဖိုင်။ Markdown format ဖြင့် ရေးသားလေ့ရှိသည်။</li> <li><strong>Markdown</strong>: စာသားကို အလှဆင်ရန်အတွက် အသုံးပြုသော lightweight markup language။</li> <li><strong><code>.gitattributes</code> File</strong>: Git repositories များတွင် ကြီးမားသော files များကို git-lfs ဖြင့် ကိုင်တွယ်ရန် သတ်မှတ်ထားသော configuration file။</li> <li><strong>HTTP POST Requests</strong>: Web server သို့ data ပို့ရန်အတွက် အသုံးပြုသော HTTP method။</li> <li><strong>Local Repository</strong>: သင့်ကွန်ပျူတာပေါ်ရှိ Git repository ၏ copy တစ်ခု။</li> <li><strong>Clone</strong>: Remote Git repository တစ်ခု၏ copy ကို local folder တစ်ခုသို့ ကူးယူခြင်း။</li> <li><strong><code>repo.git_pull()</code></strong>: Local repository ကို remote repository မှ နောက်ဆုံးပြောင်းလဲမှုများဖြင့် update လုပ်ရန် method။</li> <li><strong><code>repo.git_add()</code></strong>: Files များကို Git ၏ staging area သို့ ထည့်ရန် method။</li> <li><strong><code>repo.git_commit()</code></strong>: Staged files များကို repository ၏ history သို့ သိမ်းဆည်းရန် method။</li> <li><strong><code>repo.git_push()</code></strong>: Local commits များကို remote repository သို့ ပေးပို့ရန် method။</li> <li><strong><code>repo.git_tag()</code></strong>: Git history တွင် သီးခြားမှတ်တိုင်တစ်ခုကို အမှတ်အသားပြုရန် tag တစ်ခု ဖန်တီးရန် method။</li> <li><strong><code>model.save_pretrained()</code> / <code>tokenizer.save_pretrained()</code></strong>: model သို့မဟုတ် tokenizer ၏ weights နှင့် configuration များကို local folder တစ်ခုသို့ သိမ်းဆည်းရန် method။</li> <li><strong>Staging Area</strong>: Git တွင် commit မလုပ်မီ changes များကို ယာယီသိမ်းဆည်းထားသော နေရာ။</li> <li><strong>Commit</strong>: Git repository ၏ history သို့ changes များကို သိမ်းဆည်းခြင်း။</li> <li><strong>Git-based System</strong>: Git version control system ကို အသုံးပြုထားသော system။</li> <li><strong><code>git lfs install</code></strong>: Git LFS ကို initialize လုပ်ရန် command။</li> <li><strong><code>git clone</code></strong>: Git repository ကို clone လုပ်ရန် command။</li> <li><strong><code>cd</code></strong>: Command line command တစ်ခုဖြစ်ပြီး directory တစ်ခုမှ အခြားတစ်ခုသို့ ပြောင်းလဲရန် အသုံးပြုသည်။</li> <li><strong><code>ls</code></strong>: Command line command တစ်ခုဖြစ်ပြီး လက်ရှိ directory ရှိ ဖိုင်များနှင့် directory များကို ပြသရန် အသုံးပြုသည်။</li> <li><strong>Configuration File</strong>: ဆော့ဖ်ဝဲလ်တစ်ခု၏ setting များနှင့် parameters များကို သိမ်းဆည်းထားသော ဖိုင်။</li> <li><strong>Vocabulary File</strong>: Tokenizer က အသုံးပြုသော tokens များ၏ စာရင်းပါဝင်သော ဖိုင်။</li> <li><strong>Model State Dict File (<code>pytorch_model.bin</code> / <code>tf_model.h5</code>)</strong>: PyTorch သို့မဟုတ် TensorFlow model ၏ weights များကို သိမ်းဆည်းထားသော ဖိုင်။</li> <li><strong><code>ls -lh</code></strong>: File sizes များကို human-readable format ဖြင့် ပြသရန် <code>ls</code> command ၏ option။</li> <li><strong>Outlier</strong>: အများစုနှင့် ကွဲပြားနေသော အရာ။</li> <li><strong>Git’s Staging Environment</strong>: Git တွင် နောက် commit အတွက် ပြင်ဆင်ထားသော changes များရှိရာ နေရာ။</li> <li><strong><code>git add .</code></strong>: လက်ရှိ directory ရှိ changes အားလုံးကို staging area သို့ ထည့်ရန် command။</li> <li><strong><code>git status</code></strong>: လက်ရှိ repository ၏ အခြေအနေ (staged, unstaged, untracked files) ကို ပြသရန် command။</li> <li><strong>Handler</strong>: File အမျိုးအစားတစ်ခုကို စီမံခန့်ခွဲသော ကိရိယာ သို့မဟုတ် လုပ်ငန်းစဉ်။</li> <li><strong>Remote Repository</strong>: Local repository ၏ အွန်လိုင်း (cloud) ပေါ်ရှိ copy။</li> <li><strong><code>git commit -m "Message"</code></strong>: Commit message ပါဝင်သော commit တစ်ခု ပြုလုပ်ရန် command။</li> <li><strong><code>git push</code></strong>: Local commits များကို remote repository သို့ ပေးပို့ရန် command။</li> <li><strong>Uploading LFS Objects</strong>: Git LFS မှ စီမံခန့်ခွဲသော ကြီးမားသော files များကို upload လုပ်ခြင်း။</li> <li><strong>Enumerating Objects</strong>: Git history တွင် object များကို ရေတွက်ခြင်း။</li> <li><strong>Counting Objects</strong>: Git commit history တွင် object များကို ရေတွက်ခြင်း။</li> <li><strong>Delta Compression</strong>: Changes များကိုသာ သိမ်းဆည်းခြင်းဖြင့် file အရွယ်အစားကို လျှော့ချသော နည်းလမ်း။</li> <li><strong>Compressing Objects</strong>: Git object များကို ချုံ့ခြင်း။</li> <li><strong>Writing Objects</strong>: Git database သို့ object များကို ရေးသားခြင်း။</li> <li><strong>Total/Reused/Pack-reused</strong>: Git push လုပ်ငန်းစဉ်၏ အကျဉ်းချုပ် အချက်အလက်များ။</li> <li><strong>UI (User Interface)</strong>: အသုံးပြုသူနှင့် အပြန်အလှန်တုံ့ပြန်နိုင်သော ဂရပ်ဖစ်မျက်နှာပြင်။</li> <li><strong>Commits</strong>: Git repository ၏ history တွင် မှတ်တမ်းတင်ထားသော changes များ။</li> <li><strong>Diffs</strong>: commits နှစ်ခုကြားရှိ ကွာခြားချက်များကို ပြသခြင်း။</li></ul> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/course/blob/main/chapters/my/chapter4/3.mdx" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p> | |
| <script> | |
| { | |
| __sveltekit_tyugt6 = { | |
| assets: "/docs/course/pr_1114/my", | |
| base: "/docs/course/pr_1114/my", | |
| env: {} | |
| }; | |
| const element = document.currentScript.parentElement; | |
| const data = [null,null]; | |
| Promise.all([ | |
| import("/docs/course/pr_1114/my/_app/immutable/entry/start.14794ee9.js"), | |
| import("/docs/course/pr_1114/my/_app/immutable/entry/app.a133f5c6.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 32], | |
| data, | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 139 kB
- Xet hash:
- c4b443130b300c9d2c37adbfa903f421b9d62563e49aafe490dbf4f099d8129f
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.