import{s as Xn,o as Gn,n as te}from"../chunks/scheduler.25b97de1.js";import{S as En,i as On,g as l,s as a,r as h,m as Sn,A as An,h as d,f as s,c as r,j as F,u,x as b,n as Rn,k as j,y as o,a as p,v as f,d as g,t as _,w}from"../chunks/index.d9030fc9.js";import{T as qt}from"../chunks/Tip.baa67368.js";import{D as L}from"../chunks/Docstring.e257edda.js";import{C as at}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Ft}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as N,E as Dn}from"../chunks/EditOnGithub.91d95064.js";function Yn($){let t,k;return t=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFF3ZW4yTW9kZWwlMkMlMjBRd2VuMkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBRd2VuMiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBRd2VuMkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMFF3ZW4yLTdCJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBRd2VuMk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen2Model, Qwen2Config

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the Qwen2-7B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Qwen2Model(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(i){u(t.$$.fragment,i)},m(i,m){f(t,i,m),k=!0},p:te,i(i){k||(g(t.$$.fragment,i),k=!0)},o(i){_(t.$$.fragment,i),k=!1},d(i){w(t,i)}}}function Kn($){let t,k="be encoded differently whether it is at the beginning of the sentence (without space) or not:",i,m,y;return m=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFF3ZW4yVG9rZW5pemVyJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwUXdlbjJUb2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlF3ZW4lMkZRd2VuLXRva2VuaXplciUyMiklMEF0b2tlbml6ZXIoJTIySGVsbG8lMjB3b3JsZCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQlMEElMEF0b2tlbml6ZXIoJTIyJTIwSGVsbG8lMjB3b3JsZCUyMiklNUIlMjJpbnB1dF9pZHMlMjIlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen2Tokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = Qwen2Tokenizer.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen-tokenizer&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">9707</span>, <span class="hljs-number">1879</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">21927</span>, <span class="hljs-number">1879</span>]`,wrap:!1}}),{c(){t=l("p"),t.textContent=k,i=a(),h(m.$$.fragment)},l(c){t=d(c,"P",{"data-svelte-h":!0}),b(t)!=="svelte-12atnao"&&(t.textContent=k),i=r(c),u(m.$$.fragment,c)},m(c,T){p(c,t,T),p(c,i,T),f(m,c,T),y=!0},p:te,i(c){y||(g(m.$$.fragment,c),y=!0)},o(c){_(m.$$.fragment,c),y=!1},d(c){c&&(s(t),s(i)),w(m,c)}}}function eo($){let t,k="be encoded differently whether it is at the beginning of the sentence (without space) or not:",i,m,y;return m=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFF3ZW4yVG9rZW5pemVyRmFzdCUwQSUwQXRva2VuaXplciUyMCUzRCUyMFF3ZW4yVG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIyUXdlbiUyRlF3ZW4tdG9rZW5pemVyJTIyKSUwQXRva2VuaXplciglMjJIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RCUwQSUwQXRva2VuaXplciglMjIlMjBIZWxsbyUyMHdvcmxkJTIyKSU1QiUyMmlucHV0X2lkcyUyMiU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Qwen2TokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = Qwen2TokenizerFast.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen-tokenizer&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">9707</span>, <span class="hljs-number">1879</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">21927</span>, <span class="hljs-number">1879</span>]`,wrap:!1}}),{c(){t=l("p"),t.textContent=k,i=a(),h(m.$$.fragment)},l(c){t=d(c,"P",{"data-svelte-h":!0}),b(t)!=="svelte-12atnao"&&(t.textContent=k),i=r(c),u(m.$$.fragment,c)},m(c,T){p(c,t,T),p(c,i,T),f(m,c,T),y=!0},p:te,i(c){y||(g(m.$$.fragment,c),y=!0)},o(c){_(m.$$.fragment,c),y=!1},d(c){c&&(s(t),s(i)),w(m,c)}}}function to($){let t,k=`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=l("p"),t.innerHTML=k},l(i){t=d(i,"P",{"data-svelte-h":!0}),b(t)!=="svelte-fincs2"&&(t.innerHTML=k)},m(i,m){p(i,t,m)},p:te,d(i){i&&s(t)}}}function no($){let t,k=`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=l("p"),t.innerHTML=k},l(i){t=d(i,"P",{"data-svelte-h":!0}),b(t)!=="svelte-fincs2"&&(t.innerHTML=k)},m(i,m){p(i,t,m)},p:te,d(i){i&&s(t)}}}function oo($){let t,k="Example:",i,m,y;return m=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBRd2VuMkZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBRd2VuMkZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZChQQVRIX1RPX0NPTlZFUlRFRF9XRUlHSFRTKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKFBBVEhfVE9fQ09OVkVSVEVEX1RPS0VOSVpFUiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, Qwen2ForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = Qwen2ForCausalLM.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(){t=l("p"),t.textContent=k,i=a(),h(m.$$.fragment)},l(c){t=d(c,"P",{"data-svelte-h":!0}),b(t)!=="svelte-11lpom8"&&(t.textContent=k),i=r(c),u(m.$$.fragment,c)},m(c,T){p(c,t,T),p(c,i,T),f(m,c,T),y=!0},p:te,i(c){y||(g(m.$$.fragment,c),y=!0)},o(c){_(m.$$.fragment,c),y=!1},d(c){c&&(s(t),s(i)),w(m,c)}}}function so($){let t,k=`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=l("p"),t.innerHTML=k},l(i){t=d(i,"P",{"data-svelte-h":!0}),b(t)!=="svelte-fincs2"&&(t.innerHTML=k)},m(i,m){p(i,t,m)},p:te,d(i){i&&s(t)}}}function ao($){let t,k=`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=l("p"),t.innerHTML=k},l(i){t=d(i,"P",{"data-svelte-h":!0}),b(t)!=="svelte-fincs2"&&(t.innerHTML=k)},m(i,m){p(i,t,m)},p:te,d(i){i&&s(t)}}}function ro($){let t,k,i,m,y,c,T,rt,ne,gn="Qwen2 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.",it,oe,lt,se,_n="Qwen2 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. It 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.",dt,ae,ct,re,wn='<code>Qwen2-7B-beta</code> and <code>Qwen2-7B-Chat-beta</code> can be found on the <a href="https://huggingface.co/Qwen" rel="nofollow">Huggingface Hub</a>',pt,ie,bn="In the following, we demonstrate how to use <code>Qwen2-7B-Chat-beta</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.",mt,le,ht,de,ut,U,ce,jt,qe,kn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2Model">Qwen2Model</a>. It is used to instantiate a
Qwen2 model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of
Qwen2-7B-beta <a href="https://huggingface.co/Qwen/Qwen2-7B-beta" rel="nofollow">Qwen/Qwen2-7B-beta</a>.`,Ut,Fe,yn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,It,G,ft,pe,gt,v,me,Pt,je,Tn="Construct a Qwen2 tokenizer. Based on byte-level Byte-Pair-Encoding.",Wt,Ue,vn="Same with GPT2Tokenizer, this tokenizer has been trained to treat spaces like parts of the tokens so a word will",Lt,E,Zt,Ie,Mn="You should not use GPT2Tokenizer instead, because of the different pretokenization rules.",Bt,Pe,$n=`This tokenizer inherits from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`,Nt,We,he,_t,ue,wt,Q,fe,Vt,Le,zn=`Construct a “fast” Qwen2 tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on byte-level
Byte-Pair-Encoding.`,Jt,Ze,Qn="Same with GPT2Tokenizer, this tokenizer has been trained to treat spaces like parts of the tokens so a word will",Ht,O,St,Be,Cn=`This tokenizer inherits from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,bt,ge,kt,C,_e,Rt,Ne,xn=`The bare Qwen2 Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/main/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.)`,Xt,Ve,qn=`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.`,Gt,Je,Fn="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>Qwen2DecoderLayer</code>",Et,V,we,Ot,He,jn='The <a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2Model">Qwen2Model</a> forward method, overrides the <code>__call__</code> special method.',At,A,yt,be,Tt,R,ke,Dt,W,ye,Yt,Se,Un='The <a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2ForCausalLM">Qwen2ForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Kt,D,en,Y,vt,Te,Mt,M,ve,tn,Re,In="The Qwen2 Model transformer with a sequence classification head on top (linear layer).",nn,Xe,Pn=`<a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2ForSequenceClassification">Qwen2ForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,on,Ge,Wn=`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).`,sn,Ee,Ln=`This model inherits from <a href="/docs/transformers/main/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.)`,an,Oe,Zn=`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.`,rn,J,Me,ln,Ae,Bn='The <a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2ForSequenceClassification">Qwen2ForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',dn,K,$t,$e,zt,x,ze,cn,De,Nn=`The Qwen2 Model transformer with a token classification head on top (a linear layer on top of the hidden-states
output) e.g. for Named-Entity-Recognition (NER) tasks.`,pn,Ye,Vn=`This model inherits from <a href="/docs/transformers/main/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.)`,mn,Ke,Jn=`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.`,hn,H,Qe,un,et,Hn='The <a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2ForTokenClassification">Qwen2ForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',fn,ee,Qt,Ce,Ct,ot,xt;return y=new N({props:{title:"Qwen2",local:"qwen2",headingTag:"h1"}}),T=new N({props:{title:"Overview",local:"overview",headingTag:"h2"}}),oe=new N({props:{title:"Model Details",local:"model-details",headingTag:"h3"}}),ae=new N({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),le=new at({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUwQWRldmljZSUyMCUzRCUyMCUyMmN1ZGElMjIlMjAlMjMlMjB0aGUlMjBkZXZpY2UlMjB0byUyMGxvYWQlMjB0aGUlMjBtb2RlbCUyMG9udG8lMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJRd2VuJTJGUXdlbjEuNS03Qi1DaGF0JTIyJTJDJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyUXdlbiUyRlF3ZW4xLjUtN0ItQ2hhdCUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJHaXZlJTIwbWUlMjBhJTIwc2hvcnQlMjBpbnRyb2R1Y3Rpb24lMjB0byUyMGxhcmdlJTIwbGFuZ3VhZ2UlMjBtb2RlbC4lMjIlMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMHByb21wdCU3RCU1RCUwQSUwQXRleHQlMjAlM0QlMjB0b2tlbml6ZXIuYXBwbHlfY2hhdF90ZW1wbGF0ZShtZXNzYWdlcyUyQyUyMHRva2VuaXplJTNERmFsc2UlMkMlMjBhZGRfZ2VuZXJhdGlvbl9wcm9tcHQlM0RUcnVlKSUwQSUwQW1vZGVsX2lucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUJ0ZXh0JTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8oZGV2aWNlKSUwQSUwQWdlbmVyYXRlZF9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShtb2RlbF9pbnB1dHMuaW5wdXRfaWRzJTJDJTIwbWF4X25ld190b2tlbnMlM0Q1MTIlMkMlMjBkb19zYW1wbGUlM0RUcnVlKSUwQSUwQWdlbmVyYXRlZF9pZHMlMjAlM0QlMjAlNUJvdXRwdXRfaWRzJTVCbGVuKGlucHV0X2lkcyklM0ElNUQlMjBmb3IlMjBpbnB1dF9pZHMlMkMlMjBvdXRwdXRfaWRzJTIwaW4lMjB6aXAobW9kZWxfaW5wdXRzLmlucHV0X2lkcyUyQyUyMGdlbmVyYXRlZF9pZHMpJTVEJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjB0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlZF9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSklNUIwJTVE",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-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-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}}),de=new N({props:{title:"Qwen2Config",local:"transformers.Qwen2Config",headingTag:"h2"}}),ce=new L({props:{name:"class transformers.Qwen2Config",anchor:"transformers.Qwen2Config",parameters:[{name:"vocab_size",val:" = 151936"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 22016"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"num_key_value_heads",val:" = 32"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Qwen2Config.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 151936) &#x2014;
Vocabulary size of the Qwen2 model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2Model">Qwen2Model</a>`,name:"vocab_size"},{anchor:"transformers.Qwen2Config.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.Qwen2Config.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 22016) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.Qwen2Config.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Qwen2Config.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Qwen2Config.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#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>32</code>.`,name:"num_key_value_heads"},{anchor:"transformers.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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.Qwen2Config.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2/configuration_qwen2.py#L24"}}),G=new Ft({props:{anchor:"transformers.Qwen2Config.example",$$slots:{default:[Yn]},$$scope:{ctx:$}}}),pe=new N({props:{title:"Qwen2Tokenizer",local:"transformers.Qwen2Tokenizer",headingTag:"h2"}}),me=new L({props:{name:"class transformers.Qwen2Tokenizer",anchor:"transformers.Qwen2Tokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"errors",val:" = 'replace'"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = None"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = '<|endoftext|>'"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"split_special_tokens",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Qwen2Tokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.Qwen2Tokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.Qwen2Tokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.Qwen2Tokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.Qwen2Tokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The beginning of sequence token. Not applicable for this tokenizer.`,name:"bos_token"},{anchor:"transformers.Qwen2Tokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.Qwen2Tokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.Qwen2Tokenizer.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should cleanup the spaces that were added when splitting the input text during the
tokenization process. Not applicable to this tokenizer, since tokenization does not add spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Qwen2Tokenizer.split_special_tokens",description:`<strong>split_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the special tokens should be split during the tokenization process. The default behavior is
to not split special tokens. This means that if <code>&lt;|endoftext|&gt;</code> is the <code>eos_token</code>, then <code>tokenizer.tokenize(&quot;&lt;|endoftext|&gt;&quot;) = [&apos;&lt;|endoftext|&gt;</code>]. Otherwise, if <code>split_special_tokens=True</code>, then <code>tokenizer.tokenize(&quot;&lt;|endoftext|&gt;&quot;)</code> will be give <code>[&apos;&lt;&apos;, &apos;|&apos;, &apos;endo&apos;, &apos;ft&apos;, &apos;ext&apos;, &apos;|&apos;, &apos;&gt;&apos;]</code>. This argument is only supported for <code>slow</code> tokenizers for the moment.`,name:"split_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2/tokenization_qwen2.py#L83"}}),E=new Ft({props:{anchor:"transformers.Qwen2Tokenizer.example",$$slots:{default:[Kn]},$$scope:{ctx:$}}}),he=new L({props:{name:"save_vocabulary",anchor:"transformers.Qwen2Tokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2/tokenization_qwen2.py#L308"}}),ue=new N({props:{title:"Qwen2TokenizerFast",local:"transformers.Qwen2TokenizerFast",headingTag:"h2"}}),fe=new L({props:{name:"class transformers.Qwen2TokenizerFast",anchor:"transformers.Qwen2TokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = None"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = '<|endoftext|>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Qwen2TokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.Qwen2TokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.Qwen2TokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Path to <a href="https://github.com/huggingface/tokenizers" rel="nofollow">tokenizers</a> file (generally has a .json extension) that
contains everything needed to load the tokenizer.`,name:"tokenizer_file"},{anchor:"transformers.Qwen2TokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead. Not applicable to this tokenizer.`,name:"unk_token"},{anchor:"transformers.Qwen2TokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The beginning of sequence token. Not applicable for this tokenizer.`,name:"bos_token"},{anchor:"transformers.Qwen2TokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.Qwen2TokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2/tokenization_qwen2_fast.py#L37"}}),O=new Ft({props:{anchor:"transformers.Qwen2TokenizerFast.example",$$slots:{default:[eo]},$$scope:{ctx:$}}}),ge=new N({props:{title:"Qwen2Model",local:"transformers.Qwen2Model",headingTag:"h2"}}),_e=new L({props:{name:"class transformers.Qwen2Model",anchor:"transformers.Qwen2Model",parameters:[{name:"config",val:": Qwen2Config"}],parametersDescription:[{anchor:"transformers.Qwen2Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2Config">Qwen2Config</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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; Qwen2Config`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2/modeling_qwen2.py#L741"}}),we=new L({props:{name:"forward",anchor:"transformers.Qwen2Model.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:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Qwen2Model.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.Qwen2Model.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.Qwen2Model.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.Qwen2Model.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/main/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.Qwen2Model.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.Qwen2Model.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.Qwen2Model.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.Qwen2Model.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.Qwen2Model.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Qwen2Model.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/main/src/transformers/models/qwen2/modeling_qwen2.py#L775"}}),A=new qt({props:{$$slots:{default:[to]},$$scope:{ctx:$}}}),be=new N({props:{title:"Qwen2ForCausalLM",local:"transformers.Qwen2ForCausalLM",headingTag:"h2"}}),ke=new L({props:{name:"class transformers.Qwen2ForCausalLM",anchor:"transformers.Qwen2ForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2/modeling_qwen2.py#L975"}}),ye=new L({props:{name:"forward",anchor:"transformers.Qwen2ForCausalLM.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:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Qwen2ForCausalLM.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.Qwen2ForCausalLM.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.Qwen2ForCausalLM.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.Qwen2ForCausalLM.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/main/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.Qwen2ForCausalLM.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.Qwen2ForCausalLM.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.Qwen2ForCausalLM.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.Qwen2ForCausalLM.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.Qwen2ForCausalLM.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Qwen2ForCausalLM.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>.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2/modeling_qwen2.py#L1005",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> 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/main/en/model_doc/qwen2#transformers.Qwen2Config"
>Qwen2Config</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>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><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),D=new qt({props:{$$slots:{default:[no]},$$scope:{ctx:$}}}),Y=new Ft({props:{anchor:"transformers.Qwen2ForCausalLM.forward.example",$$slots:{default:[oo]},$$scope:{ctx:$}}}),Te=new N({props:{title:"Qwen2ForSequenceClassification",local:"transformers.Qwen2ForSequenceClassification",headingTag:"h2"}}),ve=new L({props:{name:"class transformers.Qwen2ForSequenceClassification",anchor:"transformers.Qwen2ForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Qwen2ForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2Config">Qwen2Config</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/main/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/main/src/transformers/models/qwen2/modeling_qwen2.py#L1142"}}),Me=new L({props:{name:"forward",anchor:"transformers.Qwen2ForSequenceClassification.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:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Qwen2ForSequenceClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.Qwen2ForSequenceClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.Qwen2ForSequenceClassification.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.Qwen2ForSequenceClassification.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/main/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.Qwen2ForSequenceClassification.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.Qwen2ForSequenceClassification.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.Qwen2ForSequenceClassification.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.Qwen2ForSequenceClassification.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.Qwen2ForSequenceClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Qwen2ForSequenceClassification.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"},{anchor:"transformers.Qwen2ForSequenceClassification.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/main/src/transformers/models/qwen2/modeling_qwen2.py#L1173"}}),K=new qt({props:{$$slots:{default:[so]},$$scope:{ctx:$}}}),$e=new N({props:{title:"Qwen2ForTokenClassification",local:"transformers.Qwen2ForTokenClassification",headingTag:"h2"}}),ze=new L({props:{name:"class transformers.Qwen2ForTokenClassification",anchor:"transformers.Qwen2ForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Qwen2ForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2Config">Qwen2Config</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/main/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/main/src/transformers/models/qwen2/modeling_qwen2.py#L1265"}}),Qe=new L({props:{name:"forward",anchor:"transformers.Qwen2ForTokenClassification.forward",parameters:[{name:"input_ids",val:": Optional = 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:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.Qwen2ForTokenClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.Qwen2ForTokenClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.Qwen2ForTokenClassification.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.Qwen2ForTokenClassification.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/main/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.Qwen2ForTokenClassification.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.Qwen2ForTokenClassification.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.Qwen2ForTokenClassification.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.Qwen2ForTokenClassification.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.Qwen2ForTokenClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.Qwen2ForTokenClassification.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"},{anchor:"transformers.Qwen2ForTokenClassification.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/main/src/transformers/models/qwen2/modeling_qwen2.py#L1296"}}),ee=new qt({props:{$$slots:{default:[ao]},$$scope:{ctx:$}}}),Ce=new Dn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/qwen2.md"}}),{c(){t=l("meta"),k=a(),i=l("p"),m=a(),h(y.$$.fragment),c=a(),h(T.$$.fragment),rt=a(),ne=l("p"),ne.textContent=gn,it=a(),h(oe.$$.fragment),lt=a(),se=l("p"),se.textContent=_n,dt=a(),h(ae.$$.fragment),ct=a(),re=l("p"),re.innerHTML=wn,pt=a(),ie=l("p"),ie.innerHTML=bn,mt=a(),h(le.$$.fragment),ht=a(),h(de.$$.fragment),ut=a(),U=l("div"),h(ce.$$.fragment),jt=a(),qe=l("p"),qe.innerHTML=kn,Ut=a(),Fe=l("p"),Fe.innerHTML=yn,It=a(),h(G.$$.fragment),ft=a(),h(pe.$$.fragment),gt=a(),v=l("div"),h(me.$$.fragment),Pt=a(),je=l("p"),je.textContent=Tn,Wt=a(),Ue=l("p"),Ue.textContent=vn,Lt=a(),h(E.$$.fragment),Zt=Sn(`
This is expected.
`),Ie=l("p"),Ie.textContent=Mn,Bt=a(),Pe=l("p"),Pe.innerHTML=$n,Nt=a(),We=l("div"),h(he.$$.fragment),_t=a(),h(ue.$$.fragment),wt=a(),Q=l("div"),h(fe.$$.fragment),Vt=a(),Le=l("p"),Le.innerHTML=zn,Jt=a(),Ze=l("p"),Ze.textContent=Qn,Ht=a(),h(O.$$.fragment),St=Sn(`
This is expected.
`),Be=l("p"),Be.innerHTML=Cn,bt=a(),h(ge.$$.fragment),kt=a(),C=l("div"),h(_e.$$.fragment),Rt=a(),Ne=l("p"),Ne.innerHTML=xn,Xt=a(),Ve=l("p"),Ve.innerHTML=qn,Gt=a(),Je=l("p"),Je.innerHTML=Fn,Et=a(),V=l("div"),h(we.$$.fragment),Ot=a(),He=l("p"),He.innerHTML=jn,At=a(),h(A.$$.fragment),yt=a(),h(be.$$.fragment),Tt=a(),R=l("div"),h(ke.$$.fragment),Dt=a(),W=l("div"),h(ye.$$.fragment),Yt=a(),Se=l("p"),Se.innerHTML=Un,Kt=a(),h(D.$$.fragment),en=a(),h(Y.$$.fragment),vt=a(),h(Te.$$.fragment),Mt=a(),M=l("div"),h(ve.$$.fragment),tn=a(),Re=l("p"),Re.textContent=In,nn=a(),Xe=l("p"),Xe.innerHTML=Pn,on=a(),Ge=l("p"),Ge.innerHTML=Wn,sn=a(),Ee=l("p"),Ee.innerHTML=Ln,an=a(),Oe=l("p"),Oe.innerHTML=Zn,rn=a(),J=l("div"),h(Me.$$.fragment),ln=a(),Ae=l("p"),Ae.innerHTML=Bn,dn=a(),h(K.$$.fragment),$t=a(),h($e.$$.fragment),zt=a(),x=l("div"),h(ze.$$.fragment),cn=a(),De=l("p"),De.textContent=Nn,pn=a(),Ye=l("p"),Ye.innerHTML=Vn,mn=a(),Ke=l("p"),Ke.innerHTML=Jn,hn=a(),H=l("div"),h(Qe.$$.fragment),un=a(),et=l("p"),et.innerHTML=Hn,fn=a(),h(ee.$$.fragment),Qt=a(),h(Ce.$$.fragment),Ct=a(),ot=l("p"),this.h()},l(e){const n=An("svelte-u9bgzb",document.head);t=d(n,"META",{name:!0,content:!0}),n.forEach(s),k=r(e),i=d(e,"P",{}),F(i).forEach(s),m=r(e),u(y.$$.fragment,e),c=r(e),u(T.$$.fragment,e),rt=r(e),ne=d(e,"P",{"data-svelte-h":!0}),b(ne)!=="svelte-czz8ve"&&(ne.textContent=gn),it=r(e),u(oe.$$.fragment,e),lt=r(e),se=d(e,"P",{"data-svelte-h":!0}),b(se)!=="svelte-1l7nw08"&&(se.textContent=_n),dt=r(e),u(ae.$$.fragment,e),ct=r(e),re=d(e,"P",{"data-svelte-h":!0}),b(re)!=="svelte-1wynr6y"&&(re.innerHTML=wn),pt=r(e),ie=d(e,"P",{"data-svelte-h":!0}),b(ie)!=="svelte-1xa3n8x"&&(ie.innerHTML=bn),mt=r(e),u(le.$$.fragment,e),ht=r(e),u(de.$$.fragment,e),ut=r(e),U=d(e,"DIV",{class:!0});var Z=F(U);u(ce.$$.fragment,Z),jt=r(Z),qe=d(Z,"P",{"data-svelte-h":!0}),b(qe)!=="svelte-jj6mgr"&&(qe.innerHTML=kn),Ut=r(Z),Fe=d(Z,"P",{"data-svelte-h":!0}),b(Fe)!=="svelte-o55m63"&&(Fe.innerHTML=yn),It=r(Z),u(G.$$.fragment,Z),Z.forEach(s),ft=r(e),u(pe.$$.fragment,e),gt=r(e),v=d(e,"DIV",{class:!0});var z=F(v);u(me.$$.fragment,z),Pt=r(z),je=d(z,"P",{"data-svelte-h":!0}),b(je)!=="svelte-owj012"&&(je.textContent=Tn),Wt=r(z),Ue=d(z,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-ei9kk8"&&(Ue.textContent=vn),Lt=r(z),u(E.$$.fragment,z),Zt=Rn(z,`
This is expected.
`),Ie=d(z,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-187588w"&&(Ie.textContent=Mn),Bt=r(z),Pe=d(z,"P",{"data-svelte-h":!0}),b(Pe)!=="svelte-1c3t5ty"&&(Pe.innerHTML=$n),Nt=r(z),We=d(z,"DIV",{class:!0});var st=F(We);u(he.$$.fragment,st),st.forEach(s),z.forEach(s),_t=r(e),u(ue.$$.fragment,e),wt=r(e),Q=d(e,"DIV",{class:!0});var I=F(Q);u(fe.$$.fragment,I),Vt=r(I),Le=d(I,"P",{"data-svelte-h":!0}),b(Le)!=="svelte-v6yiax"&&(Le.innerHTML=zn),Jt=r(I),Ze=d(I,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-ei9kk8"&&(Ze.textContent=Qn),Ht=r(I),u(O.$$.fragment,I),St=Rn(I,`
This is expected.
`),Be=d(I,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-fh0aq"&&(Be.innerHTML=Cn),I.forEach(s),bt=r(e),u(ge.$$.fragment,e),kt=r(e),C=d(e,"DIV",{class:!0});var P=F(C);u(_e.$$.fragment,P),Rt=r(P),Ne=d(P,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-85adkl"&&(Ne.innerHTML=xn),Xt=r(P),Ve=d(P,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-hswkmf"&&(Ve.innerHTML=qn),Gt=r(P),Je=d(P,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-uhrr2y"&&(Je.innerHTML=Fn),Et=r(P),V=d(P,"DIV",{class:!0});var X=F(V);u(we.$$.fragment,X),Ot=r(X),He=d(X,"P",{"data-svelte-h":!0}),b(He)!=="svelte-6pqifo"&&(He.innerHTML=jn),At=r(X),u(A.$$.fragment,X),X.forEach(s),P.forEach(s),yt=r(e),u(be.$$.fragment,e),Tt=r(e),R=d(e,"DIV",{class:!0});var xe=F(R);u(ke.$$.fragment,xe),Dt=r(xe),W=d(xe,"DIV",{class:!0});var B=F(W);u(ye.$$.fragment,B),Yt=r(B),Se=d(B,"P",{"data-svelte-h":!0}),b(Se)!=="svelte-1uc776k"&&(Se.innerHTML=Un),Kt=r(B),u(D.$$.fragment,B),en=r(B),u(Y.$$.fragment,B),B.forEach(s),xe.forEach(s),vt=r(e),u(Te.$$.fragment,e),Mt=r(e),M=d(e,"DIV",{class:!0});var q=F(M);u(ve.$$.fragment,q),tn=r(q),Re=d(q,"P",{"data-svelte-h":!0}),b(Re)!=="svelte-1xr0wlj"&&(Re.textContent=In),nn=r(q),Xe=d(q,"P",{"data-svelte-h":!0}),b(Xe)!=="svelte-1ew6odr"&&(Xe.innerHTML=Pn),on=r(q),Ge=d(q,"P",{"data-svelte-h":!0}),b(Ge)!=="svelte-10ugs3m"&&(Ge.innerHTML=Wn),sn=r(q),Ee=d(q,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-6pahdo"&&(Ee.innerHTML=Ln),an=r(q),Oe=d(q,"P",{"data-svelte-h":!0}),b(Oe)!=="svelte-hswkmf"&&(Oe.innerHTML=Zn),rn=r(q),J=d(q,"DIV",{class:!0});var tt=F(J);u(Me.$$.fragment,tt),ln=r(tt),Ae=d(tt,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-15bkruu"&&(Ae.innerHTML=Bn),dn=r(tt),u(K.$$.fragment,tt),tt.forEach(s),q.forEach(s),$t=r(e),u($e.$$.fragment,e),zt=r(e),x=d(e,"DIV",{class:!0});var S=F(x);u(ze.$$.fragment,S),cn=r(S),De=d(S,"P",{"data-svelte-h":!0}),b(De)!=="svelte-fi8frs"&&(De.textContent=Nn),pn=r(S),Ye=d(S,"P",{"data-svelte-h":!0}),b(Ye)!=="svelte-6pahdo"&&(Ye.innerHTML=Vn),mn=r(S),Ke=d(S,"P",{"data-svelte-h":!0}),b(Ke)!=="svelte-hswkmf"&&(Ke.innerHTML=Jn),hn=r(S),H=d(S,"DIV",{class:!0});var nt=F(H);u(Qe.$$.fragment,nt),un=r(nt),et=d(nt,"P",{"data-svelte-h":!0}),b(et)!=="svelte-1ndsw4"&&(et.innerHTML=Hn),fn=r(nt),u(ee.$$.fragment,nt),nt.forEach(s),S.forEach(s),Qt=r(e),u(Ce.$$.fragment,e),Ct=r(e),ot=d(e,"P",{}),F(ot).forEach(s),this.h()},h(){j(t,"name","hf:doc:metadata"),j(t,"content",io),j(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(x,"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,n){o(document.head,t),p(e,k,n),p(e,i,n),p(e,m,n),f(y,e,n),p(e,c,n),f(T,e,n),p(e,rt,n),p(e,ne,n),p(e,it,n),f(oe,e,n),p(e,lt,n),p(e,se,n),p(e,dt,n),f(ae,e,n),p(e,ct,n),p(e,re,n),p(e,pt,n),p(e,ie,n),p(e,mt,n),f(le,e,n),p(e,ht,n),f(de,e,n),p(e,ut,n),p(e,U,n),f(ce,U,null),o(U,jt),o(U,qe),o(U,Ut),o(U,Fe),o(U,It),f(G,U,null),p(e,ft,n),f(pe,e,n),p(e,gt,n),p(e,v,n),f(me,v,null),o(v,Pt),o(v,je),o(v,Wt),o(v,Ue),o(v,Lt),f(E,v,null),o(v,Zt),o(v,Ie),o(v,Bt),o(v,Pe),o(v,Nt),o(v,We),f(he,We,null),p(e,_t,n),f(ue,e,n),p(e,wt,n),p(e,Q,n),f(fe,Q,null),o(Q,Vt),o(Q,Le),o(Q,Jt),o(Q,Ze),o(Q,Ht),f(O,Q,null),o(Q,St),o(Q,Be),p(e,bt,n),f(ge,e,n),p(e,kt,n),p(e,C,n),f(_e,C,null),o(C,Rt),o(C,Ne),o(C,Xt),o(C,Ve),o(C,Gt),o(C,Je),o(C,Et),o(C,V),f(we,V,null),o(V,Ot),o(V,He),o(V,At),f(A,V,null),p(e,yt,n),f(be,e,n),p(e,Tt,n),p(e,R,n),f(ke,R,null),o(R,Dt),o(R,W),f(ye,W,null),o(W,Yt),o(W,Se),o(W,Kt),f(D,W,null),o(W,en),f(Y,W,null),p(e,vt,n),f(Te,e,n),p(e,Mt,n),p(e,M,n),f(ve,M,null),o(M,tn),o(M,Re),o(M,nn),o(M,Xe),o(M,on),o(M,Ge),o(M,sn),o(M,Ee),o(M,an),o(M,Oe),o(M,rn),o(M,J),f(Me,J,null),o(J,ln),o(J,Ae),o(J,dn),f(K,J,null),p(e,$t,n),f($e,e,n),p(e,zt,n),p(e,x,n),f(ze,x,null),o(x,cn),o(x,De),o(x,pn),o(x,Ye),o(x,mn),o(x,Ke),o(x,hn),o(x,H),f(Qe,H,null),o(H,un),o(H,et),o(H,fn),f(ee,H,null),p(e,Qt,n),f(Ce,e,n),p(e,Ct,n),p(e,ot,n),xt=!0},p(e,[n]){const Z={};n&2&&(Z.$$scope={dirty:n,ctx:e}),G.$set(Z);const z={};n&2&&(z.$$scope={dirty:n,ctx:e}),E.$set(z);const st={};n&2&&(st.$$scope={dirty:n,ctx:e}),O.$set(st);const I={};n&2&&(I.$$scope={dirty:n,ctx:e}),A.$set(I);const P={};n&2&&(P.$$scope={dirty:n,ctx:e}),D.$set(P);const X={};n&2&&(X.$$scope={dirty:n,ctx:e}),Y.$set(X);const xe={};n&2&&(xe.$$scope={dirty:n,ctx:e}),K.$set(xe);const B={};n&2&&(B.$$scope={dirty:n,ctx:e}),ee.$set(B)},i(e){xt||(g(y.$$.fragment,e),g(T.$$.fragment,e),g(oe.$$.fragment,e),g(ae.$$.fragment,e),g(le.$$.fragment,e),g(de.$$.fragment,e),g(ce.$$.fragment,e),g(G.$$.fragment,e),g(pe.$$.fragment,e),g(me.$$.fragment,e),g(E.$$.fragment,e),g(he.$$.fragment,e),g(ue.$$.fragment,e),g(fe.$$.fragment,e),g(O.$$.fragment,e),g(ge.$$.fragment,e),g(_e.$$.fragment,e),g(we.$$.fragment,e),g(A.$$.fragment,e),g(be.$$.fragment,e),g(ke.$$.fragment,e),g(ye.$$.fragment,e),g(D.$$.fragment,e),g(Y.$$.fragment,e),g(Te.$$.fragment,e),g(ve.$$.fragment,e),g(Me.$$.fragment,e),g(K.$$.fragment,e),g($e.$$.fragment,e),g(ze.$$.fragment,e),g(Qe.$$.fragment,e),g(ee.$$.fragment,e),g(Ce.$$.fragment,e),xt=!0)},o(e){_(y.$$.fragment,e),_(T.$$.fragment,e),_(oe.$$.fragment,e),_(ae.$$.fragment,e),_(le.$$.fragment,e),_(de.$$.fragment,e),_(ce.$$.fragment,e),_(G.$$.fragment,e),_(pe.$$.fragment,e),_(me.$$.fragment,e),_(E.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(fe.$$.fragment,e),_(O.$$.fragment,e),_(ge.$$.fragment,e),_(_e.$$.fragment,e),_(we.$$.fragment,e),_(A.$$.fragment,e),_(be.$$.fragment,e),_(ke.$$.fragment,e),_(ye.$$.fragment,e),_(D.$$.fragment,e),_(Y.$$.fragment,e),_(Te.$$.fragment,e),_(ve.$$.fragment,e),_(Me.$$.fragment,e),_(K.$$.fragment,e),_($e.$$.fragment,e),_(ze.$$.fragment,e),_(Qe.$$.fragment,e),_(ee.$$.fragment,e),_(Ce.$$.fragment,e),xt=!1},d(e){e&&(s(k),s(i),s(m),s(c),s(rt),s(ne),s(it),s(lt),s(se),s(dt),s(ct),s(re),s(pt),s(ie),s(mt),s(ht),s(ut),s(U),s(ft),s(gt),s(v),s(_t),s(wt),s(Q),s(bt),s(kt),s(C),s(yt),s(Tt),s(R),s(vt),s(Mt),s(M),s($t),s(zt),s(x),s(Qt),s(Ct),s(ot)),s(t),w(y,e),w(T,e),w(oe,e),w(ae,e),w(le,e),w(de,e),w(ce),w(G),w(pe,e),w(me),w(E),w(he),w(ue,e),w(fe),w(O),w(ge,e),w(_e),w(we),w(A),w(be,e),w(ke),w(ye),w(D),w(Y),w(Te,e),w(ve),w(Me),w(K),w($e,e),w(ze),w(Qe),w(ee),w(Ce,e)}}}const io='{"title":"Qwen2","local":"qwen2","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":"Qwen2Config","local":"transformers.Qwen2Config","sections":[],"depth":2},{"title":"Qwen2Tokenizer","local":"transformers.Qwen2Tokenizer","sections":[],"depth":2},{"title":"Qwen2TokenizerFast","local":"transformers.Qwen2TokenizerFast","sections":[],"depth":2},{"title":"Qwen2Model","local":"transformers.Qwen2Model","sections":[],"depth":2},{"title":"Qwen2ForCausalLM","local":"transformers.Qwen2ForCausalLM","sections":[],"depth":2},{"title":"Qwen2ForSequenceClassification","local":"transformers.Qwen2ForSequenceClassification","sections":[],"depth":2},{"title":"Qwen2ForTokenClassification","local":"transformers.Qwen2ForTokenClassification","sections":[],"depth":2}],"depth":1}';function lo($){return Gn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _o extends En{constructor(t){super(),On(this,t,lo,ro,Xn,{})}}export{_o as component};
