Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Personalizarea modelelor","local":"personalizarea-modelelor","sections":[{"title":"Configurație","local":"configurație","sections":[],"depth":2},{"title":"Model","local":"model","sections":[],"depth":2},{"title":"AutoClass","local":"autoclass","sections":[],"depth":2},{"title":"Publicare pe Hub","local":"publicare-pe-hub","sections":[],"depth":2}],"depth":1}"/> | |
| <link href="/docs/transformers/main/ro/_app/immutable/entry/start.Cj0_j3du.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/CUCuKvpH.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/Dm_uEeBC.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/entry/app.2x2TdrVN.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/BFzpZI28.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/DM0RASQS.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/DJ5hodCp.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/GYau11Sm.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/nodes/0.BonRETMf.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/B1k23FAg.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/utTYfj_T.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/nodes/9.DY0krN-r.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/BcKuJYrM.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/BGhUAj7r.js" rel="modulepreload"> | |
| <link href="/docs/transformers/main/ro/_app/immutable/chunks/BnB0dYtQ.js" rel="modulepreload"> | |
| <!--1e98kjt--><meta name="hf:doc:metadata" content="{"title":"Personalizarea modelelor","local":"personalizarea-modelelor","sections":[{"title":"Configurație","local":"configurație","sections":[],"depth":2},{"title":"Model","local":"model","sections":[],"depth":2},{"title":"AutoClass","local":"autoclass","sections":[],"depth":2},{"title":"Publicare pe Hub","local":"publicare-pe-hub","sections":[],"depth":2}],"depth":1}"/><!----> | |
| <link href="/docs/transformers/main/ro/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><!--[--><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 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm 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 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" 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-7 max-sm:h-7 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 sm:size-3.5 size-3 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> <!--[-1--><!--]--></div><!----> <!--[0--><h1 class="relative group"><a id="personalizarea-modelelor" 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="#personalizarea-modelelor"><span><svg 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>Personalizarea modelelor</span></h1><!--]--><!----> <p>Modelele Transformers sunt concepute pentru a fi personalizabile. Codul unui model este complet conținut în subfolderul <a href="https://github.com/huggingface/transformers/tree/main/src/transformers/models" rel="nofollow">model</a> al repository-ului Transformers. Fiecare folder conține un fișier <code>modeling.py</code> și un fișier <code>configuration.py</code>. Copiază aceste fișiere pentru a începe personalizarea unui model.</p> <blockquote class="tip"><p>Poate fi mai ușor să începi de la zero dacă creezi un model complet nou. Pentru modele similare cu unul existent în Transformers, este mai rapid să reutilizezi sau să subclasezi aceeași configurație și clasă de model.</p></blockquote> <p>Acest ghid îți va arăta cum să personalizezi un model ResNet, să activezi suportul <a href="./models#autoclass">AutoClass</a> și să-l partajezi pe Hub.</p> <!--[1--><h2 class="relative group"><a id="configurație" 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="#configurație"><span><svg 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>Configurație</span></h2><!--]--><!----> <p>O configurație, furnizată de clasa de bază <code>PreTrainedConfig</code>, conține toate informațiile necesare pentru a construi un model. Acesta este locul unde vei configura atributele modelului ResNet personalizat. Atribute diferite oferă tipuri diferite de modele ResNet.</p> <p>Regulile principale pentru personalizarea unei configurații sunt:</p> <ol><li>O configurație personalizată trebuie să subclaseze <code>PreTrainedConfig</code>. Aceasta asigură că un model personalizat are toate funcționalitățile unui model Transformers, precum <code>from_pretrained()</code>, <code>save_pretrained()</code> și <code>push_to_hub()</code>.</li> <li><code>__init__</code>-ul <code>PreTrainedConfig</code> trebuie să accepte orice <code>kwargs</code> și acestea trebuie pasate <code>__init__</code>-ului superclasei. <code>PreTrainedConfig</code> are mai multe câmpuri decât cele setate în configurația ta personalizată, astfel că atunci când încarci o configurație cu <code>from_pretrained()</code>, acele câmpuri trebuie acceptate de configurația ta și pasate superclasei.</li></ol> <blockquote class="tip"><p>Este util să verifici validitatea unora dintre parametri. În exemplul de mai jos, se implementează o verificare pentru a te asigura că <code>block_type</code> și <code>stem_type</code> aparțin uneia dintre valorile predefinite.</p> <p>Adaugă <code>model_type</code> la clasa de configurație pentru a activa suportul <a href="./models#autoclass">AutoClass</a>.</p></blockquote> <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 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="language-py "><!----><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PreTrainedConfig | |
| <span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">List</span> | |
| <span class="hljs-keyword">class</span> <span class="hljs-title class_">ResnetConfig</span>(<span class="hljs-title class_ inherited__">PreTrainedConfig</span>): | |
| model_type = <span class="hljs-string">"resnet"</span> | |
| <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params"> | |
| self, | |
| block_type=<span class="hljs-string">"bottleneck"</span>, | |
| layers: <span class="hljs-built_in">list</span>[<span class="hljs-built_in">int</span>] = [<span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">6</span>, <span class="hljs-number">3</span>], | |
| num_classes: <span class="hljs-built_in">int</span> = <span class="hljs-number">1000</span>, | |
| input_channels: <span class="hljs-built_in">int</span> = <span class="hljs-number">3</span>, | |
| cardinality: <span class="hljs-built_in">int</span> = <span class="hljs-number">1</span>, | |
| base_width: <span class="hljs-built_in">int</span> = <span class="hljs-number">64</span>, | |
| stem_width: <span class="hljs-built_in">int</span> = <span class="hljs-number">64</span>, | |
| stem_type: <span class="hljs-built_in">str</span> = <span class="hljs-string">""</span>, | |
| avg_down: <span class="hljs-built_in">bool</span> = <span class="hljs-literal">False</span>, | |
| **kwargs, | |
| </span>): | |
| <span class="hljs-keyword">if</span> block_type <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> [<span class="hljs-string">"basic"</span>, <span class="hljs-string">"bottleneck"</span>]: | |
| <span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">f"`block_type` must be 'basic' or bottleneck', got <span class="hljs-subst">{block_type}</span>."</span>) | |
| <span class="hljs-keyword">if</span> stem_type <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> [<span class="hljs-string">""</span>, <span class="hljs-string">"deep"</span>, <span class="hljs-string">"deep-tiered"</span>]: | |
| <span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">f"`stem_type` must be '', 'deep' or 'deep-tiered', got <span class="hljs-subst">{stem_type}</span>."</span>) | |
| <span class="hljs-variable language_">self</span>.block_type = block_type | |
| <span class="hljs-variable language_">self</span>.layers = layers | |
| <span class="hljs-variable language_">self</span>.num_classes = num_classes | |
| <span class="hljs-variable language_">self</span>.input_channels = input_channels | |
| <span class="hljs-variable language_">self</span>.cardinality = cardinality | |
| <span class="hljs-variable language_">self</span>.base_width = base_width | |
| <span class="hljs-variable language_">self</span>.stem_width = stem_width | |
| <span class="hljs-variable language_">self</span>.stem_type = stem_type | |
| <span class="hljs-variable language_">self</span>.avg_down = avg_down | |
| <span class="hljs-built_in">super</span>().__init__(**kwargs)<!----></pre></div><!----> <p>Salvează configurația într-un fișier JSON în folderul modelului personalizat, <code>custom-resnet</code>, cu <code>save_pretrained()</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 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="language-py "><!---->resnet50d_config = ResnetConfig(block_type=<span class="hljs-string">"bottleneck"</span>, stem_width=<span class="hljs-number">32</span>, stem_type=<span class="hljs-string">"deep"</span>, avg_down=<span class="hljs-literal">True</span>) | |
| resnet50d_config.save_pretrained(<span class="hljs-string">"custom-resnet"</span>)<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="model" 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="#model"><span><svg 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</span></h2><!--]--><!----> <p>Cu configurația ResNet personalizată, poți acum crea și personaliza modelul. Modelul subclasează clasa de bază <code>PreTrainedModel</code>. Ca și <code>PreTrainedConfig</code>, moștenirea din <code>PreTrainedModel</code> și inițializarea superclasei cu configurația extinde funcționalitățile Transformers, precum salvarea și încărcarea, la modelul personalizat.</p> <p>Modelele Transformers urmează convenția de a accepta un obiect <code>config</code> în metoda <code>__init__</code>. Acesta pasează întregul <code>config</code> sublayers modelului, în loc să rupă obiectul <code>config</code> în mai multe argumente care sunt pasate individual către sublayers.</p> <p>Scrierea modelelor în acest mod produce cod mai simplu cu o sursă clară de adevăr pentru orice hyperparameters. De asemenea, face mai ușoară reutilizarea codului din alte modele Transformers.</p> <p>Vei crea două modele ResNet: un model ResNet de bază care returnează hidden states și un model ResNet cu un head de clasificare a imaginilor.</p> <div class="flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"><!--[--><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd border-gray-800 bg-black dark:bg-gray-700 text-white">ResnetModel</div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">ResnetModelForImageClassification</div><!--]--></div> <div class="language-select"><!--[--><!--[0--><!--[--><p>Definește o mapare între tipurile de blocuri și clase. Tot restul este creat pasând clasa de configurație clasei modelului ResNet.</p> <blockquote class="tip"><p>Adaugă <code>config_class</code> la clasa de model pentru a activa suportul <a href="#autoclass-support">AutoClass</a>.</p></blockquote> <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 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="language-py "><!----><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PreTrainedModel | |
| <span class="hljs-keyword">from</span> timm.models.resnet <span class="hljs-keyword">import</span> BasicBlock, Bottleneck, ResNet | |
| <span class="hljs-keyword">from</span> .configuration_resnet <span class="hljs-keyword">import</span> ResnetConfig | |
| BLOCK_MAPPING = {<span class="hljs-string">"basic"</span>: BasicBlock, <span class="hljs-string">"bottleneck"</span>: Bottleneck} | |
| <span class="hljs-keyword">class</span> <span class="hljs-title class_">ResnetModel</span>(<span class="hljs-title class_ inherited__">PreTrainedModel</span>): | |
| config_class = ResnetConfig | |
| <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, config</span>): | |
| <span class="hljs-built_in">super</span>().__init__(config) | |
| block_layer = BLOCK_MAPPING[config.block_type] | |
| <span class="hljs-variable language_">self</span>.model = ResNet( | |
| block_layer, | |
| config.layers, | |
| num_classes=config.num_classes, | |
| in_chans=config.input_channels, | |
| cardinality=config.cardinality, | |
| base_width=config.base_width, | |
| stem_width=config.stem_width, | |
| stem_type=config.stem_type, | |
| avg_down=config.avg_down, | |
| ) | |
| <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, tensor</span>): | |
| <span class="hljs-keyword">return</span> <span class="hljs-variable language_">self</span>.model.forward_features(tensor)<!----></pre></div><!----><!--]--><!--]--><!----> <!--[-1--><!--]--><!----><!--]--></div><!----> <p>Un model poate returna orice format de ieșire. Returnarea unui dicționar (ca <code>ResnetModelForImageClassification</code>) cu losses când sunt disponibile labels face modelul personalizat compatibil cu <code>Trainer</code>. Pentru alte formate de ieșire, vei avea nevoie de propriul loop de antrenare sau de o bibliotecă diferită pentru antrenare.</p> <p>Instanțiază clasa modelului personalizat cu configurația.</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 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="language-py "><!---->resnet50d = ResnetModelForImageClassification(resnet50d_config)<!----></pre></div><!----> <p>În acest moment, poți încărca weights pre-antrenate în model sau îl poți antrena de la zero. În acest ghid, vei încărca weights pre-antrenate.</p> <p>Încarcă weights pre-antrenate din biblioteca <a href="https://hf.co/docs/timm/index" rel="nofollow">timm</a>, apoi transferă acele weights modelului personalizat cu <a href="https://pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.load_state_dict" rel="nofollow">load_state_dict</a>.</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 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="language-py "><!----><span class="hljs-keyword">import</span> timm | |
| pretrained_model = timm.create_model(<span class="hljs-string">"resnet50d"</span>, pretrained=<span class="hljs-literal">True</span>) | |
| resnet50d.model.load_state_dict(pretrained_model.state_dict())<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="autoclass" 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="#autoclass"><span><svg 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>AutoClass</span></h2><!--]--><!----> <p>API-ul <a href="./models#clasele-de-model">AutoClass</a> este o scurtătură pentru a încărca automat arhitectura corectă pentru un model dat. Este convenabil să activezi aceasta pentru utilizatorii care încarcă modelul tău personalizat.</p> <p>Asigură-te că ai atributul <code>model_type</code> (trebuie să fie diferit de tipurile de modele existente) în clasa de configurație și atributul <code>config_class</code> în clasa de model. Folosește metoda <code>register()</code> pentru a adăuga configurația și modelul personalizat la API-ul <a href="./models#clasele-de-model">AutoClass</a>.</p> <blockquote class="tip"><p>Primul argument al <code>AutoConfig.register()</code> trebuie să corespundă atributului <code>model_type</code> din clasa de configurație personalizată, iar primul argument al <code>AutoModel.register()</code> trebuie să corespundă <code>config_class</code>-ului clasei modelului personalizat.</p></blockquote> <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 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="language-py "><!----><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoConfig, AutoModel, AutoModelForImageClassification | |
| AutoConfig.register(<span class="hljs-string">"resnet"</span>, ResnetConfig) | |
| AutoModel.register(ResnetConfig, ResnetModel) | |
| AutoModelForImageClassification.register(ResnetConfig, ResnetModelForImageClassification)<!----></pre></div><!----> <p>Codul modelului tău personalizat este acum compatibil cu API-ul <a href="./models#autoclass">AutoClass</a>. Utilizatorii pot încărca modelul cu clasele [AutoModel] sau <code>AutoModelForImageClassification</code>.</p> <!--[1--><h2 class="relative group"><a id="publicare-pe-hub" 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="#publicare-pe-hub"><span><svg 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>Publicare pe Hub</span></h2><!--]--><!----> <p>Publică un model personalizat pe <a href="https://hf.co/models" rel="nofollow">Hub</a> pentru a permite altor utilizatori să îl încarce și utilizeze cu ușurință.</p> <p>Asigură-te că directorul modelului este structurat corect, după cum se arată mai jos. Directorul ar trebui să conțină:</p> <ul><li><code>modeling.py</code>: Conține codul pentru <code>ResnetModel</code> și <code>ResnetModelForImageClassification</code>. Acest fișier poate utiliza importuri relative la alte fișiere atât timp cât se află în același director.</li></ul> <blockquote class="warning"><p>Când copiezi un fișier de model Transformers, înlocuiește toate importurile relative din partea de sus a fișierului <code>modeling.py</code> pentru a importa din Transformers.</p></blockquote> <ul><li><code>configuration.py</code>: Conține codul pentru <code>ResnetConfig</code>.</li> <li><code>__init__.py</code>: Poate fi gol; acest fișier permite utilizarea <code>resnet_model</code> ca modul Python.</li></ul> <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 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="language-bash "><!---->. | |
| └── resnet_model | |
| ├── __init__.py | |
| ├── configuration_resnet.py | |
| └── modeling_resnet.py<!----></pre></div><!----> <p>Pentru a partaja modelul, importă modelul ResNet și configurația.</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 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="language-py "><!----><span class="hljs-keyword">from</span> resnet_model.configuration_resnet <span class="hljs-keyword">import</span> ResnetConfig | |
| <span class="hljs-keyword">from</span> resnet_model.modeling_resnet <span class="hljs-keyword">import</span> ResnetModel, ResnetModelForImageClassification<!----></pre></div><!----> <p>Copiază codul din fișierele de model și configurație. Pentru a te asigura că obiectele AutoClass sunt salvate cu <code>save_pretrained()</code>, apelează metoda <code>register_for_auto_class()</code>. Aceasta modifică fișierul JSON de configurație pentru a include obiectele AutoClass și maparea.</p> <p>Pentru un model, alege clasa <code>AutoModelFor</code> corespunzătoare pe baza task-ului.</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 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="language-py "><!---->ResnetConfig.register_for_auto_class() | |
| ResnetModel.register_for_auto_class(<span class="hljs-string">"AutoModel"</span>) | |
| ResnetModelForImageClassification.register_for_auto_class(<span class="hljs-string">"AutoModelForImageClassification"</span>)<!----></pre></div><!----> <p>Pentru a mapa mai mult de un task la model, editează <code>auto_map</code> direct în fișierul JSON de configurație.</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 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="language-json "><!----><span class="hljs-attr">"auto_map"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"AutoConfig"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"<your-repo-name>--<config-name>"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"AutoModel"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"<your-repo-name>--<config-name>"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"AutoModelFor<Task>"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"<your-repo-name>--<config-name>"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span><!----></pre></div><!----> <p>Creează configurația și modelul și încarcă weights pre-antrenate în acesta.</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 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="language-py "><!---->resnet50d_config = ResnetConfig(block_type=<span class="hljs-string">"bottleneck"</span>, stem_width=<span class="hljs-number">32</span>, stem_type=<span class="hljs-string">"deep"</span>, avg_down=<span class="hljs-literal">True</span>) | |
| resnet50d = ResnetModelForImageClassification(resnet50d_config) | |
| pretrained_model = timm.create_model(<span class="hljs-string">"resnet50d"</span>, pretrained=<span class="hljs-literal">True</span>) | |
| resnet50d.model.load_state_dict(pretrained_model.state_dict())<!----></pre></div><!----> <p>Modelul este acum gata să fie publicat pe Hub. Autentifică-te în contul tău Hugging Face din linia de comandă sau notebook.</p> <div class="flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"><!--[--><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd border-gray-800 bg-black dark:bg-gray-700 text-white">huggingface-CLI</div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">notebook</div><!--]--></div> <div class="language-select"><!--[--><!--[0--><!--[--><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 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="language-bash "><!---->hf auth login<!----></pre></div><!--]--><!--]--><!----> <!--[-1--><!--]--><!----><!--]--></div><!----> <p>Apelează <code>push_to_hub()</code> pe model pentru a-l publica pe Hub.</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 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="language-py "><!---->resnet50d.push_to_hub(<span class="hljs-string">"custom-resnet50d"</span>)<!----></pre></div><!----> <p>Weights pre-antrenate, configurația și fișierele <code>modeling.py</code> și <code>configuration.py</code> ar trebui acum să fie toate publicate pe Hub într-un <a href="https://hf.co/sgugger/custom-resnet50d" rel="nofollow">repository</a> sub namespace-ul tău.</p> <p>Deoarece un model personalizat nu utilizează același cod de modelare ca un model Transformers, trebuie să adaugi <code>trust_remote_code=True</code> în <code>from_pretrained()</code> pentru a-l încărca. Consultă secțiunea <a href="./models#modele-personalizate">modele personalizate</a> pentru mai multe informații.</p> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/transformers/blob/main/docs/source/ro/custom_models.md" 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><span class="underline">Update</span> on GitHub</span></a><!----> <p></p><!--]--><!--]--><!--]--><!--]--><!--]--> <!--[-1--><!--]--><!--]--> | |
| <script> | |
| { | |
| __sveltekit_1piag1k = { | |
| base: "/docs/transformers/main/ro", | |
| assets: "/docs/transformers/main/ro" | |
| }; | |
| const element = document.currentScript.parentElement; | |
| Promise.all([ | |
| import("/docs/transformers/main/ro/_app/immutable/entry/start.Cj0_j3du.js"), | |
| import("/docs/transformers/main/ro/_app/immutable/entry/app.2x2TdrVN.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 9], | |
| data: [null,null], | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 46.1 kB
- Xet hash:
- 2ba967cabec8bc0afb35f5196f75bc1eba0d08c650f8c90ee3b9a2b2543b5c65
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.