Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"models","local":"models","sections":[{"title":"models.AutoModel","local":"modelsautomodel","sections":[{"title":"new AutoModel()","local":"new-automodel","sections":[],"depth":3},{"title":"autoModel.MODEL_CLASS_MAPPINGS : Array. < Map >","local":"automodelmodelclassmappings--array--map-","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForSequenceClassification","local":"modelsautomodelforsequenceclassification","sections":[{"title":"new AutoModelForSequenceClassification()","local":"new-automodelforsequenceclassification","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForTokenClassification","local":"modelsautomodelfortokenclassification","sections":[{"title":"new AutoModelForTokenClassification()","local":"new-automodelfortokenclassification","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForSeq2SeqLM","local":"modelsautomodelforseq2seqlm","sections":[{"title":"new AutoModelForSeq2SeqLM()","local":"new-automodelforseq2seqlm","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForSpeechSeq2Seq","local":"modelsautomodelforspeechseq2seq","sections":[{"title":"new AutoModelForSpeechSeq2Seq()","local":"new-automodelforspeechseq2seq","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForTextToSpectrogram","local":"modelsautomodelfortexttospectrogram","sections":[{"title":"new AutoModelForTextToSpectrogram()","local":"new-automodelfortexttospectrogram","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForTextToWaveform","local":"modelsautomodelfortexttowaveform","sections":[{"title":"new AutoModelForTextToWaveform()","local":"new-automodelfortexttowaveform","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForCausalLM","local":"modelsautomodelforcausallm","sections":[{"title":"new AutoModelForCausalLM()","local":"new-automodelforcausallm","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForMaskedLM","local":"modelsautomodelformaskedlm","sections":[{"title":"new AutoModelForMaskedLM()","local":"new-automodelformaskedlm","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForQuestionAnswering","local":"modelsautomodelforquestionanswering","sections":[{"title":"new AutoModelForQuestionAnswering()","local":"new-automodelforquestionanswering","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForVision2Seq","local":"modelsautomodelforvision2seq","sections":[{"title":"new AutoModelForVision2Seq()","local":"new-automodelforvision2seq","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForImageClassification","local":"modelsautomodelforimageclassification","sections":[{"title":"new AutoModelForImageClassification()","local":"new-automodelforimageclassification","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForImageSegmentation","local":"modelsautomodelforimagesegmentation","sections":[{"title":"new AutoModelForImageSegmentation()","local":"new-automodelforimagesegmentation","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForSemanticSegmentation","local":"modelsautomodelforsemanticsegmentation","sections":[{"title":"new AutoModelForSemanticSegmentation()","local":"new-automodelforsemanticsegmentation","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForUniversalSegmentation","local":"modelsautomodelforuniversalsegmentation","sections":[{"title":"new AutoModelForUniversalSegmentation()","local":"new-automodelforuniversalsegmentation","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForObjectDetection","local":"modelsautomodelforobjectdetection","sections":[{"title":"new AutoModelForObjectDetection()","local":"new-automodelforobjectdetection","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForMaskGeneration","local":"modelsautomodelformaskgeneration","sections":[{"title":"new AutoModelForMaskGeneration()","local":"new-automodelformaskgeneration","sections":[],"depth":3}],"depth":2},{"title":"models~PretrainedMixin","local":"modelspretrainedmixin","sections":[{"title":"pretrainedMixin.MODEL_CLASS_MAPPINGS : Array. < Map >","local":"pretrainedmixinmodelclassmappings--array--map-","sections":[],"depth":3},{"title":"pretrainedMixin.BASE_IF_FAIL","local":"pretrainedmixinbaseiffail","sections":[],"depth":3},{"title":"PretrainedMixin.supports(model_type) ⇒ boolean","local":"pretrainedmixinsupportsmodeltype--boolean","sections":[],"depth":3},{"title":"PretrainedMixin.from_pretrained() : Object.from_pretrained","local":"pretrainedmixinfrompretrained--objectfrompretrained","sections":[],"depth":3}],"depth":2}],"depth":1}"> | |
| <link href="/docs/transformers.js/pr_1649/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/entry/start.5f753a22.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/scheduler.6efaaf90.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/singletons.c0807d75.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/paths.c5938264.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/entry/app.db3dfcb7.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/preload-helper.1d8e1e5d.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/index.eb3e1f0f.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/nodes/0.1b727385.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/each.e59479a4.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/nodes/11.e9127229.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.16f13047.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/CodeBlock.72c8dd07.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{"title":"models","local":"models","sections":[{"title":"models.AutoModel","local":"modelsautomodel","sections":[{"title":"new AutoModel()","local":"new-automodel","sections":[],"depth":3},{"title":"autoModel.MODEL_CLASS_MAPPINGS : Array. < Map >","local":"automodelmodelclassmappings--array--map-","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForSequenceClassification","local":"modelsautomodelforsequenceclassification","sections":[{"title":"new AutoModelForSequenceClassification()","local":"new-automodelforsequenceclassification","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForTokenClassification","local":"modelsautomodelfortokenclassification","sections":[{"title":"new AutoModelForTokenClassification()","local":"new-automodelfortokenclassification","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForSeq2SeqLM","local":"modelsautomodelforseq2seqlm","sections":[{"title":"new AutoModelForSeq2SeqLM()","local":"new-automodelforseq2seqlm","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForSpeechSeq2Seq","local":"modelsautomodelforspeechseq2seq","sections":[{"title":"new AutoModelForSpeechSeq2Seq()","local":"new-automodelforspeechseq2seq","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForTextToSpectrogram","local":"modelsautomodelfortexttospectrogram","sections":[{"title":"new AutoModelForTextToSpectrogram()","local":"new-automodelfortexttospectrogram","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForTextToWaveform","local":"modelsautomodelfortexttowaveform","sections":[{"title":"new AutoModelForTextToWaveform()","local":"new-automodelfortexttowaveform","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForCausalLM","local":"modelsautomodelforcausallm","sections":[{"title":"new AutoModelForCausalLM()","local":"new-automodelforcausallm","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForMaskedLM","local":"modelsautomodelformaskedlm","sections":[{"title":"new AutoModelForMaskedLM()","local":"new-automodelformaskedlm","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForQuestionAnswering","local":"modelsautomodelforquestionanswering","sections":[{"title":"new AutoModelForQuestionAnswering()","local":"new-automodelforquestionanswering","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForVision2Seq","local":"modelsautomodelforvision2seq","sections":[{"title":"new AutoModelForVision2Seq()","local":"new-automodelforvision2seq","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForImageClassification","local":"modelsautomodelforimageclassification","sections":[{"title":"new AutoModelForImageClassification()","local":"new-automodelforimageclassification","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForImageSegmentation","local":"modelsautomodelforimagesegmentation","sections":[{"title":"new AutoModelForImageSegmentation()","local":"new-automodelforimagesegmentation","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForSemanticSegmentation","local":"modelsautomodelforsemanticsegmentation","sections":[{"title":"new AutoModelForSemanticSegmentation()","local":"new-automodelforsemanticsegmentation","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForUniversalSegmentation","local":"modelsautomodelforuniversalsegmentation","sections":[{"title":"new AutoModelForUniversalSegmentation()","local":"new-automodelforuniversalsegmentation","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForObjectDetection","local":"modelsautomodelforobjectdetection","sections":[{"title":"new AutoModelForObjectDetection()","local":"new-automodelforobjectdetection","sections":[],"depth":3}],"depth":2},{"title":"models.AutoModelForMaskGeneration","local":"modelsautomodelformaskgeneration","sections":[{"title":"new AutoModelForMaskGeneration()","local":"new-automodelformaskgeneration","sections":[],"depth":3}],"depth":2},{"title":"models~PretrainedMixin","local":"modelspretrainedmixin","sections":[{"title":"pretrainedMixin.MODEL_CLASS_MAPPINGS : Array. < Map >","local":"pretrainedmixinmodelclassmappings--array--map-","sections":[],"depth":3},{"title":"pretrainedMixin.BASE_IF_FAIL","local":"pretrainedmixinbaseiffail","sections":[],"depth":3},{"title":"PretrainedMixin.supports(model_type) ⇒ boolean","local":"pretrainedmixinsupportsmodeltype--boolean","sections":[],"depth":3},{"title":"PretrainedMixin.from_pretrained() : Object.from_pretrained","local":"pretrainedmixinfrompretrained--objectfrompretrained","sections":[],"depth":3}],"depth":2}],"depth":1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <a id="module_models" class="group"></a> <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> </div> <h1 class="relative group"><a id="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="#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>models</span></h1> <p data-svelte-h="svelte-1suplhp">Definitions of all models available in Transformers.js.</p> <p data-svelte-h="svelte-1k8gtid"><strong>Example:</strong> Load and run an <code>AutoModel</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">import</span> { <span class="hljs-title class_">AutoModel</span>, <span class="hljs-title class_">AutoTokenizer</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'@huggingface/transformers'</span>; | |
| <span class="hljs-keyword">const</span> tokenizer = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoTokenizer</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/bert-base-uncased'</span>); | |
| <span class="hljs-keyword">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModel</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/bert-base-uncased'</span>); | |
| <span class="hljs-keyword">const</span> inputs = <span class="hljs-keyword">await</span> <span class="hljs-title function_">tokenizer</span>(<span class="hljs-string">'I love transformers!'</span>); | |
| <span class="hljs-keyword">const</span> { logits } = <span class="hljs-keyword">await</span> <span class="hljs-title function_">model</span>(inputs); | |
| <span class="hljs-comment">// Tensor {</span> | |
| <span class="hljs-comment">// data: Float32Array(183132) [-7.117443084716797, -7.107812881469727, -7.092104911804199, ...]</span> | |
| <span class="hljs-comment">// dims: (3) [1, 6, 30522],</span> | |
| <span class="hljs-comment">// type: "float32",</span> | |
| <span class="hljs-comment">// size: 183132,</span> | |
| <span class="hljs-comment">// }</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1tjmd7w">We also provide other <code>AutoModel</code>s (listed below), which you can use in the same way as the Python library. For example:</p> <p data-svelte-h="svelte-1scuial"><strong>Example:</strong> Load and run an <code>AutoModelForSeq2SeqLM</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">import</span> { <span class="hljs-title class_">AutoModelForSeq2SeqLM</span>, <span class="hljs-title class_">AutoTokenizer</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">'@huggingface/transformers'</span>; | |
| <span class="hljs-keyword">const</span> tokenizer = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoTokenizer</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/t5-small'</span>); | |
| <span class="hljs-keyword">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForSeq2SeqLM</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/t5-small'</span>); | |
| <span class="hljs-keyword">const</span> { input_ids } = <span class="hljs-keyword">await</span> <span class="hljs-title function_">tokenizer</span>(<span class="hljs-string">'translate English to German: I love transformers!'</span>); | |
| <span class="hljs-keyword">const</span> outputs = <span class="hljs-keyword">await</span> model.<span class="hljs-title function_">generate</span>(input_ids); | |
| <span class="hljs-keyword">const</span> decoded = tokenizer.<span class="hljs-title function_">decode</span>(outputs[<span class="hljs-number">0</span>], { <span class="hljs-attr">skip_special_tokens</span>: <span class="hljs-literal">true</span> }); | |
| <span class="hljs-comment">// 'Ich liebe Transformatoren!'</span><!-- HTML_TAG_END --></pre></div> <ul data-svelte-h="svelte-170ggb6"><li><a href="#module_models">models</a> <ul><li><em>static</em> <ul><li><a href="#module_models.AutoModel">.AutoModel</a> <ul><li><a href="#new_module_models.AutoModel_new"><code>new AutoModel()</code></a></li> <li><a href="#module_models.AutoModel+MODEL_CLASS_MAPPINGS"><code>.MODEL_CLASS_MAPPINGS</code></a> : <code>Array.<Map></code></li></ul></li> <li><a href="#module_models.AutoModelForSequenceClassification">.AutoModelForSequenceClassification</a> <ul><li><a href="#new_module_models.AutoModelForSequenceClassification_new"><code>new AutoModelForSequenceClassification()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForTokenClassification">.AutoModelForTokenClassification</a> <ul><li><a href="#new_module_models.AutoModelForTokenClassification_new"><code>new AutoModelForTokenClassification()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForSeq2SeqLM">.AutoModelForSeq2SeqLM</a> <ul><li><a href="#new_module_models.AutoModelForSeq2SeqLM_new"><code>new AutoModelForSeq2SeqLM()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForSpeechSeq2Seq">.AutoModelForSpeechSeq2Seq</a> <ul><li><a href="#new_module_models.AutoModelForSpeechSeq2Seq_new"><code>new AutoModelForSpeechSeq2Seq()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForTextToSpectrogram">.AutoModelForTextToSpectrogram</a> <ul><li><a href="#new_module_models.AutoModelForTextToSpectrogram_new"><code>new AutoModelForTextToSpectrogram()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForTextToWaveform">.AutoModelForTextToWaveform</a> <ul><li><a href="#new_module_models.AutoModelForTextToWaveform_new"><code>new AutoModelForTextToWaveform()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForCausalLM">.AutoModelForCausalLM</a> <ul><li><a href="#new_module_models.AutoModelForCausalLM_new"><code>new AutoModelForCausalLM()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForMaskedLM">.AutoModelForMaskedLM</a> <ul><li><a href="#new_module_models.AutoModelForMaskedLM_new"><code>new AutoModelForMaskedLM()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForQuestionAnswering">.AutoModelForQuestionAnswering</a> <ul><li><a href="#new_module_models.AutoModelForQuestionAnswering_new"><code>new AutoModelForQuestionAnswering()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForVision2Seq">.AutoModelForVision2Seq</a> <ul><li><a href="#new_module_models.AutoModelForVision2Seq_new"><code>new AutoModelForVision2Seq()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForImageClassification">.AutoModelForImageClassification</a> <ul><li><a href="#new_module_models.AutoModelForImageClassification_new"><code>new AutoModelForImageClassification()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForImageSegmentation">.AutoModelForImageSegmentation</a> <ul><li><a href="#new_module_models.AutoModelForImageSegmentation_new"><code>new AutoModelForImageSegmentation()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForSemanticSegmentation">.AutoModelForSemanticSegmentation</a> <ul><li><a href="#new_module_models.AutoModelForSemanticSegmentation_new"><code>new AutoModelForSemanticSegmentation()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForUniversalSegmentation">.AutoModelForUniversalSegmentation</a> <ul><li><a href="#new_module_models.AutoModelForUniversalSegmentation_new"><code>new AutoModelForUniversalSegmentation()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForObjectDetection">.AutoModelForObjectDetection</a> <ul><li><a href="#new_module_models.AutoModelForObjectDetection_new"><code>new AutoModelForObjectDetection()</code></a></li></ul></li> <li><a href="#module_models.AutoModelForMaskGeneration">.AutoModelForMaskGeneration</a> <ul><li><a href="#new_module_models.AutoModelForMaskGeneration_new"><code>new AutoModelForMaskGeneration()</code></a></li></ul></li></ul></li> <li><em>inner</em> <ul><li><a href="#module_models..PretrainedMixin">~PretrainedMixin</a> <ul><li><em>instance</em> <ul><li><a href="#module_models..PretrainedMixin+MODEL_CLASS_MAPPINGS"><code>.MODEL_CLASS_MAPPINGS</code></a> : <code>Array.<Map></code></li> <li><a href="#module_models..PretrainedMixin+BASE_IF_FAIL"><code>.BASE_IF_FAIL</code></a></li></ul></li> <li><em>static</em> <ul><li><a href="#module_models..PretrainedMixin.supports"><code>.supports(model_type)</code></a> ⇒ <code>boolean</code></li> <li><a href="#module_models..PretrainedMixin.from_pretrained"><code>.from_pretrained()</code></a> : <code>Object.from_pretrained</code></li></ul></li></ul></li></ul></li></ul></li></ul> <hr> <a id="module_models.AutoModel" class="group"></a> <h2 class="relative group"><a id="modelsautomodel" 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="#modelsautomodel"><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>models.AutoModel</span></h2> <p data-svelte-h="svelte-18t20xk">Helper class which is used to instantiate pretrained models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <ul data-svelte-h="svelte-kay585"><li><a href="#module_models.AutoModel">.AutoModel</a> <ul><li><a href="#new_module_models.AutoModel_new"><code>new AutoModel()</code></a></li> <li><a href="#module_models.AutoModel+MODEL_CLASS_MAPPINGS"><code>.MODEL_CLASS_MAPPINGS</code></a> : <code>Array.<Map></code></li></ul></li></ul> <hr> <a id="new_module_models.AutoModel_new" class="group"></a> <h3 class="relative group"><a id="new-automodel" 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="#new-automodel"><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>new AutoModel()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModel</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/bert-base-uncased'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModel+MODEL_CLASS_MAPPINGS" class="group"></a> <h3 class="relative group"><a id="automodelmodelclassmappings--array--map-" 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="#automodelmodelclassmappings--array--map-"><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>autoModel.MODEL_CLASS_MAPPINGS : Array. < Map ></span></h3> <p data-svelte-h="svelte-btbgb8"><strong>Kind</strong>: instance property of <a href="#module_models.AutoModel"><code>AutoModel</code></a></p> <hr> <a id="module_models.AutoModelForSequenceClassification" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforsequenceclassification" 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="#modelsautomodelforsequenceclassification"><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>models.AutoModelForSequenceClassification</span></h2> <p data-svelte-h="svelte-4kxau9">Helper class which is used to instantiate pretrained sequence classification models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForSequenceClassification_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforsequenceclassification" 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="#new-automodelforsequenceclassification"><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>new AutoModelForSequenceClassification()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForSequenceClassification</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/distilbert-base-uncased-finetuned-sst-2-english'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForTokenClassification" class="group"></a> <h2 class="relative group"><a id="modelsautomodelfortokenclassification" 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="#modelsautomodelfortokenclassification"><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>models.AutoModelForTokenClassification</span></h2> <p data-svelte-h="svelte-140yet">Helper class which is used to instantiate pretrained token classification models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForTokenClassification_new" class="group"></a> <h3 class="relative group"><a id="new-automodelfortokenclassification" 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="#new-automodelfortokenclassification"><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>new AutoModelForTokenClassification()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForTokenClassification</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/distilbert-base-multilingual-cased-ner-hrl'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForSeq2SeqLM" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforseq2seqlm" 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="#modelsautomodelforseq2seqlm"><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>models.AutoModelForSeq2SeqLM</span></h2> <p data-svelte-h="svelte-1ij66t7">Helper class which is used to instantiate pretrained sequence-to-sequence models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForSeq2SeqLM_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforseq2seqlm" 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="#new-automodelforseq2seqlm"><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>new AutoModelForSeq2SeqLM()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForSeq2SeqLM</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/t5-small'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForSpeechSeq2Seq" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforspeechseq2seq" 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="#modelsautomodelforspeechseq2seq"><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>models.AutoModelForSpeechSeq2Seq</span></h2> <p data-svelte-h="svelte-gdj6sl">Helper class which is used to instantiate pretrained sequence-to-sequence speech-to-text models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForSpeechSeq2Seq_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforspeechseq2seq" 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="#new-automodelforspeechseq2seq"><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>new AutoModelForSpeechSeq2Seq()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForSpeechSeq2Seq</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'openai/whisper-tiny.en'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForTextToSpectrogram" class="group"></a> <h2 class="relative group"><a id="modelsautomodelfortexttospectrogram" 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="#modelsautomodelfortexttospectrogram"><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>models.AutoModelForTextToSpectrogram</span></h2> <p data-svelte-h="svelte-j37038">Helper class which is used to instantiate pretrained sequence-to-sequence text-to-spectrogram models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForTextToSpectrogram_new" class="group"></a> <h3 class="relative group"><a id="new-automodelfortexttospectrogram" 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="#new-automodelfortexttospectrogram"><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>new AutoModelForTextToSpectrogram()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForTextToSpectrogram</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'microsoft/speecht5_tts'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForTextToWaveform" class="group"></a> <h2 class="relative group"><a id="modelsautomodelfortexttowaveform" 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="#modelsautomodelfortexttowaveform"><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>models.AutoModelForTextToWaveform</span></h2> <p data-svelte-h="svelte-81g5dz">Helper class which is used to instantiate pretrained text-to-waveform models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForTextToWaveform_new" class="group"></a> <h3 class="relative group"><a id="new-automodelfortexttowaveform" 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="#new-automodelfortexttowaveform"><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>new AutoModelForTextToWaveform()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForTextToSpectrogram</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'facebook/mms-tts-eng'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForCausalLM" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforcausallm" 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="#modelsautomodelforcausallm"><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>models.AutoModelForCausalLM</span></h2> <p data-svelte-h="svelte-ndqd73">Helper class which is used to instantiate pretrained causal language models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForCausalLM_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforcausallm" 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="#new-automodelforcausallm"><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>new AutoModelForCausalLM()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForCausalLM</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/gpt2'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForMaskedLM" class="group"></a> <h2 class="relative group"><a id="modelsautomodelformaskedlm" 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="#modelsautomodelformaskedlm"><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>models.AutoModelForMaskedLM</span></h2> <p data-svelte-h="svelte-58czf3">Helper class which is used to instantiate pretrained masked language models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForMaskedLM_new" class="group"></a> <h3 class="relative group"><a id="new-automodelformaskedlm" 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="#new-automodelformaskedlm"><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>new AutoModelForMaskedLM()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForMaskedLM</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/bert-base-uncased'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForQuestionAnswering" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforquestionanswering" 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="#modelsautomodelforquestionanswering"><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>models.AutoModelForQuestionAnswering</span></h2> <p data-svelte-h="svelte-5dvjtw">Helper class which is used to instantiate pretrained question answering models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForQuestionAnswering_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforquestionanswering" 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="#new-automodelforquestionanswering"><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>new AutoModelForQuestionAnswering()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForQuestionAnswering</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/distilbert-base-cased-distilled-squad'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForVision2Seq" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforvision2seq" 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="#modelsautomodelforvision2seq"><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>models.AutoModelForVision2Seq</span></h2> <p data-svelte-h="svelte-baejoi">Helper class which is used to instantiate pretrained vision-to-sequence models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForVision2Seq_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforvision2seq" 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="#new-automodelforvision2seq"><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>new AutoModelForVision2Seq()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForVision2Seq</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/vit-gpt2-image-captioning'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForImageClassification" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforimageclassification" 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="#modelsautomodelforimageclassification"><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>models.AutoModelForImageClassification</span></h2> <p data-svelte-h="svelte-1y5jrwt">Helper class which is used to instantiate pretrained image classification models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForImageClassification_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforimageclassification" 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="#new-automodelforimageclassification"><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>new AutoModelForImageClassification()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForImageClassification</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/vit-base-patch16-224'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForImageSegmentation" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforimagesegmentation" 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="#modelsautomodelforimagesegmentation"><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>models.AutoModelForImageSegmentation</span></h2> <p data-svelte-h="svelte-1ekgfrf">Helper class which is used to instantiate pretrained image segmentation models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForImageSegmentation_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforimagesegmentation" 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="#new-automodelforimagesegmentation"><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>new AutoModelForImageSegmentation()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForImageSegmentation</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/detr-resnet-50-panoptic'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForSemanticSegmentation" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforsemanticsegmentation" 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="#modelsautomodelforsemanticsegmentation"><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>models.AutoModelForSemanticSegmentation</span></h2> <p data-svelte-h="svelte-1ekgfrf">Helper class which is used to instantiate pretrained image segmentation models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForSemanticSegmentation_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforsemanticsegmentation" 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="#new-automodelforsemanticsegmentation"><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>new AutoModelForSemanticSegmentation()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForSemanticSegmentation</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'nvidia/segformer-b3-finetuned-cityscapes-1024-1024'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForUniversalSegmentation" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforuniversalsegmentation" 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="#modelsautomodelforuniversalsegmentation"><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>models.AutoModelForUniversalSegmentation</span></h2> <p data-svelte-h="svelte-9ayek8">Helper class which is used to instantiate pretrained universal image segmentation models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForUniversalSegmentation_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforuniversalsegmentation" 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="#new-automodelforuniversalsegmentation"><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>new AutoModelForUniversalSegmentation()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForUniversalSegmentation</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'hf-internal-testing/tiny-random-MaskFormerForInstanceSegmentation'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForObjectDetection" class="group"></a> <h2 class="relative group"><a id="modelsautomodelforobjectdetection" 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="#modelsautomodelforobjectdetection"><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>models.AutoModelForObjectDetection</span></h2> <p data-svelte-h="svelte-1dfw0ui">Helper class which is used to instantiate pretrained object detection models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForObjectDetection_new" class="group"></a> <h3 class="relative group"><a id="new-automodelforobjectdetection" 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="#new-automodelforobjectdetection"><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>new AutoModelForObjectDetection()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForObjectDetection</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/detr-resnet-50'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models.AutoModelForMaskGeneration" class="group"></a> <h2 class="relative group"><a id="modelsautomodelformaskgeneration" 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="#modelsautomodelformaskgeneration"><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>models.AutoModelForMaskGeneration</span></h2> <p data-svelte-h="svelte-1z5d4a">Helper class which is used to instantiate pretrained mask generation models with the <code>from_pretrained</code> function. | |
| The chosen model class is determined by the type specified in the model config.</p> <p data-svelte-h="svelte-cgwb7k"><strong>Kind</strong>: static class of <a href="#module_models"><code>models</code></a></p> <hr> <a id="new_module_models.AutoModelForMaskGeneration_new" class="group"></a> <h3 class="relative group"><a id="new-automodelformaskgeneration" 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="#new-automodelformaskgeneration"><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>new AutoModelForMaskGeneration()</span></h3> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></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">const</span> model = <span class="hljs-keyword">await</span> <span class="hljs-title class_">AutoModelForMaskGeneration</span>.<span class="hljs-title function_">from_pretrained</span>(<span class="hljs-string">'Xenova/sam-vit-base'</span>);<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_models..PretrainedMixin" class="group"></a> <h2 class="relative group"><a id="modelspretrainedmixin" 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="#modelspretrainedmixin"><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>models~PretrainedMixin</span></h2> <p data-svelte-h="svelte-h61rn1">Base class of all AutoModels. Contains the <code>from_pretrained</code> function | |
| which is used to instantiate pretrained models.</p> <p data-svelte-h="svelte-n6zab4"><strong>Kind</strong>: inner class of <a href="#module_models"><code>models</code></a></p> <ul data-svelte-h="svelte-vk8vl0"><li><a href="#module_models..PretrainedMixin">~PretrainedMixin</a> <ul><li><em>instance</em> <ul><li><a href="#module_models..PretrainedMixin+MODEL_CLASS_MAPPINGS"><code>.MODEL_CLASS_MAPPINGS</code></a> : <code>Array.<Map></code></li> <li><a href="#module_models..PretrainedMixin+BASE_IF_FAIL"><code>.BASE_IF_FAIL</code></a></li></ul></li> <li><em>static</em> <ul><li><a href="#module_models..PretrainedMixin.supports"><code>.supports(model_type)</code></a> ⇒ <code>boolean</code></li> <li><a href="#module_models..PretrainedMixin.from_pretrained"><code>.from_pretrained()</code></a> : <code>Object.from_pretrained</code></li></ul></li></ul></li></ul> <hr> <a id="module_models..PretrainedMixin+MODEL_CLASS_MAPPINGS" class="group"></a> <h3 class="relative group"><a id="pretrainedmixinmodelclassmappings--array--map-" 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="#pretrainedmixinmodelclassmappings--array--map-"><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>pretrainedMixin.MODEL_CLASS_MAPPINGS : Array. < Map ></span></h3> <p data-svelte-h="svelte-1v76hpf">Mapping from model type to model class.</p> <p data-svelte-h="svelte-smd0sa"><strong>Kind</strong>: instance property of <a href="#module_models..PretrainedMixin"><code>PretrainedMixin</code></a></p> <hr> <a id="module_models..PretrainedMixin+BASE_IF_FAIL" class="group"></a> <h3 class="relative group"><a id="pretrainedmixinbaseiffail" 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="#pretrainedmixinbaseiffail"><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>pretrainedMixin.BASE_IF_FAIL</span></h3> <p data-svelte-h="svelte-boqszp">Whether to attempt to instantiate the base class (<code>PretrainedModel</code>) if | |
| the model type is not found in the mapping.</p> <p data-svelte-h="svelte-smd0sa"><strong>Kind</strong>: instance property of <a href="#module_models..PretrainedMixin"><code>PretrainedMixin</code></a></p> <hr> <a id="module_models..PretrainedMixin.supports" class="group"></a> <h3 class="relative group"><a id="pretrainedmixinsupportsmodeltype--boolean" 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="#pretrainedmixinsupportsmodeltype--boolean"><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>PretrainedMixin.supports(model_type) ⇒ boolean</span></h3> <p data-svelte-h="svelte-1tx7v3w">Check whether this AutoModel class supports a given model type.</p> <p data-svelte-h="svelte-1iqt8r7"><strong>Kind</strong>: static method of <a href="#module_models..PretrainedMixin"><code>PretrainedMixin</code></a><br> <strong>Returns</strong>: <code>boolean</code> - Whether this class can handle the given model type.</p> <table data-svelte-h="svelte-et9nxy"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>model_type</td><td><code>string</code></td><td><p>The model type from config (e.g., 'bert', 'whisper').</p></td></tr></tbody></table> <hr> <a id="module_models..PretrainedMixin.from_pretrained" class="group"></a> <h3 class="relative group"><a id="pretrainedmixinfrompretrained--objectfrompretrained" 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="#pretrainedmixinfrompretrained--objectfrompretrained"><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>PretrainedMixin.from_pretrained() : Object.from_pretrained</span></h3> <p data-svelte-h="svelte-181qvtn"><strong>Kind</strong>: static method of <a href="#module_models..PretrainedMixin"><code>PretrainedMixin</code></a></p> <hr> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/transformers.js/blob/main/packages/transformers/docs/source/api/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 data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p> | |
| <script> | |
| { | |
| __sveltekit_rvrl7f = { | |
| assets: "/docs/transformers.js/pr_1649/en", | |
| base: "/docs/transformers.js/pr_1649/en", | |
| env: {} | |
| }; | |
| const element = document.currentScript.parentElement; | |
| const data = [null,null]; | |
| Promise.all([ | |
| import("/docs/transformers.js/pr_1649/en/_app/immutable/entry/start.5f753a22.js"), | |
| import("/docs/transformers.js/pr_1649/en/_app/immutable/entry/app.db3dfcb7.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 11], | |
| data, | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 114 kB
- Xet hash:
- b3d67b9e6951fd01b5d4ded69fa83d7a9f33058e8ede22c57353a754c3d1175b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.