Buckets:

rtrm's picture
download
raw
39.1 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;परिचय&quot;,&quot;local&quot;:&quot;परचय&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Google Colab नोटबुक प्रयोग गर्ने तरिका&quot;,&quot;local&quot;:&quot;google-colab-नटबक-परयग-गरन-तरक&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Python भर्चुअल इन्भाइरोमेन्ट प्रयोग&quot;,&quot;local&quot;:&quot;python-भरचअल-इनभइरमनट-परयग&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;डिपेन्डेन्सीहरू इन्स्टल गर्ने&quot;,&quot;local&quot;:&quot;डपनडनसहर-इनसटल-गरन&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/course/pr_1114/ne/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/entry/start.2523848f.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/chunks/scheduler.5efbf6a1.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/chunks/singletons.b6c35089.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/chunks/paths.07cb6747.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/entry/app.5e6be4b0.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/chunks/preload-helper.7f0621af.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/chunks/index.b881fadd.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/nodes/0.cd885449.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/nodes/2.647090d3.js">
<link rel="modulepreload" href="/docs/course/pr_1114/ne/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.c508b81e.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;परिचय&quot;,&quot;local&quot;:&quot;परचय&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Google Colab नोटबुक प्रयोग गर्ने तरिका&quot;,&quot;local&quot;:&quot;google-colab-नटबक-परयग-गरन-तरक&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Python भर्चुअल इन्भाइरोमेन्ट प्रयोग&quot;,&quot;local&quot;:&quot;python-भरचअल-इनभइरमनट-परयग&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;डिपेन्डेन्सीहरू इन्स्टल गर्ने&quot;,&quot;local&quot;:&quot;डपनडनसहर-इनसटल-गरन&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <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="परचय" 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="#परचय"><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>परिचय</span></h1> <p data-svelte-h="svelte-12352u4">नमस्कार! Hugging Face कोर्समा स्वागत छ! यो परिचयले तपाईंलाई काम गर्ने वातावरण सेट गर्न सिकाउँछ। यदि तपाईं भर्खरै कोर्स सुरु गर्दै हुनुहुन्छ भने, हामी सुझाव दिन्छौं कि पहिले <a href="/course/chapter1">अध्याय १</a> हेर्नुहोस्, अनि फर्केर आफ्नो वातावरण सेट गर्नुहोस् ताकि तपाईं आफैं कोड गर्न सक्नुहुनेछ।</p> <p data-svelte-h="svelte-10wiij3">यो कोर्समा हामीले प्रयोग गर्ने सबै लाइब्रेरीहरू Python प्याकेजको रूपमा पाइन्छ। यहाँ हामी तपाईंलाई Python वातावरण कसरी सेट गर्ने र चाहिने लाइब्रेरीहरू कसरी इन्स्टल गर्ने भनेर देखाउँछौं।</p> <p data-svelte-h="svelte-102qtcr">तपाईंको काम गर्ने वातावरण सेट गर्न दुईवटा तरिका छन् - Colab नोटबुक वा Python भर्चुअल इन्भाइरोमेन्ट। जुन तरिका तपाईंलाई ठिक लाग्छ त्यही रोज्न सक्नुहुन्छ। नयाँ सिकारुहरूलाई चाहिँ Colab नोटबुकबाट सुरु गर्न सल्लाह दिन्छौं।</p> <p data-svelte-h="svelte-165d3to">याद गर्नुहोस्, हामी Windows सिस्टमको बारेमा केही बताउँदैनौं। Windows चलाइरहनुभएको छ भने Colab नोटबुक प्रयोग गर्नुहोस्। Linux वा macOS चलाइरहनुभएको छ भने माथिका दुवै तरिका प्रयोग गर्न सक्नुहुन्छ।</p> <p data-svelte-h="svelte-pwrhw4">यो कोर्सको धेरैजसो भागमा Hugging Face अकाउन्ट चाहिन्छ। अहिले नै एउटा बनाउनुहोस्: <a href="https://huggingface.co/join" rel="nofollow">अकाउन्ट बनाउनुहोस्</a></p> <h2 class="relative group"><a id="google-colab-नटबक-परयग-गरन-तरक" 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="#google-colab-नटबक-परयग-गरन-तरक"><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>Google Colab नोटबुक प्रयोग गर्ने तरिका</span></h2> <p data-svelte-h="svelte-vwzahg">Colab नोटबुक प्रयोग गर्नु सबैभन्दा सजिलो तरिका हो। ब्राउजरमा नोटबुक खोल्नुहोस् र सिधै कोडिङ सुरु गर्नुहोस्!</p> <p data-svelte-h="svelte-14w7a4">Colab बारे थाहा छैन भने, <a href="https://colab.research.google.com/notebooks/intro.ipynb" rel="nofollow">परिचय</a> हेरेर सुरु गर्नुहोस्। Colab मा GPUs वा TPUs जस्ता छिटो चल्ने हार्डवेयर पनि प्रयोग गर्न पाइन्छ, र साना कामहरूका लागि सित्तैमा पाइन्छ।</p> <p data-svelte-h="svelte-1uuu6ne">Colab मा काम गर्न सजिलो लाग्यो भने, नयाँ नोटबुक बनाएर सेटअप सुरु गर्नुहोस्।</p> <div class="flex justify-center" data-svelte-h="svelte-pln388"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter0/new_colab.png" alt="खाली Colab नोटबुक" width="80%"></div> <p data-svelte-h="svelte-1r4c8tj">अब हामीलाई चाहिने लाइब्रेरीहरू इन्स्टल गर्नुपर्छ। यसको लागि हामी Python को प्याकेज म्यानेजर <code>pip</code> प्रयोग गर्छौं। नोटबुकमा सिस्टम कमाण्डहरू चलाउन <code>!</code> चिन्ह लगाउनुपर्छ। त्यसैले 🤗 Transformers लाइब्रेरी यसरी इन्स्टल गर्न सकिन्छ:</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 -->!pip <span class="hljs-keyword">install</span> transformers <!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1gx4res">लाइब्रेरी राम्रोसँग इन्स्टल भयो कि भएन जाँच गर्न Python मा import गरेर हेर्न सक्नुहुन्छ:</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">import</span> transformers<!-- HTML_TAG_END --></pre></div> <div class="flex justify-center" data-svelte-h="svelte-t9vq72"><img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter0/install.gif" alt="माथिका दुई कमाण्डको नतिजा देखाउने GIF: installation र import" width="80%"></div> <p data-svelte-h="svelte-163kyrn">यसले 🤗 Transformers को सबैभन्दा हल्का भर्जन इन्स्टल गर्छ। यसमा PyTorch वा TensorFlow जस्ता मेशिन लर्निङ फ्रेमवर्कहरू समावेश हुँदैनन्। किनभने हामी लाइब्रेरीका धेरै फिचरहरू प्रयोग गर्नेछौं, हामी डेभलपमेन्ट भर्जन इन्स्टल गर्न सुझाव दिन्छौं, जसमा सबै आवश्यक डिपेन्डेन्सीहरू समावेश छन्:</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 -->!pip <span class="hljs-keyword">install</span> transformers[sentencepiece] <!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-ru0tf7">यसले केही समय लिन्छ, तर त्यसपछि तपाईं कोर्सको बाँकी भागको लागि तयार हुनुहुनेछ!</p> <h2 class="relative group"><a id="python-भरचअल-इनभइरमनट-परयग" 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="#python-भरचअल-इनभइरमनट-परयग"><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>Python भर्चुअल इन्भाइरोमेन्ट प्रयोग</span></h2> <p data-svelte-h="svelte-sjmzu4">यदि तपाईं Python भर्चुअल इन्भाइरोमेन्ट प्रयोग गर्न चाहनुहुन्छ भने, पहिलो चरणमा आफ्नो सिस्टममा Python इन्स्टल गर्नुपर्छ। सुरु गर्नको लागि <a href="https://realpython.com/installing-python/" rel="nofollow">यो गाइड</a> हेर्न सुझाव दिन्छौं।</p> <p data-svelte-h="svelte-z3bxzu">Python इन्स्टल गरिसकेपछि, तपाईंले टर्मिनलमा Python कमाण्डहरू चलाउन सक्नुहुनेछ। सुरुमा यो कमाण्ड चलाएर Python ठीकसँग इन्स्टल भएको छ कि छैन जाँच गर्न सक्नुहुन्छ: <code>python --version</code>। यसले तपाईंको सिस्टममा भएको Python को भर्जन देखाउनुपर्छ।</p> <p data-svelte-h="svelte-l0zhnf">जब तपाईं <code>python --version</code> जस्तो कमाण्ड चलाउनुहुन्छ, त्यो तपाईंको सिस्टमको “मुख्य” Python ले चलाएको हो भन्ने बुझ्नुपर्छ। हामी सुझाव दिन्छौं कि यो मुख्य इन्स्टलेसनलाई खाली राख्नुहोस्, र हरेक एप्लिकेसनको लागि छुट्टै इन्भाइरोमेन्ट बनाउनुहोस् - यसरी हरेक एप्लिकेसनको आफ्नै डिपेन्डेन्सी र प्याकेजहरू हुन्छ र अरु एप्लिकेसनहरूसँग कम्प्याटिबिलिटी समस्या आउँदैन।</p> <p data-svelte-h="svelte-1h3brb3">Python मा यो <a href="https://docs.python.org/3/tutorial/venv.html" rel="nofollow"><em>भर्चुअल इन्भाइरोमेन्ट</em></a> को माध्यमबाट गरिन्छ, जुन एउटा छुट्टै डाइरेक्टरी हो जसमा निश्चित Python भर्जन र एप्लिकेसनलाई चाहिने सबै प्याकेजहरू हुन्छन्। यस्तो भर्चुअल इन्भाइरोमेन्ट धेरै टूलहरूले बनाउन सक्छन्, तर हामी<br>
अफिसियल Python प्याकेज <a href="https://docs.python.org/3/library/venv.html#module-venv" rel="nofollow"><code>venv</code></a> प्रयोग गर्छौं।</p> <p data-svelte-h="svelte-ww21gv">पहिले, आफ्नो एप्लिकेसन राख्ने डाइरेक्टरी बनाउनुहोस् - उदाहरणको लागि, होम डाइरेक्टरीमा <em>transformers-course</em> नामको नयाँ फोल्डर:</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">mkdir</span> ~/transformers-course
<span class="hljs-built_in">cd</span> ~/transformers-course <!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-88987d">यो डाइरेक्टरीभित्र, Python को <code>venv</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">python</span> -m venv .<span class="hljs-keyword">env</span> <!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-8zwney">अब तपाईंको खाली फोल्डरमा <em>.env</em> नामको डाइरेक्टरी हुनुपर्छ:</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> -a <!-- 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 -->. <span class="hljs-string">..</span> <span class="hljs-string">.env</span> <!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-18jm66l">तपाईं activate र deactivate स्क्रिप्टहरू प्रयोग गरेर भर्चुअल इन्भाइरोमेन्टमा प्रवेश र बाहिर निस्कन सक्नुहुन्छ:</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-comment"># भर्चुअल इन्भाइरोमेन्ट सक्रिय गर्न </span>
<span class="hljs-built_in">source</span> .<span class="hljs-built_in">env</span>/bin/activate
<span class="hljs-comment"># भर्चुअल इन्भाइरोमेन्ट निष्क्रिय गर्न </span>
deactivate<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-tot679">इन्भाइरोमेन्ट सक्रिय भएको छ कि छैन जाँच गर्न <code>which python</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-built_in">which</span> python <!-- 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 --><span class="hljs-regexp">/home/</span>&lt;user&gt;<span class="hljs-regexp">/transformers-course/</span>.env<span class="hljs-regexp">/bin/</span>python <!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="डपनडनसहर-इनसटल-गरन" 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="#डपनडनसहर-इनसटल-गरन"><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>डिपेन्डेन्सीहरू इन्स्टल गर्ने</span></h3> <p data-svelte-h="svelte-13qgqgi">अघिल्लो Google Colab खण्डमा जस्तै, अब तपाईंले आवश्यक प्याकेजहरू इन्स्टल गर्नुपर्छ। फेरि पनि, pip प्याकेज म्यानेजर प्रयोग गरेर 🤗 Transformers को डेभलपमेन्ट भर्जन इन्स्टल गर्न सक्नुहुन्छ:</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 -->pip <span class="hljs-keyword">install</span> <span class="hljs-string">&quot;transformers[sentencepiece]&quot;</span> <!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1qfg7nr">अब तपाईंको सेटअप पूरा भयो र तपाईं अगाडि बढ्न तयार हुनुहुन्छ!</p> <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/ne/chapter0/1.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_lju6xc = {
assets: "/docs/course/pr_1114/ne",
base: "/docs/course/pr_1114/ne",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/course/pr_1114/ne/_app/immutable/entry/start.2523848f.js"),
import("/docs/course/pr_1114/ne/_app/immutable/entry/app.5e6be4b0.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 2],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
39.1 kB
·
Xet hash:
bbaa76dddcecbd2be25465cac46e1b34700b5540f0ec10988d5a8200ff6066ec

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.