import{s as So,o as Eo,n as xe}from"../chunks/scheduler.25b97de1.js";import{S as Jo,i as Ro,g as l,s,r as p,A as Vo,h as c,f as t,c as a,j as I,u as m,x as _,k as L,y as d,a as r,v as u,d as h,t as f,w as g}from"../chunks/index.d9030fc9.js";import{T as _o}from"../chunks/Tip.baa67368.js";import{D as me}from"../chunks/Docstring.ffac8efa.js";import{C as wo}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Wo}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as V,E as Po}from"../chunks/EditOnGithub.91d95064.js";function No(Q){let n,w;return n=new wo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFF3ZW4yTW9lTW9kZWwlMkMlMjBRd2VuMk1vZUNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBRd2VuMk1vRSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBRd2VuMk1vZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMFF3ZW4xLjUtTW9FLUEyLjdCJTIyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBRd2VuMk1vZU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen2MoeModel, Qwen2MoeConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Qwen2MoE style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Qwen2MoeConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the Qwen1.5-MoE-A2.7B&quot; style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Qwen2MoeModel(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(){p(n.$$.fragment)},l(i){m(n.$$.fragment,i)},m(i,M){u(n,i,M),w=!0},p:xe,i(i){w||(h(n.$$.fragment,i),w=!0)},o(i){f(n.$$.fragment,i),w=!1},d(i){g(n,i)}}}function Ho(Q){let n,w=`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(){n=l("p"),n.innerHTML=w},l(i){n=c(i,"P",{"data-svelte-h":!0}),_(n)!=="svelte-fincs2"&&(n.innerHTML=w)},m(i,M){r(i,n,M)},p:xe,d(i){i&&t(n)}}}function Go(Q){let n,w=`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(){n=l("p"),n.innerHTML=w},l(i){n=c(i,"P",{"data-svelte-h":!0}),_(n)!=="svelte-fincs2"&&(n.innerHTML=w)},m(i,M){r(i,n,M)},p:xe,d(i){i&&t(n)}}}function Xo(Q){let n,w="Example:",i,M,C;return M=new wo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBRd2VuMk1vZUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBRd2VuMk1vZUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZChQQVRIX1RPX0NPTlZFUlRFRF9XRUlHSFRTKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKFBBVEhfVE9fQ09OVkVSVEVEX1RPS0VOSVpFUiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, Qwen2MoeForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = Qwen2MoeForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)

<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">&quot;Hey, are you conscious? Can you talk to me?\\nI&#x27;m not conscious, but I can talk to you.&quot;</span>`,wrap:!1}}),{c(){n=l("p"),n.textContent=w,i=s(),p(M.$$.fragment)},l(y){n=c(y,"P",{"data-svelte-h":!0}),_(n)!=="svelte-11lpom8"&&(n.textContent=w),i=a(y),m(M.$$.fragment,y)},m(y,z){r(y,n,z),r(y,i,z),u(M,y,z),C=!0},p:xe,i(y){C||(h(M.$$.fragment,y),C=!0)},o(y){f(M.$$.fragment,y),C=!1},d(y){y&&(t(n),t(i)),g(M,y)}}}function Ao(Q){let n,w=`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(){n=l("p"),n.innerHTML=w},l(i){n=c(i,"P",{"data-svelte-h":!0}),_(n)!=="svelte-fincs2"&&(n.innerHTML=w)},m(i,M){r(i,n,M)},p:xe,d(i){i&&t(n)}}}function Oo(Q){let n,w,i,M,C,y,z,ze,P,Mo="Qwen2MoE is the new model series of large language models from the Qwen team. Previously, we released the Qwen series, including Qwen-72B, Qwen-1.8B, Qwen-VL, Qwen-Audio, etc.",Ue,N,Fe,H,yo="Qwen2MoE is a language model series including decoder language models of different model sizes. For each size, we release the base language model and the aligned chat model. Qwen2MoE has the following architectural choices:",je,G,bo="<li>Qwen2MoE is based on the Transformer architecture with SwiGLU activation, attention QKV bias, group query attention, mixture of sliding window attention and full attention, etc. Additionally, we have an improved tokenizer adaptive to multiple natural languages and codes.</li> <li>Qwen2MoE employs Mixture of Experts (MoE) architecture, where the models are upcycled from dense language models. For instance, <code>Qwen1.5-MoE-A2.7B</code> is upcycled from <code>Qwen-1.8B</code>. It has 14.3B parameters in total and 2.7B activated parameters during runtime, while it achieves comparable performance with <code>Qwen1.5-7B</code>, with only 25% of the training resources.</li>",qe,X,vo='For more details refer to the <a href="https://qwenlm.github.io/blog/qwen-moe/" rel="nofollow">release blog post</a>.',Be,A,Ze,O,To='<code>Qwen1.5-MoE-A2.7B</code> and <code>Qwen1.5-MoE-A2.7B-Chat</code> can be found on the <a href="https://huggingface.co/Qwen" rel="nofollow">Huggingface Hub</a>',Ie,D,ko="In the following, we demonstrate how to use <code>Qwen1.5-MoE-A2.7B-Chat</code> for the inference. Note that we have used the ChatML format for dialog, in this demo we show how to leverage <code>apply_chat_template</code> for this purpose.",Le,Y,We,K,Se,k,ee,Ae,ue,$o=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeModel">Qwen2MoeModel</a>. It is used to instantiate a
Qwen2MoE model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen1.5-MoE-A2.7B” <a href="https://huggingface.co/Qwen/Qwen1.5-MoE-A2.7B%22" rel="nofollow">Qwen/Qwen1.5-MoE-A2.7B”</a>.`,Oe,he,Qo=`Configuration objects inherit from <a href="/docs/transformers/v4.41.0/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/v4.41.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,De,W,Ee,oe,Je,v,te,Ye,fe,Co=`The bare Qwen2MoE Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/v4.41.0/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.)`,Ke,ge,xo=`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.`,eo,_e,zo="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>Qwen2MoeDecoderLayer</code>",oo,j,ne,to,we,Uo='The <a href="/docs/transformers/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeModel">Qwen2MoeModel</a> forward method, overrides the <code>__call__</code> special method.',no,S,Re,se,Ve,B,ae,so,x,re,ao,Me,Fo='The <a href="/docs/transformers/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeForCausalLM">Qwen2MoeForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',ro,E,io,J,Pe,ie,Ne,b,de,lo,ye,jo="The Qwen2MoE Model transformer with a sequence classification head on top (linear layer).",co,be,qo=`<a href="/docs/transformers/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeForSequenceClassification">Qwen2MoeForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,po,ve,Bo=`Since it does classification on the last token, it requires to know the position of the last token. If a
<code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding token in each row. If
no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take the last value in
each row of the batch).`,mo,Te,Zo=`This model inherits from <a href="/docs/transformers/v4.41.0/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.)`,uo,ke,Io=`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.`,ho,q,le,fo,$e,Lo='The <a href="/docs/transformers/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeForSequenceClassification">Qwen2MoeForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',go,R,He,ce,Ge,Ce,Xe;return C=new V({props:{title:"Qwen2MoE",local:"qwen2moe",headingTag:"h1"}}),z=new V({props:{title:"Overview",local:"overview",headingTag:"h2"}}),N=new V({props:{title:"Model Details",local:"model-details",headingTag:"h3"}}),A=new V({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),Y=new wo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUwQWRldmljZSUyMCUzRCUyMCUyMmN1ZGElMjIlMjAlMjMlMjB0aGUlMjBkZXZpY2UlMjB0byUyMGxvYWQlMjB0aGUlMjBtb2RlbCUyMG9udG8lMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJRd2VuJTJGUXdlbjEuNS1Nb0UtQTIuN0ItQ2hhdCUyMiUyQyUyMGRldmljZV9tYXAlM0QlMjJhdXRvJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlF3ZW4lMkZRd2VuMS41LU1vRS1BMi43Qi1DaGF0JTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkdpdmUlMjBtZSUyMGElMjBzaG9ydCUyMGludHJvZHVjdGlvbiUyMHRvJTIwbGFyZ2UlMjBsYW5ndWFnZSUyMG1vZGVsLiUyMiUwQSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwcHJvbXB0JTdEJTVEJTBBJTBBdGV4dCUyMCUzRCUyMHRva2VuaXplci5hcHBseV9jaGF0X3RlbXBsYXRlKG1lc3NhZ2VzJTJDJTIwdG9rZW5pemUlM0RGYWxzZSUyQyUyMGFkZF9nZW5lcmF0aW9uX3Byb21wdCUzRFRydWUpJTBBJTBBbW9kZWxfaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QnRleHQlNUQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS50byhkZXZpY2UpJTBBJTBBZ2VuZXJhdGVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKG1vZGVsX2lucHV0cy5pbnB1dF9pZHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDUxMiUyQyUyMGRvX3NhbXBsZSUzRFRydWUpJTBBJTBBZ2VuZXJhdGVkX2lkcyUyMCUzRCUyMCU1Qm91dHB1dF9pZHMlNUJsZW4oaW5wdXRfaWRzKSUzQSU1RCUyMGZvciUyMGlucHV0X2lkcyUyQyUyMG91dHB1dF9pZHMlMjBpbiUyMHppcChtb2RlbF9pbnB1dHMuaW5wdXRfaWRzJTJDJTIwZ2VuZXJhdGVkX2lkcyklNUQlMEElMEFyZXNwb25zZSUyMCUzRCUyMHRva2VuaXplci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer
<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-comment"># the device to load the model onto</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen1.5-MoE-A2.7B-Chat&quot;</span>, device_map=<span class="hljs-string">&quot;auto&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen1.5-MoE-A2.7B-Chat&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Give me a short introduction to large language model.&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: prompt}]

<span class="hljs-meta">&gt;&gt;&gt; </span>text = tokenizer.apply_chat_template(messages, tokenize=<span class="hljs-literal">False</span>, add_generation_prompt=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>model_inputs = tokenizer([text], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(device)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=<span class="hljs-number">512</span>, do_sample=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = [output_ids[<span class="hljs-built_in">len</span>(input_ids):] <span class="hljs-keyword">for</span> input_ids, output_ids <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(model_inputs.input_ids, generated_ids)]

<span class="hljs-meta">&gt;&gt;&gt; </span>response = tokenizer.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]`,wrap:!1}}),K=new V({props:{title:"Qwen2MoeConfig",local:"transformers.Qwen2MoeConfig",headingTag:"h2"}}),ee=new me({props:{name:"class transformers.Qwen2MoeConfig",anchor:"transformers.Qwen2MoeConfig",parameters:[{name:"vocab_size",val:" = 151936"},{name:"hidden_size",val:" = 2048"},{name:"intermediate_size",val:" = 5632"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 16"},{name:"num_key_value_heads",val:" = 16"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 32768"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-06"},{name:"use_cache",val:" = True"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 10000.0"},{name:"use_sliding_window",val:" = False"},{name:"sliding_window",val:" = 4096"},{name:"max_window_layers",val:" = 28"},{name:"attention_dropout",val:" = 0.0"},{name:"decoder_sparse_step",val:" = 1"},{name:"moe_intermediate_size",val:" = 1408"},{name:"shared_expert_intermediate_size",val:" = 5632"},{name:"num_experts_per_tok",val:" = 4"},{name:"num_experts",val:" = 60"},{name:"norm_topk_prob",val:" = False"},{name:"output_router_logits",val:" = False"},{name:"router_aux_loss_coef",val:" = 0.001"},{name:"mlp_only_layers",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Qwen2MoeConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 151936) &#x2014;
Vocabulary size of the Qwen2MoE model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeModel">Qwen2MoeModel</a>`,name:"vocab_size"},{anchor:"transformers.Qwen2MoeConfig.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.Qwen2MoeConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 5632) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.Qwen2MoeConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Qwen2MoeConfig.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 encoder.`,name:"num_attention_heads"},{anchor:"transformers.Qwen2MoeConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#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 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 [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to </code>32\`.`,name:"num_key_value_heads"},{anchor:"transformers.Qwen2MoeConfig.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.Qwen2MoeConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 32768) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.Qwen2MoeConfig.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.Qwen2MoeConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.Qwen2MoeConfig.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.Qwen2MoeConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model&#x2019;s input and output word embeddings should be tied.`,name:"tie_word_embeddings"},{anchor:"transformers.Qwen2MoeConfig.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.Qwen2MoeConfig.use_sliding_window",description:`<strong>use_sliding_window</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use sliding window attention.`,name:"use_sliding_window"},{anchor:"transformers.Qwen2MoeConfig.sliding_window",description:`<strong>sliding_window</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Sliding window attention (SWA) window size. If not specified, will default to <code>4096</code>.`,name:"sliding_window"},{anchor:"transformers.Qwen2MoeConfig.max_window_layers",description:`<strong>max_window_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 28) &#x2014;
The number of layers that use SWA (Sliding Window Attention). The bottom layers use SWA while the top use full attention.`,name:"max_window_layers"},{anchor:"transformers.Qwen2MoeConfig.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.Qwen2MoeConfig.decoder_sparse_step",description:`<strong>decoder_sparse_step</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency of the MoE layer.`,name:"decoder_sparse_step"},{anchor:"transformers.Qwen2MoeConfig.moe_intermediate_size",description:`<strong>moe_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1408) &#x2014;
Intermediate size of the routed expert.`,name:"moe_intermediate_size"},{anchor:"transformers.Qwen2MoeConfig.shared_expert_intermediate_size",description:`<strong>shared_expert_intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 5632) &#x2014;
Intermediate size of the shared expert.`,name:"shared_expert_intermediate_size"},{anchor:"transformers.Qwen2MoeConfig.num_experts_per_tok",description:`<strong>num_experts_per_tok</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Number of selected experts.`,name:"num_experts_per_tok"},{anchor:"transformers.Qwen2MoeConfig.num_experts",description:`<strong>num_experts</strong> (<code>int</code>, <em>optional</em>, defaults to 60) &#x2014;
Number of routed experts.`,name:"num_experts"},{anchor:"transformers.Qwen2MoeConfig.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"},{anchor:"transformers.Qwen2MoeConfig.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.Qwen2MoeConfig.router_aux_loss_coef",description:`<strong>router_aux_loss_coef</strong> (<code>float</code>, <em>optional</em>, defaults to 0.001) &#x2014;
The aux loss factor for the total loss.`,name:"router_aux_loss_coef"},{anchor:"transformers.Qwen2MoeConfig.mlp_only_layers",description:`<strong>mlp_only_layers</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[]</code>) &#x2014;
Indicate which layers use Qwen2MoeMLP rather than Qwen2MoeSparseMoeBlock
The list contains layer index, from 0 to num_layers-1 if we have num_layers layers
If <code>mlp_only_layers</code> is empty, <code>decoder_sparse_step</code> is used to determine the sparsity.`,name:"mlp_only_layers"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/qwen2_moe/configuration_qwen2_moe.py#L24"}}),W=new Wo({props:{anchor:"transformers.Qwen2MoeConfig.example",$$slots:{default:[No]},$$scope:{ctx:Q}}}),oe=new V({props:{title:"Qwen2MoeModel",local:"transformers.Qwen2MoeModel",headingTag:"h2"}}),te=new me({props:{name:"class transformers.Qwen2MoeModel",anchor:"transformers.Qwen2MoeModel",parameters:[{name:"config",val:": Qwen2MoeConfig"}],parametersDescription:[{anchor:"transformers.Qwen2MoeModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeConfig">Qwen2MoeConfig</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/v4.41.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; Qwen2MoeConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py#L1045"}}),ne=new me({props:{name:"forward",anchor:"transformers.Qwen2MoeModel.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:"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"}],parametersDescription:[{anchor:"transformers.Qwen2MoeModel.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/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/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.Qwen2MoeModel.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/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/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>decoder_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.Qwen2MoeModel.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.Qwen2MoeModel.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/v4.41.0/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.Qwen2MoeModel.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.Qwen2MoeModel.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.Qwen2MoeModel.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.Qwen2MoeModel.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.Qwen2MoeModel.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.Qwen2MoeModel.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/v4.41.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py#L1079"}}),S=new _o({props:{$$slots:{default:[Ho]},$$scope:{ctx:Q}}}),se=new V({props:{title:"Qwen2MoeForCausalLM",local:"transformers.Qwen2MoeForCausalLM",headingTag:"h2"}}),ae=new me({props:{name:"class transformers.Qwen2MoeForCausalLM",anchor:"transformers.Qwen2MoeForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py#L1243"}}),re=new me({props:{name:"forward",anchor:"transformers.Qwen2MoeForCausalLM.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"}],parametersDescription:[{anchor:"transformers.Qwen2MoeForCausalLM.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/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/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.Qwen2MoeForCausalLM.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/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/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>decoder_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.Qwen2MoeForCausalLM.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.Qwen2MoeForCausalLM.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/v4.41.0/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.Qwen2MoeForCausalLM.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.Qwen2MoeForCausalLM.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.Qwen2MoeForCausalLM.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.Qwen2MoeForCausalLM.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.Qwen2MoeForCausalLM.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.Qwen2MoeForCausalLM.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/v4.41.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</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>.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py#L1276",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/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeConfig"
>Qwen2MoeConfig</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 _o({props:{$$slots:{default:[Go]},$$scope:{ctx:Q}}}),J=new Wo({props:{anchor:"transformers.Qwen2MoeForCausalLM.forward.example",$$slots:{default:[Xo]},$$scope:{ctx:Q}}}),ie=new V({props:{title:"Qwen2MoeForSequenceClassification",local:"transformers.Qwen2MoeForSequenceClassification",headingTag:"h2"}}),de=new me({props:{name:"class transformers.Qwen2MoeForSequenceClassification",anchor:"transformers.Qwen2MoeForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Qwen2MoeForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.41.0/en/model_doc/qwen2_moe#transformers.Qwen2MoeConfig">Qwen2MoeConfig</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/v4.41.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py#L1452"}}),le=new me({props:{name:"forward",anchor:"transformers.Qwen2MoeForSequenceClassification.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:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Qwen2MoeForSequenceClassification.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/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/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.Qwen2MoeForSequenceClassification.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/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/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>decoder_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.Qwen2MoeForSequenceClassification.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.Qwen2MoeForSequenceClassification.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/v4.41.0/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.Qwen2MoeForSequenceClassification.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.Qwen2MoeForSequenceClassification.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.Qwen2MoeForSequenceClassification.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.Qwen2MoeForSequenceClassification.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.Qwen2MoeForSequenceClassification.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.Qwen2MoeForSequenceClassification.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/v4.41.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Qwen2MoeForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/qwen2_moe/modeling_qwen2_moe.py#L1484"}}),R=new _o({props:{$$slots:{default:[Ao]},$$scope:{ctx:Q}}}),ce=new Po({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/qwen2_moe.md"}}),{c(){n=l("meta"),w=s(),i=l("p"),M=s(),p(C.$$.fragment),y=s(),p(z.$$.fragment),ze=s(),P=l("p"),P.textContent=Mo,Ue=s(),p(N.$$.fragment),Fe=s(),H=l("p"),H.textContent=yo,je=s(),G=l("ul"),G.innerHTML=bo,qe=s(),X=l("p"),X.innerHTML=vo,Be=s(),p(A.$$.fragment),Ze=s(),O=l("p"),O.innerHTML=To,Ie=s(),D=l("p"),D.innerHTML=ko,Le=s(),p(Y.$$.fragment),We=s(),p(K.$$.fragment),Se=s(),k=l("div"),p(ee.$$.fragment),Ae=s(),ue=l("p"),ue.innerHTML=$o,Oe=s(),he=l("p"),he.innerHTML=Qo,De=s(),p(W.$$.fragment),Ee=s(),p(oe.$$.fragment),Je=s(),v=l("div"),p(te.$$.fragment),Ye=s(),fe=l("p"),fe.innerHTML=Co,Ke=s(),ge=l("p"),ge.innerHTML=xo,eo=s(),_e=l("p"),_e.innerHTML=zo,oo=s(),j=l("div"),p(ne.$$.fragment),to=s(),we=l("p"),we.innerHTML=Uo,no=s(),p(S.$$.fragment),Re=s(),p(se.$$.fragment),Ve=s(),B=l("div"),p(ae.$$.fragment),so=s(),x=l("div"),p(re.$$.fragment),ao=s(),Me=l("p"),Me.innerHTML=Fo,ro=s(),p(E.$$.fragment),io=s(),p(J.$$.fragment),Pe=s(),p(ie.$$.fragment),Ne=s(),b=l("div"),p(de.$$.fragment),lo=s(),ye=l("p"),ye.textContent=jo,co=s(),be=l("p"),be.innerHTML=qo,po=s(),ve=l("p"),ve.innerHTML=Bo,mo=s(),Te=l("p"),Te.innerHTML=Zo,uo=s(),ke=l("p"),ke.innerHTML=Io,ho=s(),q=l("div"),p(le.$$.fragment),fo=s(),$e=l("p"),$e.innerHTML=Lo,go=s(),p(R.$$.fragment),He=s(),p(ce.$$.fragment),Ge=s(),Ce=l("p"),this.h()},l(e){const o=Vo("svelte-u9bgzb",document.head);n=c(o,"META",{name:!0,content:!0}),o.forEach(t),w=a(e),i=c(e,"P",{}),I(i).forEach(t),M=a(e),m(C.$$.fragment,e),y=a(e),m(z.$$.fragment,e),ze=a(e),P=c(e,"P",{"data-svelte-h":!0}),_(P)!=="svelte-1wc0b4x"&&(P.textContent=Mo),Ue=a(e),m(N.$$.fragment,e),Fe=a(e),H=c(e,"P",{"data-svelte-h":!0}),_(H)!=="svelte-s8zri0"&&(H.textContent=yo),je=a(e),G=c(e,"UL",{"data-svelte-h":!0}),_(G)!=="svelte-1juc3oe"&&(G.innerHTML=bo),qe=a(e),X=c(e,"P",{"data-svelte-h":!0}),_(X)!=="svelte-11l0n6m"&&(X.innerHTML=vo),Be=a(e),m(A.$$.fragment,e),Ze=a(e),O=c(e,"P",{"data-svelte-h":!0}),_(O)!=="svelte-lvuute"&&(O.innerHTML=To),Ie=a(e),D=c(e,"P",{"data-svelte-h":!0}),_(D)!=="svelte-13rpvgv"&&(D.innerHTML=ko),Le=a(e),m(Y.$$.fragment,e),We=a(e),m(K.$$.fragment,e),Se=a(e),k=c(e,"DIV",{class:!0});var U=I(k);m(ee.$$.fragment,U),Ae=a(U),ue=c(U,"P",{"data-svelte-h":!0}),_(ue)!=="svelte-19zw75x"&&(ue.innerHTML=$o),Oe=a(U),he=c(U,"P",{"data-svelte-h":!0}),_(he)!=="svelte-1j16s4x"&&(he.innerHTML=Qo),De=a(U),m(W.$$.fragment,U),U.forEach(t),Ee=a(e),m(oe.$$.fragment,e),Je=a(e),v=c(e,"DIV",{class:!0});var $=I(v);m(te.$$.fragment,$),Ye=a($),fe=c($,"P",{"data-svelte-h":!0}),_(fe)!=="svelte-1ek68xc"&&(fe.innerHTML=Co),Ke=a($),ge=c($,"P",{"data-svelte-h":!0}),_(ge)!=="svelte-hswkmf"&&(ge.innerHTML=xo),eo=a($),_e=c($,"P",{"data-svelte-h":!0}),_(_e)!=="svelte-8ulzm9"&&(_e.innerHTML=zo),oo=a($),j=c($,"DIV",{class:!0});var Z=I(j);m(ne.$$.fragment,Z),to=a(Z),we=c(Z,"P",{"data-svelte-h":!0}),_(we)!=="svelte-3s8a2o"&&(we.innerHTML=Uo),no=a(Z),m(S.$$.fragment,Z),Z.forEach(t),$.forEach(t),Re=a(e),m(se.$$.fragment,e),Ve=a(e),B=c(e,"DIV",{class:!0});var pe=I(B);m(ae.$$.fragment,pe),so=a(pe),x=c(pe,"DIV",{class:!0});var F=I(x);m(re.$$.fragment,F),ao=a(F),Me=c(F,"P",{"data-svelte-h":!0}),_(Me)!=="svelte-8fpwic"&&(Me.innerHTML=Fo),ro=a(F),m(E.$$.fragment,F),io=a(F),m(J.$$.fragment,F),F.forEach(t),pe.forEach(t),Pe=a(e),m(ie.$$.fragment,e),Ne=a(e),b=c(e,"DIV",{class:!0});var T=I(b);m(de.$$.fragment,T),lo=a(T),ye=c(T,"P",{"data-svelte-h":!0}),_(ye)!=="svelte-2ea6fs"&&(ye.textContent=jo),co=a(T),be=c(T,"P",{"data-svelte-h":!0}),_(be)!=="svelte-q2yyu5"&&(be.innerHTML=qo),po=a(T),ve=c(T,"P",{"data-svelte-h":!0}),_(ve)!=="svelte-10ugs3m"&&(ve.innerHTML=Bo),mo=a(T),Te=c(T,"P",{"data-svelte-h":!0}),_(Te)!=="svelte-x59fzs"&&(Te.innerHTML=Zo),uo=a(T),ke=c(T,"P",{"data-svelte-h":!0}),_(ke)!=="svelte-hswkmf"&&(ke.innerHTML=Io),ho=a(T),q=c(T,"DIV",{class:!0});var Qe=I(q);m(le.$$.fragment,Qe),fo=a(Qe),$e=c(Qe,"P",{"data-svelte-h":!0}),_($e)!=="svelte-rwi828"&&($e.innerHTML=Lo),go=a(Qe),m(R.$$.fragment,Qe),Qe.forEach(t),T.forEach(t),He=a(e),m(ce.$$.fragment,e),Ge=a(e),Ce=c(e,"P",{}),I(Ce).forEach(t),this.h()},h(){L(n,"name","hf:doc:metadata"),L(n,"content",Do),L(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(b,"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){d(document.head,n),r(e,w,o),r(e,i,o),r(e,M,o),u(C,e,o),r(e,y,o),u(z,e,o),r(e,ze,o),r(e,P,o),r(e,Ue,o),u(N,e,o),r(e,Fe,o),r(e,H,o),r(e,je,o),r(e,G,o),r(e,qe,o),r(e,X,o),r(e,Be,o),u(A,e,o),r(e,Ze,o),r(e,O,o),r(e,Ie,o),r(e,D,o),r(e,Le,o),u(Y,e,o),r(e,We,o),u(K,e,o),r(e,Se,o),r(e,k,o),u(ee,k,null),d(k,Ae),d(k,ue),d(k,Oe),d(k,he),d(k,De),u(W,k,null),r(e,Ee,o),u(oe,e,o),r(e,Je,o),r(e,v,o),u(te,v,null),d(v,Ye),d(v,fe),d(v,Ke),d(v,ge),d(v,eo),d(v,_e),d(v,oo),d(v,j),u(ne,j,null),d(j,to),d(j,we),d(j,no),u(S,j,null),r(e,Re,o),u(se,e,o),r(e,Ve,o),r(e,B,o),u(ae,B,null),d(B,so),d(B,x),u(re,x,null),d(x,ao),d(x,Me),d(x,ro),u(E,x,null),d(x,io),u(J,x,null),r(e,Pe,o),u(ie,e,o),r(e,Ne,o),r(e,b,o),u(de,b,null),d(b,lo),d(b,ye),d(b,co),d(b,be),d(b,po),d(b,ve),d(b,mo),d(b,Te),d(b,uo),d(b,ke),d(b,ho),d(b,q),u(le,q,null),d(q,fo),d(q,$e),d(q,go),u(R,q,null),r(e,He,o),u(ce,e,o),r(e,Ge,o),r(e,Ce,o),Xe=!0},p(e,[o]){const U={};o&2&&(U.$$scope={dirty:o,ctx:e}),W.$set(U);const $={};o&2&&($.$$scope={dirty:o,ctx:e}),S.$set($);const Z={};o&2&&(Z.$$scope={dirty:o,ctx:e}),E.$set(Z);const pe={};o&2&&(pe.$$scope={dirty:o,ctx:e}),J.$set(pe);const F={};o&2&&(F.$$scope={dirty:o,ctx:e}),R.$set(F)},i(e){Xe||(h(C.$$.fragment,e),h(z.$$.fragment,e),h(N.$$.fragment,e),h(A.$$.fragment,e),h(Y.$$.fragment,e),h(K.$$.fragment,e),h(ee.$$.fragment,e),h(W.$$.fragment,e),h(oe.$$.fragment,e),h(te.$$.fragment,e),h(ne.$$.fragment,e),h(S.$$.fragment,e),h(se.$$.fragment,e),h(ae.$$.fragment,e),h(re.$$.fragment,e),h(E.$$.fragment,e),h(J.$$.fragment,e),h(ie.$$.fragment,e),h(de.$$.fragment,e),h(le.$$.fragment,e),h(R.$$.fragment,e),h(ce.$$.fragment,e),Xe=!0)},o(e){f(C.$$.fragment,e),f(z.$$.fragment,e),f(N.$$.fragment,e),f(A.$$.fragment,e),f(Y.$$.fragment,e),f(K.$$.fragment,e),f(ee.$$.fragment,e),f(W.$$.fragment,e),f(oe.$$.fragment,e),f(te.$$.fragment,e),f(ne.$$.fragment,e),f(S.$$.fragment,e),f(se.$$.fragment,e),f(ae.$$.fragment,e),f(re.$$.fragment,e),f(E.$$.fragment,e),f(J.$$.fragment,e),f(ie.$$.fragment,e),f(de.$$.fragment,e),f(le.$$.fragment,e),f(R.$$.fragment,e),f(ce.$$.fragment,e),Xe=!1},d(e){e&&(t(w),t(i),t(M),t(y),t(ze),t(P),t(Ue),t(Fe),t(H),t(je),t(G),t(qe),t(X),t(Be),t(Ze),t(O),t(Ie),t(D),t(Le),t(We),t(Se),t(k),t(Ee),t(Je),t(v),t(Re),t(Ve),t(B),t(Pe),t(Ne),t(b),t(He),t(Ge),t(Ce)),t(n),g(C,e),g(z,e),g(N,e),g(A,e),g(Y,e),g(K,e),g(ee),g(W),g(oe,e),g(te),g(ne),g(S),g(se,e),g(ae),g(re),g(E),g(J),g(ie,e),g(de),g(le),g(R),g(ce,e)}}}const Do='{"title":"Qwen2MoE","local":"qwen2moe","sections":[{"title":"Overview","local":"overview","sections":[{"title":"Model Details","local":"model-details","sections":[],"depth":3}],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Qwen2MoeConfig","local":"transformers.Qwen2MoeConfig","sections":[],"depth":2},{"title":"Qwen2MoeModel","local":"transformers.Qwen2MoeModel","sections":[],"depth":2},{"title":"Qwen2MoeForCausalLM","local":"transformers.Qwen2MoeForCausalLM","sections":[],"depth":2},{"title":"Qwen2MoeForSequenceClassification","local":"transformers.Qwen2MoeForSequenceClassification","sections":[],"depth":2}],"depth":1}';function Yo(Q){return Eo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rt extends Jo{constructor(n){super(),Ro(this,n,Yo,Oo,So,{})}}export{rt as component};
