import{s as Ke,o as eo,n as we}from"../chunks/scheduler.25b97de1.js";import{S as oo,i as to,g as d,s as a,r as h,A as no,h as c,f as n,c as r,j as Y,u as f,x as M,k as K,y as l,a as i,v as g,d as _,t as b,w as v}from"../chunks/index.d9030fc9.js";import{T as Ve}from"../chunks/Tip.baa67368.js";import{D as le}from"../chunks/Docstring.ffac8efa.js";import{C as Ye}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Xe}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as de,E as so}from"../chunks/EditOnGithub.91d95064.js";function ao(C){let t,p;return t=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME9sbW9lTW9kZWwlMkMlMjBPbG1vZUNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBPTE1vRSUyMDdCJTIwQTFCJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyME9sbW9lQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwT0xNb0UlMjA3QiUyMEExQiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwT2xtb2VNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OlmoeModel, OlmoeConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a OLMoE 7B A1B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = OlmoeConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the OLMoE 7B A1B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OlmoeModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){h(t.$$.fragment)},l(s){f(t.$$.fragment,s)},m(s,u){g(t,s,u),p=!0},p:we,i(s){p||(_(t.$$.fragment,s),p=!0)},o(s){b(t.$$.fragment,s),p=!1},d(s){v(t,s)}}}function ro(C){let t,p=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=d("p"),t.innerHTML=p},l(s){t=c(s,"P",{"data-svelte-h":!0}),M(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(s,u){i(s,t,u)},p:we,d(s){s&&n(t)}}}function io(C){let t,p=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){t=d("p"),t.innerHTML=p},l(s){t=c(s,"P",{"data-svelte-h":!0}),M(t)!=="svelte-fincs2"&&(t.innerHTML=p)},m(s,u){i(s,t,u)},p:we,d(s){s&&n(t)}}}function lo(C){let t,p="Example:",s,u,w;return u=new Ye({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBPbG1vZUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBPbG1vZUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGT0xNb0UtMUItN0ItMDgyNCUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJhbGxlbmFpJTJGT0xNb0UtMUItN0ItMDgyNCUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, OlmoeForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = OlmoeForCausalLM.from_pretrained(<span class="hljs-string">&quot;allenai/OLMoE-1B-7B-0824&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allenai/OLMoE-1B-7B-0824&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&#x27;Hey, are you conscious? Can you talk to me?\\nI’m not sure if you’re conscious of this, but I’m&#x27;</span>`,wrap:!1}}),{c(){t=d("p"),t.textContent=p,s=a(),h(u.$$.fragment)},l(m){t=c(m,"P",{"data-svelte-h":!0}),M(t)!=="svelte-11lpom8"&&(t.textContent=p),s=r(m),f(u.$$.fragment,m)},m(m,x){i(m,t,x),i(m,s,x),g(u,m,x),w=!0},p:we,i(m){w||(_(u.$$.fragment,m),w=!0)},o(m){b(u.$$.fragment,m),w=!1},d(m){m&&(n(t),n(s)),v(u,m)}}}function co(C){let t,p,s,u,w,m,x,ce,B,Ue='The OLMoE model was proposed in <a href="https://arxiv.org/abs/2409.02060" rel="nofollow">OLMoE: Open Mixture-of-Experts Language Models</a> by Niklas Muennighoff, Luca Soldaini, Dirk Groeneveld, Kyle Lo, Jacob Morrison, Sewon Min, Weijia Shi, Pete Walsh, Oyvind Tafjord, Nathan Lambert, Yuling Gu, Shane Arora, Akshita Bhagia, Dustin Schwenk, David Wadden, Alexander Wettig, Binyuan Hui, Tim Dettmers, Douwe Kiela, Ali Farhadi, Noah A. Smith, Pang Wei Koh, Amanpreet Singh, Hannaneh Hajishirzi.',me,U,qe="OLMoE is a series of <strong>O</strong>pen <strong>L</strong>anguage <strong>Mo</strong>dels using sparse <strong>M</strong>ixture-<strong>o</strong>f-<strong>E</strong>xperts designed to enable the science of language models. We release all code, checkpoints, logs, and details involved in training these models.",pe,q,Ne="The abstract from the paper is the following:",ue,N,He="<em>We introduce OLMoE, a fully open, state-of-the-art language model leveraging sparse Mixture-of-Experts (MoE). OLMoE-1B-7B has 7 billion (B) parameters but uses only 1B per input token. We pretrain it on 5 trillion tokens and further adapt it to create OLMoE-1B-7B-Instruct. Our models outperform all available models with similar active parameters, even surpassing larger ones like Llama2-13B-Chat and DeepSeekMoE-16B. We present various experiments on MoE training, analyze routing in our model showing high specialization, and open-source all aspects of our work: model weights, training data, code, and logs.</em>",he,H,Ze=`This model was contributed by <a href="https://hf.co/Muennighoff" rel="nofollow">Muennighoff</a>.
The original code can be found <a href="https://github.com/allenai/OLMoE" rel="nofollow">here</a>.`,fe,Z,ge,k,A,$e,ee,Ae=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_22105/en/model_doc/olmoe#transformers.OlmoeModel">OlmoeModel</a>. It is used to instantiate an OLMoE
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the <a href="https://huggingface.co/allenai/OLMoE-1B-7B-0824" rel="nofollow">allenai/OLMoE-1B-7B-0824</a>.`,xe,oe,Je=`Configuration objects inherit from <a href="/docs/transformers/pr_22105/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_22105/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Oe,F,_e,J,be,y,S,Ce,te,Se=`The bare Olmoe Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/pr_22105/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ze,ne,Ge=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Le,se,De="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>OlmoeDecoderLayer</code>",je,z,G,Fe,ae,Qe='The <a href="/docs/transformers/pr_22105/en/model_doc/olmoe#transformers.OlmoeModel">OlmoeModel</a> forward method, overrides the <code>__call__</code> special method.',We,W,ve,D,ye,L,Q,Ee,$,R,Ie,re,Re='The <a href="/docs/transformers/pr_22105/en/model_doc/olmoe#transformers.OlmoeForCausalLM">OlmoeForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Pe,E,Be,I,Me,V,ke,ie,Te;return w=new de({props:{title:"OLMoE",local:"olmoe",headingTag:"h1"}}),x=new de({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Z=new de({props:{title:"OlmoeConfig",local:"transformers.OlmoeConfig",headingTag:"h2"}}),A=new le({props:{name:"class transformers.OlmoeConfig",anchor:"transformers.OlmoeConfig",parameters:[{name:"vocab_size",val:" = 50304"},{name:"hidden_size",val:" = 2048"},{name:"intermediate_size",val:" = 2048"},{name:"num_hidden_layers",val:" = 16"},{name:"num_attention_heads",val:" = 16"},{name:"num_key_value_heads",val:" = None"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 4096"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-05"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = None"},{name:"eos_token_id",val:" = 50279"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 10000.0"},{name:"rope_scaling",val:" = None"},{name:"attention_bias",val:" = False"},{name:"attention_dropout",val:" = 0.0"},{name:"clip_qkv",val:" = None"},{name:"num_experts_per_tok",val:" = 8"},{name:"num_experts",val:" = 64"},{name:"output_router_logits",val:" = False"},{name:"router_aux_loss_coef",val:" = 0.01"},{name:"norm_topk_prob",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OlmoeConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 50304) &#x2014;
Vocabulary size of the OLMoE model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_22105/en/model_doc/olmoe#transformers.OlmoeModel">OlmoeModel</a>`,name:"vocab_size"},{anchor:"transformers.OlmoeConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.OlmoeConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.OlmoeConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.OlmoeConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.OlmoeConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1</code> the model will use Multi Query Attention (MQA) otherwise GQA is used. When
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
by meanpooling all the original heads within that group. For more details checkout <a href="https://arxiv.org/pdf/2305.13245.pdf" rel="nofollow">this
paper</a>. If it is not specified, will default to
<code>num_attention_heads</code>.`,name:"num_key_value_heads"},{anchor:"transformers.OlmoeConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.OlmoeConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.OlmoeConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.OlmoeConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.OlmoeConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.OlmoeConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.OlmoeConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.OlmoeConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 50279) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.OlmoeConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.OlmoeConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 10000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.OlmoeConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
<code>{&quot;type&quot;: strategy name, &quot;factor&quot;: scaling factor}</code>. When using this flag, don&#x2019;t update
<code>max_position_embeddings</code> to the expected new maximum. See the following thread for more information on how
these scaling strategies behave:
<a href="https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/" rel="nofollow">https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/</a>. This is an
experimental feature, subject to breaking API changes in future versions.`,name:"rope_scaling"},{anchor:"transformers.OlmoeConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, defaults to <code>False</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in the query, key, value and output projection layers during self-attention.`,name:"attention_bias"},{anchor:"transformers.OlmoeConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.OlmoeConfig.clip_qkv",description:`<strong>clip_qkv</strong> (<code>float</code>, <em>optional</em>) &#x2014;
If not <code>None</code>, elements of query, key and value attention states are clipped so that their
absolute value does not exceed this value.`,name:"clip_qkv"},{anchor:"transformers.OlmoeConfig.num_experts_per_tok",description:`<strong>num_experts_per_tok</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of selected experts.`,name:"num_experts_per_tok"},{anchor:"transformers.OlmoeConfig.num_experts",description:`<strong>num_experts</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Number of routed experts.`,name:"num_experts"},{anchor:"transformers.OlmoeConfig.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the router logits should be returned by the model. Enabeling this will also
allow the model to output the auxiliary loss, including load balancing loss and router z-loss.`,name:"output_router_logits"},{anchor:"transformers.OlmoeConfig.router_aux_loss_coef",description:`<strong>router_aux_loss_coef</strong> (<code>float</code>, <em>optional</em>, defaults to 0.01) &#x2014;
The aux loss factor for the total loss.`,name:"router_aux_loss_coef"},{anchor:"transformers.OlmoeConfig.norm_topk_prob",description:`<strong>norm_topk_prob</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to normalize the topk probabilities.`,name:"norm_topk_prob"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/olmoe/configuration_olmoe.py#L18"}}),F=new Xe({props:{anchor:"transformers.OlmoeConfig.example",$$slots:{default:[ao]},$$scope:{ctx:C}}}),J=new de({props:{title:"OlmoeModel",local:"transformers.OlmoeModel",headingTag:"h2"}}),S=new le({props:{name:"class transformers.OlmoeModel",anchor:"transformers.OlmoeModel",parameters:[{name:"config",val:": OlmoeConfig"}],parametersDescription:[{anchor:"transformers.OlmoeModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_22105/en/model_doc/olmoe#transformers.OlmoeConfig">OlmoeConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_22105/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; OlmoeConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/olmoe/modeling_olmoe.py#L887"}}),G=new le({props:{name:"forward",anchor:"transformers.OlmoeModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"output_router_logits",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.OlmoeModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_22105/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_22105/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_22105/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OlmoeModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_22105/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_22105/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_22105/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OlmoeModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.OlmoeModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/pr_22105/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OlmoeModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.OlmoeModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.OlmoeModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.OlmoeModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.OlmoeModel.forward.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the logits of all the routers. They are useful for computing the router loss, and
should not be returned during inference.`,name:"output_router_logits"},{anchor:"transformers.OlmoeModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_22105/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OlmoeModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/olmoe/modeling_olmoe.py#L922"}}),W=new Ve({props:{$$slots:{default:[ro]},$$scope:{ctx:C}}}),D=new de({props:{title:"OlmoeForCausalLM",local:"transformers.OlmoeForCausalLM",headingTag:"h2"}}),Q=new le({props:{name:"class transformers.OlmoeForCausalLM",anchor:"transformers.OlmoeForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/olmoe/modeling_olmoe.py#L1181"}}),R=new le({props:{name:"forward",anchor:"transformers.OlmoeForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"output_router_logits",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"},{name:"num_logits_to_keep",val:": int = 0"},{name:"**loss_kwargs",val:""}],parametersDescription:[{anchor:"transformers.OlmoeForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_22105/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_22105/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_22105/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OlmoeForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_22105/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_22105/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_22105/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OlmoeForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.OlmoeForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/pr_22105/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OlmoeForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.OlmoeForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.OlmoeForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.OlmoeForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.OlmoeForCausalLM.forward.output_router_logits",description:`<strong>output_router_logits</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the logits of all the routers. They are useful for computing the router loss, and
should not be returned during inference.`,name:"output_router_logits"},{anchor:"transformers.OlmoeForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_22105/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OlmoeForCausalLM.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.</p>
<p>num_logits_to_keep (<code>int</code>, <em>optional</em>):
Calculate logits for the last <code>num_logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all
<code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that
token can save memory, which becomes pretty significant for long sequences or large vocabulary size.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_22105/src/transformers/models/olmoe/modeling_olmoe.py#L1214",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.modeling_outputs.MoeCausalLMOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/pr_22105/en/model_doc/olmoe#transformers.OlmoeConfig"
>OlmoeConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>aux_loss</strong> (<code>torch.FloatTensor</code>, <em>optional</em>, returned when <code>labels</code> is provided) — aux_loss for the sparse modules.</p>
</li>
<li>
<p><strong>router_logits</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_router_probs=True</code> and <code>config.add_router_probs=True</code> is passed or when <code>config.output_router_probs=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, sequence_length, num_experts)</code>.</p>
<p>Raw router logtis (post-softmax) that are computed by MoE routers, these terms are used to compute the auxiliary
loss for Mixture of Experts models.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.modeling_outputs.MoeCausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),E=new Ve({props:{$$slots:{default:[io]},$$scope:{ctx:C}}}),I=new Xe({props:{anchor:"transformers.OlmoeForCausalLM.forward.example",$$slots:{default:[lo]},$$scope:{ctx:C}}}),V=new so({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/olmoe.md"}}),{c(){t=d("meta"),p=a(),s=d("p"),u=a(),h(w.$$.fragment),m=a(),h(x.$$.fragment),ce=a(),B=d("p"),B.innerHTML=Ue,me=a(),U=d("p"),U.innerHTML=qe,pe=a(),q=d("p"),q.textContent=Ne,ue=a(),N=d("p"),N.innerHTML=He,he=a(),H=d("p"),H.innerHTML=Ze,fe=a(),h(Z.$$.fragment),ge=a(),k=d("div"),h(A.$$.fragment),$e=a(),ee=d("p"),ee.innerHTML=Ae,xe=a(),oe=d("p"),oe.innerHTML=Je,Oe=a(),h(F.$$.fragment),_e=a(),h(J.$$.fragment),be=a(),y=d("div"),h(S.$$.fragment),Ce=a(),te=d("p"),te.innerHTML=Se,ze=a(),ne=d("p"),ne.innerHTML=Ge,Le=a(),se=d("p"),se.innerHTML=De,je=a(),z=d("div"),h(G.$$.fragment),Fe=a(),ae=d("p"),ae.innerHTML=Qe,We=a(),h(W.$$.fragment),ve=a(),h(D.$$.fragment),ye=a(),L=d("div"),h(Q.$$.fragment),Ee=a(),$=d("div"),h(R.$$.fragment),Ie=a(),re=d("p"),re.innerHTML=Re,Pe=a(),h(E.$$.fragment),Be=a(),h(I.$$.fragment),Me=a(),h(V.$$.fragment),ke=a(),ie=d("p"),this.h()},l(e){const o=no("svelte-u9bgzb",document.head);t=c(o,"META",{name:!0,content:!0}),o.forEach(n),p=r(e),s=c(e,"P",{}),Y(s).forEach(n),u=r(e),f(w.$$.fragment,e),m=r(e),f(x.$$.fragment,e),ce=r(e),B=c(e,"P",{"data-svelte-h":!0}),M(B)!=="svelte-h0ae6d"&&(B.innerHTML=Ue),me=r(e),U=c(e,"P",{"data-svelte-h":!0}),M(U)!=="svelte-476n4r"&&(U.innerHTML=qe),pe=r(e),q=c(e,"P",{"data-svelte-h":!0}),M(q)!=="svelte-vfdo9a"&&(q.textContent=Ne),ue=r(e),N=c(e,"P",{"data-svelte-h":!0}),M(N)!=="svelte-1864q7w"&&(N.innerHTML=He),he=r(e),H=c(e,"P",{"data-svelte-h":!0}),M(H)!=="svelte-dkhytv"&&(H.innerHTML=Ze),fe=r(e),f(Z.$$.fragment,e),ge=r(e),k=c(e,"DIV",{class:!0});var O=Y(k);f(A.$$.fragment,O),$e=r(O),ee=c(O,"P",{"data-svelte-h":!0}),M(ee)!=="svelte-9ubylq"&&(ee.innerHTML=Ae),xe=r(O),oe=c(O,"P",{"data-svelte-h":!0}),M(oe)!=="svelte-1pjt8ff"&&(oe.innerHTML=Je),Oe=r(O),f(F.$$.fragment,O),O.forEach(n),_e=r(e),f(J.$$.fragment,e),be=r(e),y=c(e,"DIV",{class:!0});var T=Y(y);f(S.$$.fragment,T),Ce=r(T),te=c(T,"P",{"data-svelte-h":!0}),M(te)!=="svelte-1mvbvr2"&&(te.innerHTML=Se),ze=r(T),ne=c(T,"P",{"data-svelte-h":!0}),M(ne)!=="svelte-hswkmf"&&(ne.innerHTML=Ge),Le=r(T),se=c(T,"P",{"data-svelte-h":!0}),M(se)!=="svelte-vh3wiv"&&(se.innerHTML=De),je=r(T),z=c(T,"DIV",{class:!0});var j=Y(z);f(G.$$.fragment,j),Fe=r(j),ae=c(j,"P",{"data-svelte-h":!0}),M(ae)!=="svelte-bg5icb"&&(ae.innerHTML=Qe),We=r(j),f(W.$$.fragment,j),j.forEach(n),T.forEach(n),ve=r(e),f(D.$$.fragment,e),ye=r(e),L=c(e,"DIV",{class:!0});var X=Y(L);f(Q.$$.fragment,X),Ee=r(X),$=c(X,"DIV",{class:!0});var P=Y($);f(R.$$.fragment,P),Ie=r(P),re=c(P,"P",{"data-svelte-h":!0}),M(re)!=="svelte-1bajxzr"&&(re.innerHTML=Re),Pe=r(P),f(E.$$.fragment,P),Be=r(P),f(I.$$.fragment,P),P.forEach(n),X.forEach(n),Me=r(e),f(V.$$.fragment,e),ke=r(e),ie=c(e,"P",{}),Y(ie).forEach(n),this.h()},h(){K(t,"name","hf:doc:metadata"),K(t,"content",mo),K(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),K(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){l(document.head,t),i(e,p,o),i(e,s,o),i(e,u,o),g(w,e,o),i(e,m,o),g(x,e,o),i(e,ce,o),i(e,B,o),i(e,me,o),i(e,U,o),i(e,pe,o),i(e,q,o),i(e,ue,o),i(e,N,o),i(e,he,o),i(e,H,o),i(e,fe,o),g(Z,e,o),i(e,ge,o),i(e,k,o),g(A,k,null),l(k,$e),l(k,ee),l(k,xe),l(k,oe),l(k,Oe),g(F,k,null),i(e,_e,o),g(J,e,o),i(e,be,o),i(e,y,o),g(S,y,null),l(y,Ce),l(y,te),l(y,ze),l(y,ne),l(y,Le),l(y,se),l(y,je),l(y,z),g(G,z,null),l(z,Fe),l(z,ae),l(z,We),g(W,z,null),i(e,ve,o),g(D,e,o),i(e,ye,o),i(e,L,o),g(Q,L,null),l(L,Ee),l(L,$),g(R,$,null),l($,Ie),l($,re),l($,Pe),g(E,$,null),l($,Be),g(I,$,null),i(e,Me,o),g(V,e,o),i(e,ke,o),i(e,ie,o),Te=!0},p(e,[o]){const O={};o&2&&(O.$$scope={dirty:o,ctx:e}),F.$set(O);const T={};o&2&&(T.$$scope={dirty:o,ctx:e}),W.$set(T);const j={};o&2&&(j.$$scope={dirty:o,ctx:e}),E.$set(j);const X={};o&2&&(X.$$scope={dirty:o,ctx:e}),I.$set(X)},i(e){Te||(_(w.$$.fragment,e),_(x.$$.fragment,e),_(Z.$$.fragment,e),_(A.$$.fragment,e),_(F.$$.fragment,e),_(J.$$.fragment,e),_(S.$$.fragment,e),_(G.$$.fragment,e),_(W.$$.fragment,e),_(D.$$.fragment,e),_(Q.$$.fragment,e),_(R.$$.fragment,e),_(E.$$.fragment,e),_(I.$$.fragment,e),_(V.$$.fragment,e),Te=!0)},o(e){b(w.$$.fragment,e),b(x.$$.fragment,e),b(Z.$$.fragment,e),b(A.$$.fragment,e),b(F.$$.fragment,e),b(J.$$.fragment,e),b(S.$$.fragment,e),b(G.$$.fragment,e),b(W.$$.fragment,e),b(D.$$.fragment,e),b(Q.$$.fragment,e),b(R.$$.fragment,e),b(E.$$.fragment,e),b(I.$$.fragment,e),b(V.$$.fragment,e),Te=!1},d(e){e&&(n(p),n(s),n(u),n(m),n(ce),n(B),n(me),n(U),n(pe),n(q),n(ue),n(N),n(he),n(H),n(fe),n(ge),n(k),n(_e),n(be),n(y),n(ve),n(ye),n(L),n(Me),n(ke),n(ie)),n(t),v(w,e),v(x,e),v(Z,e),v(A),v(F),v(J,e),v(S),v(G),v(W),v(D,e),v(Q),v(R),v(E),v(I),v(V,e)}}}const mo='{"title":"OLMoE","local":"olmoe","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"OlmoeConfig","local":"transformers.OlmoeConfig","sections":[],"depth":2},{"title":"OlmoeModel","local":"transformers.OlmoeModel","sections":[],"depth":2},{"title":"OlmoeForCausalLM","local":"transformers.OlmoeForCausalLM","sections":[],"depth":2}],"depth":1}';function po(C){return eo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yo extends oo{constructor(t){super(),to(this,t,po,co,Ke,{})}}export{yo as component};
