import{s as Xn,o as Gn,n as te}from"../chunks/scheduler.25b97de1.js";import{S as En,i as An,g as l,s as a,r as h,m as Sn,A as On,h as d,f as s,c as r,j,u,x as b,n as Rn,k as F,y as o,a as m,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 Z}from"../chunks/Docstring.ffac8efa.js";import{C as at}from"../chunks/CodeBlock.e6cd0d95.js";import{E as jt}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as V,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,p){f(t,i,p),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,p,y;return p=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(p.$$.fragment)},l(c){t=d(c,"P",{"data-svelte-h":!0}),b(t)!=="svelte-12atnao"&&(t.textContent=k),i=r(c),u(p.$$.fragment,c)},m(c,T){m(c,t,T),m(c,i,T),f(p,c,T),y=!0},p:te,i(c){y||(g(p.$$.fragment,c),y=!0)},o(c){_(p.$$.fragment,c),y=!1},d(c){c&&(s(t),s(i)),w(p,c)}}}function eo($){let t,k="be encoded differently whether it is at the beginning of the sentence (without space) or not:",i,p,y;return p=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(p.$$.fragment)},l(c){t=d(c,"P",{"data-svelte-h":!0}),b(t)!=="svelte-12atnao"&&(t.textContent=k),i=r(c),u(p.$$.fragment,c)},m(c,T){m(c,t,T),m(c,i,T),f(p,c,T),y=!0},p:te,i(c){y||(g(p.$$.fragment,c),y=!0)},o(c){_(p.$$.fragment,c),y=!1},d(c){c&&(s(t),s(i)),w(p,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,p){m(i,t,p)},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,p){m(i,t,p)},p:te,d(i){i&&s(t)}}}function oo($){let t,k="Example:",i,p,y;return p=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(p.$$.fragment)},l(c){t=d(c,"P",{"data-svelte-h":!0}),b(t)!=="svelte-11lpom8"&&(t.textContent=k),i=r(c),u(p.$$.fragment,c)},m(c,T){m(c,t,T),m(c,i,T),f(p,c,T),y=!0},p:te,i(c){y||(g(p.$$.fragment,c),y=!0)},o(c){_(p.$$.fragment,c),y=!1},d(c){c&&(s(t),s(i)),w(p,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,p){m(i,t,p)},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,p){m(i,t,p)},p:te,d(i){i&&s(t)}}}function ro($){let t,k,i,p,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>',mt,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.",pt,le,ht,de,ut,U,ce,Ft,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,je,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,me,gt,v,pe,Pt,Fe,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",Zt,E,Lt,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.`,Vt,We,he,_t,ue,wt,Q,fe,Jt,Ze,zn=`Construct a “fast” Qwen2 tokenizer (backed by HuggingFace’s <em>tokenizers</em> library). Based on byte-level
Byte-Pair-Encoding.`,Ht,Le,Qn="Same with GPT2Tokenizer, this tokenizer has been trained to treat spaces like parts of the tokens so a word will",Nt,A,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,Ve,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,Je,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,He,jn="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>Qwen2DecoderLayer</code>",Et,J,we,At,Ne,Fn='The <a href="/docs/transformers/main/en/model_doc/qwen2#transformers.Qwen2Model">Qwen2Model</a> forward method, overrides the <code>__call__</code> special method.',Ot,O,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,Zn=`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,Ae,Ln=`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,H,Me,ln,Oe,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,Vn=`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.`,mn,Ye,Jn=`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.)`,pn,Ke,Hn=`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,N,Qe,un,et,Nn='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 V({props:{title:"Qwen2",local:"qwen2",headingTag:"h1"}}),T=new V({props:{title:"Overview",local:"overview",headingTag:"h2"}}),oe=new V({props:{title:"Model Details",local:"model-details",headingTag:"h3"}}),ae=new V({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 V({props:{title:"Qwen2Config",local:"transformers.Qwen2Config",headingTag:"h2"}}),ce=new Z({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 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.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 jt({props:{anchor:"transformers.Qwen2Config.example",$$slots:{default:[Yn]},$$scope:{ctx:$}}}),me=new V({props:{title:"Qwen2Tokenizer",local:"transformers.Qwen2Tokenizer",headingTag:"h2"}}),pe=new Z({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 jt({props:{anchor:"transformers.Qwen2Tokenizer.example",$$slots:{default:[Kn]},$$scope:{ctx:$}}}),he=new Z({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 V({props:{title:"Qwen2TokenizerFast",local:"transformers.Qwen2TokenizerFast",headingTag:"h2"}}),fe=new Z({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"}}),A=new jt({props:{anchor:"transformers.Qwen2TokenizerFast.example",$$slots:{default:[eo]},$$scope:{ctx:$}}}),ge=new V({props:{title:"Qwen2Model",local:"transformers.Qwen2Model",headingTag:"h2"}}),_e=new Z({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#L898"}}),we=new Z({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"}],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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/qwen2/modeling_qwen2.py#L932"}}),O=new qt({props:{$$slots:{default:[to]},$$scope:{ctx:$}}}),be=new V({props:{title:"Qwen2ForCausalLM",local:"transformers.Qwen2ForCausalLM",headingTag:"h2"}}),ke=new Z({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#L1081"}}),ye=new Z({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"}],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.</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/main/src/transformers/models/qwen2/modeling_qwen2.py#L1111",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 jt({props:{anchor:"transformers.Qwen2ForCausalLM.forward.example",$$slots:{default:[oo]},$$scope:{ctx:$}}}),Te=new V({props:{title:"Qwen2ForSequenceClassification",local:"transformers.Qwen2ForSequenceClassification",headingTag:"h2"}}),ve=new Z({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#L1267"}}),Me=new Z({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.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#L1298"}}),K=new qt({props:{$$slots:{default:[so]},$$scope:{ctx:$}}}),$e=new V({props:{title:"Qwen2ForTokenClassification",local:"transformers.Qwen2ForTokenClassification",headingTag:"h2"}}),ze=new Z({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#L1390"}}),Qe=new Z({props:{name:"forward",anchor:"transformers.Qwen2ForTokenClassification.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.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.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#L1421"}}),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"),p=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,mt=a(),ie=l("p"),ie.innerHTML=bn,pt=a(),h(le.$$.fragment),ht=a(),h(de.$$.fragment),ut=a(),U=l("div"),h(ce.$$.fragment),Ft=a(),qe=l("p"),qe.innerHTML=kn,Ut=a(),je=l("p"),je.innerHTML=yn,It=a(),h(G.$$.fragment),ft=a(),h(me.$$.fragment),gt=a(),v=l("div"),h(pe.$$.fragment),Pt=a(),Fe=l("p"),Fe.textContent=Tn,Wt=a(),Ue=l("p"),Ue.textContent=vn,Zt=a(),h(E.$$.fragment),Lt=Sn(`
This is expected.
`),Ie=l("p"),Ie.textContent=Mn,Bt=a(),Pe=l("p"),Pe.innerHTML=$n,Vt=a(),We=l("div"),h(he.$$.fragment),_t=a(),h(ue.$$.fragment),wt=a(),Q=l("div"),h(fe.$$.fragment),Jt=a(),Ze=l("p"),Ze.innerHTML=zn,Ht=a(),Le=l("p"),Le.textContent=Qn,Nt=a(),h(A.$$.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(),Ve=l("p"),Ve.innerHTML=xn,Xt=a(),Je=l("p"),Je.innerHTML=qn,Gt=a(),He=l("p"),He.innerHTML=jn,Et=a(),J=l("div"),h(we.$$.fragment),At=a(),Ne=l("p"),Ne.innerHTML=Fn,Ot=a(),h(O.$$.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=Zn,an=a(),Ae=l("p"),Ae.innerHTML=Ln,rn=a(),H=l("div"),h(Me.$$.fragment),ln=a(),Oe=l("p"),Oe.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=Vn,mn=a(),Ye=l("p"),Ye.innerHTML=Jn,pn=a(),Ke=l("p"),Ke.innerHTML=Hn,hn=a(),N=l("div"),h(Qe.$$.fragment),un=a(),et=l("p"),et.innerHTML=Nn,fn=a(),h(ee.$$.fragment),Qt=a(),h(Ce.$$.fragment),Ct=a(),ot=l("p"),this.h()},l(e){const n=On("svelte-u9bgzb",document.head);t=d(n,"META",{name:!0,content:!0}),n.forEach(s),k=r(e),i=d(e,"P",{}),j(i).forEach(s),p=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),mt=r(e),ie=d(e,"P",{"data-svelte-h":!0}),b(ie)!=="svelte-1xa3n8x"&&(ie.innerHTML=bn),pt=r(e),u(le.$$.fragment,e),ht=r(e),u(de.$$.fragment,e),ut=r(e),U=d(e,"DIV",{class:!0});var L=j(U);u(ce.$$.fragment,L),Ft=r(L),qe=d(L,"P",{"data-svelte-h":!0}),b(qe)!=="svelte-jj6mgr"&&(qe.innerHTML=kn),Ut=r(L),je=d(L,"P",{"data-svelte-h":!0}),b(je)!=="svelte-o55m63"&&(je.innerHTML=yn),It=r(L),u(G.$$.fragment,L),L.forEach(s),ft=r(e),u(me.$$.fragment,e),gt=r(e),v=d(e,"DIV",{class:!0});var z=j(v);u(pe.$$.fragment,z),Pt=r(z),Fe=d(z,"P",{"data-svelte-h":!0}),b(Fe)!=="svelte-owj012"&&(Fe.textContent=Tn),Wt=r(z),Ue=d(z,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-ei9kk8"&&(Ue.textContent=vn),Zt=r(z),u(E.$$.fragment,z),Lt=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),Vt=r(z),We=d(z,"DIV",{class:!0});var st=j(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=j(Q);u(fe.$$.fragment,I),Jt=r(I),Ze=d(I,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-v6yiax"&&(Ze.innerHTML=zn),Ht=r(I),Le=d(I,"P",{"data-svelte-h":!0}),b(Le)!=="svelte-ei9kk8"&&(Le.textContent=Qn),Nt=r(I),u(A.$$.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=j(C);u(_e.$$.fragment,P),Rt=r(P),Ve=d(P,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-85adkl"&&(Ve.innerHTML=xn),Xt=r(P),Je=d(P,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-hswkmf"&&(Je.innerHTML=qn),Gt=r(P),He=d(P,"P",{"data-svelte-h":!0}),b(He)!=="svelte-uhrr2y"&&(He.innerHTML=jn),Et=r(P),J=d(P,"DIV",{class:!0});var X=j(J);u(we.$$.fragment,X),At=r(X),Ne=d(X,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-6pqifo"&&(Ne.innerHTML=Fn),Ot=r(X),u(O.$$.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=j(R);u(ke.$$.fragment,xe),Dt=r(xe),W=d(xe,"DIV",{class:!0});var B=j(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=j(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=Zn),an=r(q),Ae=d(q,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-hswkmf"&&(Ae.innerHTML=Ln),rn=r(q),H=d(q,"DIV",{class:!0});var tt=j(H);u(Me.$$.fragment,tt),ln=r(tt),Oe=d(tt,"P",{"data-svelte-h":!0}),b(Oe)!=="svelte-15bkruu"&&(Oe.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=j(x);u(ze.$$.fragment,S),cn=r(S),De=d(S,"P",{"data-svelte-h":!0}),b(De)!=="svelte-fi8frs"&&(De.textContent=Vn),mn=r(S),Ye=d(S,"P",{"data-svelte-h":!0}),b(Ye)!=="svelte-6pahdo"&&(Ye.innerHTML=Jn),pn=r(S),Ke=d(S,"P",{"data-svelte-h":!0}),b(Ke)!=="svelte-hswkmf"&&(Ke.innerHTML=Hn),hn=r(S),N=d(S,"DIV",{class:!0});var nt=j(N);u(Qe.$$.fragment,nt),un=r(nt),et=d(nt,"P",{"data-svelte-h":!0}),b(et)!=="svelte-1ndsw4"&&(et.innerHTML=Nn),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",{}),j(ot).forEach(s),this.h()},h(){F(t,"name","hf:doc:metadata"),F(t,"content",io),F(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(We,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(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),m(e,k,n),m(e,i,n),m(e,p,n),f(y,e,n),m(e,c,n),f(T,e,n),m(e,rt,n),m(e,ne,n),m(e,it,n),f(oe,e,n),m(e,lt,n),m(e,se,n),m(e,dt,n),f(ae,e,n),m(e,ct,n),m(e,re,n),m(e,mt,n),m(e,ie,n),m(e,pt,n),f(le,e,n),m(e,ht,n),f(de,e,n),m(e,ut,n),m(e,U,n),f(ce,U,null),o(U,Ft),o(U,qe),o(U,Ut),o(U,je),o(U,It),f(G,U,null),m(e,ft,n),f(me,e,n),m(e,gt,n),m(e,v,n),f(pe,v,null),o(v,Pt),o(v,Fe),o(v,Wt),o(v,Ue),o(v,Zt),f(E,v,null),o(v,Lt),o(v,Ie),o(v,Bt),o(v,Pe),o(v,Vt),o(v,We),f(he,We,null),m(e,_t,n),f(ue,e,n),m(e,wt,n),m(e,Q,n),f(fe,Q,null),o(Q,Jt),o(Q,Ze),o(Q,Ht),o(Q,Le),o(Q,Nt),f(A,Q,null),o(Q,St),o(Q,Be),m(e,bt,n),f(ge,e,n),m(e,kt,n),m(e,C,n),f(_e,C,null),o(C,Rt),o(C,Ve),o(C,Xt),o(C,Je),o(C,Gt),o(C,He),o(C,Et),o(C,J),f(we,J,null),o(J,At),o(J,Ne),o(J,Ot),f(O,J,null),m(e,yt,n),f(be,e,n),m(e,Tt,n),m(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),m(e,vt,n),f(Te,e,n),m(e,Mt,n),m(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,Ae),o(M,rn),o(M,H),f(Me,H,null),o(H,ln),o(H,Oe),o(H,dn),f(K,H,null),m(e,$t,n),f($e,e,n),m(e,zt,n),m(e,x,n),f(ze,x,null),o(x,cn),o(x,De),o(x,mn),o(x,Ye),o(x,pn),o(x,Ke),o(x,hn),o(x,N),f(Qe,N,null),o(N,un),o(N,et),o(N,fn),f(ee,N,null),m(e,Qt,n),f(Ce,e,n),m(e,Ct,n),m(e,ot,n),xt=!0},p(e,[n]){const L={};n&2&&(L.$$scope={dirty:n,ctx:e}),G.$set(L);const z={};n&2&&(z.$$scope={dirty:n,ctx:e}),E.$set(z);const st={};n&2&&(st.$$scope={dirty:n,ctx:e}),A.$set(st);const I={};n&2&&(I.$$scope={dirty:n,ctx:e}),O.$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(me.$$.fragment,e),g(pe.$$.fragment,e),g(E.$$.fragment,e),g(he.$$.fragment,e),g(ue.$$.fragment,e),g(fe.$$.fragment,e),g(A.$$.fragment,e),g(ge.$$.fragment,e),g(_e.$$.fragment,e),g(we.$$.fragment,e),g(O.$$.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),_(me.$$.fragment,e),_(pe.$$.fragment,e),_(E.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(fe.$$.fragment,e),_(A.$$.fragment,e),_(ge.$$.fragment,e),_(_e.$$.fragment,e),_(we.$$.fragment,e),_(O.$$.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(p),s(c),s(rt),s(ne),s(it),s(lt),s(se),s(dt),s(ct),s(re),s(mt),s(ie),s(pt),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(me,e),w(pe),w(E),w(he),w(ue,e),w(fe),w(A),w(ge,e),w(_e),w(we),w(O),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(),An(this,t,lo,ro,Xn,{})}}export{_o as component};
