Buckets:

rtrm's picture
download
raw
91.3 kB
import{s as Co,o as Do,n as oe}from"../chunks/scheduler.01eeda35.js";import{S as zo,i as Fo,g as l,s,r as h,A as Io,h as d,f as a,c as r,j as q,u,x as m,k as D,y as n,a as c,v as g,d as _,t as b,w as y}from"../chunks/index.6dd51b66.js";import{T as Ye}from"../chunks/Tip.de9bae2b.js";import{D as Z}from"../chunks/Docstring.cb556860.js";import{C as eo}from"../chunks/CodeBlock.19ec9b8c.js";import{E as Kt}from"../chunks/ExampleCodeBlock.69db56ad.js";import{H as A,E as qo}from"../chunks/index.58fe8f9d.js";function Po(v){let t,T;return t=new eo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERpZmZMbGFtYU1vZGVsJTJDJTIwRGlmZkxsYW1hQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMERpZmZMbGFtYSUyMGRpZmZsbGFtYS03YiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBEaWZmTGxhbWFDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBkaWZmbGxhbWEtN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMERpZmZMbGFtYU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DiffLlamaModel, DiffLlamaConfig
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a DiffLlama diffllama-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = DiffLlamaConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the diffllama-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DiffLlamaModel(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){g(t,i,p),T=!0},p:oe,i(i){T||(_(t.$$.fragment,i),T=!0)},o(i){b(t.$$.fragment,i),T=!1},d(i){y(t,i)}}}function Wo(v){let t,T=`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=T},l(i){t=d(i,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=T)},m(i,p){c(i,t,p)},p:oe,d(i){i&&a(t)}}}function jo(v){let t,T=`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=T},l(i){t=d(i,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=T)},m(i,p){c(i,t,p)},p:oe,d(i){i&&a(t)}}}function Jo(v){let t,T="Example:",i,p,w;return p=new eo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBEaWZmTGxhbWFGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwRGlmZkxsYW1hRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmRpZmZsbGFtYS03YiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkaWZmbGxhbWEtN2IlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyV2hhdCUyMGlzJTIweW91ciUyMGZhdm9yaXRlJTIwY29uZGltZW50JTNGJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMEFnZW5lcmF0ZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMuaW5wdXRfaWRzJTJDJTIwbWF4X2xlbmd0aCUzRDMwKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNERmFsc2UpJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, DiffLlamaForCausalLM
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DiffLlamaForCausalLM.from_pretrained(<span class="hljs-string">&quot;google/diffllama-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;google/diffllama-7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;What is your favorite condiment?&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;What is your favorite condiment?&quot;</span>`,wrap:!1}}),{c(){t=l("p"),t.textContent=T,i=s(),h(p.$$.fragment)},l(f){t=d(f,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=T),i=r(f),u(p.$$.fragment,f)},m(f,M){c(f,t,M),c(f,i,M),g(p,f,M),w=!0},p:oe,i(f){w||(_(p.$$.fragment,f),w=!0)},o(f){b(p.$$.fragment,f),w=!1},d(f){f&&(a(t),a(i)),y(p,f)}}}function Zo(v){let t,T=`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=T},l(i){t=d(i,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=T)},m(i,p){c(i,t,p)},p:oe,d(i){i&&a(t)}}}function Uo(v){let t,T=`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=T},l(i){t=d(i,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=T)},m(i,p){c(i,t,p)},p:oe,d(i){i&&a(t)}}}function Bo(v){let t,T=`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=T},l(i){t=d(i,"P",{"data-svelte-h":!0}),m(t)!=="svelte-fincs2"&&(t.innerHTML=T)},m(i,p){c(i,t,p)},p:oe,d(i){i&&a(t)}}}function Go(v){let t,T="Example:",i,p,w;return p=new eo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBEaWZmTGxhbWFGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJrYWp1bWElMkZEaWZmTGxhbWEtMC4zQi1oYW5kY3V0JTIyKSUwQW1vZGVsJTIwJTNEJTIwRGlmZkxsYW1hRm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIya2FqdW1hJTJGRGlmZkxsYW1hLTAuM0ItaGFuZGN1dCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTBBJTIwJTIwJTIwJTIwJTIySHVnZ2luZ0ZhY2UlMjBpcyUyMGElMjBjb21wYW55JTIwYmFzZWQlMjBpbiUyMFBhcmlzJTIwYW5kJTIwTmV3JTIwWW9yayUyMiUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUwQSklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQXByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwdG9rZW5zJTIwYXJlJTIwY2xhc3NpZmllZCUyMHJhdGhlciUyMHRoZW4lMjBpbnB1dCUyMHdvcmRzJTIwd2hpY2glMjBtZWFucyUyMHRoYXQlMEElMjMlMjB0aGVyZSUyMG1pZ2h0JTIwYmUlMjBtb3JlJTIwcHJlZGljdGVkJTIwdG9rZW4lMjBjbGFzc2VzJTIwdGhhbiUyMHdvcmRzLiUwQSUyMyUyME11bHRpcGxlJTIwdG9rZW4lMjBjbGFzc2VzJTIwbWlnaHQlMjBhY2NvdW50JTIwZm9yJTIwdGhlJTIwc2FtZSUyMHdvcmQlMEFwcmVkaWN0ZWRfdG9rZW5zX2NsYXNzZXMlMjAlM0QlMjAlNUJtb2RlbC5jb25maWcuaWQybGFiZWwlNUJ0Lml0ZW0oKSU1RCUyMGZvciUyMHQlMjBpbiUyMHByZWRpY3RlZF90b2tlbl9jbGFzc19pZHMlNUIwJTVEJTVEJTBBJTBBbGFiZWxzJTIwJTNEJTIwcHJlZGljdGVkX3Rva2VuX2NsYXNzX2lkcyUwQWxvc3MlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyUyQyUyMGxhYmVscyUzRGxhYmVscykubG9zcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, DiffLlamaForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;kajuma/DiffLlama-0.3B-handcut&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = DiffLlamaForTokenClassification.from_pretrained(<span class="hljs-string">&quot;kajuma/DiffLlama-0.3B-handcut&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span> <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span> logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`,wrap:!1}}),{c(){t=l("p"),t.textContent=T,i=s(),h(p.$$.fragment)},l(f){t=d(f,"P",{"data-svelte-h":!0}),m(t)!=="svelte-11lpom8"&&(t.textContent=T),i=r(f),u(p.$$.fragment,f)},m(f,M){c(f,t,M),c(f,i,M),g(p,f,M),w=!0},p:oe,i(f){w||(_(p.$$.fragment,f),w=!0)},o(f){b(p.$$.fragment,f),w=!1},d(f){f&&(a(t),a(i)),y(p,f)}}}function Ho(v){let t,T,i,p,w,f,M,to='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="FlashAttention" src="https://img.shields.io/badge/%E2%9A%A1%EF%B8%8E%20FlashAttention-eae0c8?style=flat"/> <img alt="SDPA" src="https://img.shields.io/badge/SDPA-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',Xe,ne,Ke,ae,oo=`The DiffLlama model was proposed in <a href="https://arxiv.org/abs/2410.05258" rel="nofollow">Differential Transformer</a> by Kazuma Matsumoto and .
This model is combine Llama model and Differential Transformer’s Attention.`,et,se,no="The abstract from the paper is the following:",tt,re,ao="<em>Transformer tends to overallocate attention to irrelevant context. In this work, we introduce Diff Transformer, which amplifies attention to the relevant context while canceling noise. Specifically, the differential attention mechanism calculates attention scores as the difference between two separate softmax attention maps. The subtraction cancels noise, promoting the emergence of sparse attention patterns. Experimental results on language modeling show that Diff Transformer outperforms Transformer in various settings of scaling up model size and training tokens. More intriguingly, it offers notable advantages in practical applications, such as long-context modeling, key information retrieval, hallucination mitigation, in-context learning, and reduction of activation outliers. By being less distracted by irrelevant context, Diff Transformer can mitigate hallucination in question answering and text summarization. For in-context learning, Diff Transformer not only enhances accuracy but is also more robust to order permutation, which was considered as a chronic robustness issue. The results position Diff Transformer as a highly effective and promising architecture to advance large language models.</em>",ot,ie,nt,le,so="The hyperparameters of this model is the same as Llama model.",at,de,st,z,ce,yt,Ce,ro=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaModel">DiffLlamaModel</a>. It is used to instantiate an DiffLlama
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults
will yield a similar configuration to that of the <a href="https://huggingface.co/kajuma/DiffLlama-0.3B-handcut" rel="nofollow">kajuma/DiffLlama-0.3B-handcut</a>.`,Tt,De,io=`Configuration objects inherit from <a href="/docs/transformers/pr_37374/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/pr_37374/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,kt,O,rt,fe,it,$,me,vt,ze,lo=`The bare DiffLlama Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/pr_37374/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.)`,wt,Fe,co=`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.`,Lt,Ie,fo="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>DiffLlamaDecoderLayer</code>",Mt,U,pe,$t,qe,mo='The <a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaModel">DiffLlamaModel</a> forward method, overrides the <code>__call__</code> special method.',xt,R,lt,he,dt,S,ue,Ct,P,ge,Dt,Pe,po='The <a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaForCausalLM">DiffLlamaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',zt,Q,Ft,V,ct,_e,ft,k,be,It,We,ho="The DiffLlama Model transformer with a sequence classification head on top (linear layer).",qt,je,uo=`<a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaForSequenceClassification">DiffLlamaForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,Pt,Je,go=`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).`,Wt,Ze,_o=`This model inherits from <a href="/docs/transformers/pr_37374/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.)`,jt,Ue,bo=`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.`,Jt,B,ye,Zt,Be,yo='The <a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaForSequenceClassification">DiffLlamaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',Ut,Y,mt,Te,pt,x,ke,Bt,Ge,To=`The DiffLlama Model transformer with a span classification head on top for extractive question-answering tasks like
SQuAD (a linear layer on top of the hidden-states output to compute <code>span start logits</code> and <code>span end logits</code>).`,Gt,He,ko=`This model inherits from <a href="/docs/transformers/pr_37374/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.)`,Ht,Se,vo=`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.`,St,G,ve,Nt,Ne,wo='The <a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaForQuestionAnswering">DiffLlamaForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',Et,X,ht,we,ut,C,Le,At,Ee,Lo=`The DiffLlama 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.`,Ot,Ae,Mo=`This model inherits from <a href="/docs/transformers/pr_37374/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.)`,Rt,Oe,$o=`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.`,Qt,W,Me,Vt,Re,xo='The <a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaForTokenClassification">DiffLlamaForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',Yt,K,Xt,ee,gt,$e,_t,Ve,bt;return w=new A({props:{title:"DiffLlama",local:"diffllama",headingTag:"h1"}}),ne=new A({props:{title:"Overview",local:"overview",headingTag:"h2"}}),ie=new A({props:{title:"Usage tips",local:"usage-tips",headingTag:"h3"}}),de=new A({props:{title:"DiffLlamaConfig",local:"transformers.DiffLlamaConfig",headingTag:"h2"}}),ce=new Z({props:{name:"class transformers.DiffLlamaConfig",anchor:"transformers.DiffLlamaConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 2048"},{name:"intermediate_size",val:" = 8192"},{name:"num_hidden_layers",val:" = 16"},{name:"num_attention_heads",val:" = 32"},{name:"num_key_value_heads",val:" = None"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 2048"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-05"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = None"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 10000.0"},{name:"rope_scaling",val:" = None"},{name:"attention_bias",val:" = False"},{name:"attention_dropout",val:" = 0.0"},{name:"lambda_std_dev",val:" = 0.1"},{name:"head_dim",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DiffLlamaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the DiffLlama model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaModel">DiffLlamaModel</a>`,name:"vocab_size"},{anchor:"transformers.DiffLlamaConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.DiffLlamaConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8192) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.DiffLlamaConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.DiffLlamaConfig.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 decoder.`,name:"num_attention_heads"},{anchor:"transformers.DiffLlamaConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1</code> the model will use Multi Query Attention (MQA) otherwise GQA is used. When
converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
by meanpooling all the original heads within that group. For more details checkout <a href="https://arxiv.org/pdf/2305.13245.pdf" rel="nofollow">this
paper</a>. If it is not specified, will default to
<code>num_attention_heads</code>.`,name:"num_key_value_heads"},{anchor:"transformers.DiffLlamaConfig.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.DiffLlamaConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.DiffLlamaConfig.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.DiffLlamaConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.DiffLlamaConfig.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.DiffLlamaConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.DiffLlamaConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.DiffLlamaConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.DiffLlamaConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.DiffLlamaConfig.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.DiffLlamaConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Dictionary containing the scaling configuration for the RoPE embeddings. NOTE: if you apply new rope type
and you expect the model to work on longer <code>max_position_embeddings</code>, we recommend you to update this value
accordingly.
Expected contents:
<code>rope_type</code> (<code>str</code>):
The sub-variant of RoPE to use. Can be one of [&#x2018;default&#x2019;, &#x2018;linear&#x2019;, &#x2018;dynamic&#x2019;, &#x2018;yarn&#x2019;, &#x2018;longrope&#x2019;,
&#x2018;diffllama3&#x2019;], with &#x2018;default&#x2019; being the original RoPE implementation.
<code>factor</code> (<code>float</code>, <em>optional</em>):
Used with all rope types except &#x2018;default&#x2019;. The scaling factor to apply to the RoPE embeddings. In
most scaling types, a <code>factor</code> of x will enable the model to handle sequences of length x <em>
original maximum pre-trained length.
<code>original_max_position_embeddings</code> (<code>int</code>, </em>optional<em>):
Used with &#x2018;dynamic&#x2019;, &#x2018;longrope&#x2019; and &#x2018;diffllama3&#x2019;. The original max position embeddings used during
pretraining.
<code>attention_factor</code> (<code>float</code>, </em>optional<em>):
Used with &#x2018;yarn&#x2019; and &#x2018;longrope&#x2019;. The scaling factor to be applied on the attention
computation. If unspecified, it defaults to value recommended by the implementation, using the
<code>factor</code> field to infer the suggested value.
<code>beta_fast</code> (<code>float</code>, </em>optional<em>):
Only used with &#x2018;yarn&#x2019;. Parameter to set the boundary for extrapolation (only) in the linear
ramp function. If unspecified, it defaults to 32.
<code>beta_slow</code> (<code>float</code>, </em>optional<em>):
Only used with &#x2018;yarn&#x2019;. Parameter to set the boundary for interpolation (only) in the linear
ramp function. If unspecified, it defaults to 1.
<code>short_factor</code> (<code>List[float]</code>, </em>optional<em>):
Only used with &#x2018;longrope&#x2019;. The scaling factor to be applied to short contexts (&lt;
<code>original_max_position_embeddings</code>). Must be a list of numbers with the same length as the hidden
size divided by the number of attention heads divided by 2
<code>long_factor</code> (<code>List[float]</code>, </em>optional<em>):
Only used with &#x2018;longrope&#x2019;. The scaling factor to be applied to long contexts (&lt;
<code>original_max_position_embeddings</code>). Must be a list of numbers with the same length as the hidden
size divided by the number of attention heads divided by 2
<code>low_freq_factor</code> (<code>float</code>, </em>optional<em>):
Only used with &#x2018;diffllama3&#x2019;. Scaling factor applied to low frequency components of the RoPE
<code>high_freq_factor</code> (<code>float</code>, </em>optional*):
Only used with &#x2018;diffllama3&#x2019;. Scaling factor applied to high frequency components of the RoPE`,name:"rope_scaling"},{anchor:"transformers.DiffLlamaConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in the query, key, value and output projection layers during self-attention.`,name:"attention_bias"},{anchor:"transformers.DiffLlamaConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.DiffLlamaConfig.lambda_std_dev",description:`<strong>lambda_std_dev</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The standard deviation for initialization of parameter lambda in attention layer.`,name:"lambda_std_dev"},{anchor:"transformers.DiffLlamaConfig.head_dim",description:`<strong>head_dim</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The attention head dimension. If None, it will default to hidden_size // num_heads`,name:"head_dim"}],source:"https://github.com/huggingface/transformers/blob/vr_37374/src/transformers/models/diffllama/configuration_diffllama.py#L24"}}),O=new Kt({props:{anchor:"transformers.DiffLlamaConfig.example",$$slots:{default:[Po]},$$scope:{ctx:v}}}),fe=new A({props:{title:"DiffLlamaModel",local:"transformers.DiffLlamaModel",headingTag:"h2"}}),me=new Z({props:{name:"class transformers.DiffLlamaModel",anchor:"transformers.DiffLlamaModel",parameters:[{name:"config",val:": DiffLlamaConfig"}],parametersDescription:[{anchor:"transformers.DiffLlamaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaConfig">DiffLlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_37374/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.DiffLlamaModel.config",description:"<strong>config</strong> &#x2014; DiffLlamaConfig",name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L730"}}),pe=new Z({props:{name:"forward",anchor:"transformers.DiffLlamaModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"**flash_attn_kwargs",val:": typing_extensions.Unpack[transformers.modeling_flash_attention_utils.FlashAttentionKwargs]"}],parametersDescription:[{anchor:"transformers.DiffLlamaModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/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.DiffLlamaModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.DiffLlamaModel.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.DiffLlamaModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</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>It is a <a href="/docs/transformers/pr_37374/en/internal/generation_utils#transformers.Cache">Cache</a> instance. For more details, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>.</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.DiffLlamaModel.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.DiffLlamaModel.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.DiffLlamaModel.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.DiffLlamaModel.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.DiffLlamaModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_37374/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DiffLlamaModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L764"}}),R=new Ye({props:{$$slots:{default:[Wo]},$$scope:{ctx:v}}}),he=new A({props:{title:"DiffLlamaForCausalLM",local:"transformers.DiffLlamaForCausalLM",headingTag:"h2"}}),ue=new Z({props:{name:"class transformers.DiffLlamaForCausalLM",anchor:"transformers.DiffLlamaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L1005"}}),ge=new Z({props:{name:"forward",anchor:"transformers.DiffLlamaForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"logits_to_keep",val:": typing.Union[int, torch.Tensor] = 0"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.diffllama.modeling_diffllama.KwargsForCausalLM]"}],parametersDescription:[{anchor:"transformers.DiffLlamaForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/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.DiffLlamaForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.DiffLlamaForCausalLM.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.DiffLlamaForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</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>It is a <a href="/docs/transformers/pr_37374/en/internal/generation_utils#transformers.Cache">Cache</a> instance. For more details, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>.</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.DiffLlamaForCausalLM.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.DiffLlamaForCausalLM.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.DiffLlamaForCausalLM.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.DiffLlamaForCausalLM.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.DiffLlamaForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_37374/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DiffLlamaForCausalLM.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.DiffLlamaForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
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:"labels"},{anchor:"transformers.DiffLlamaForCausalLM.forward.logits_to_keep",description:`<strong>logits_to_keep</strong> (<code>int</code> or <code>torch.Tensor</code>, <em>optional</em>) &#x2014;
If an <code>int</code>, compute logits for the last <code>logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all
<code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that
token can save memory, which becomes pretty significant for long sequences or large vocabulary size.
If a <code>torch.Tensor</code>, must be 1D corresponding to the indices to keep in the sequence length dimension.
This is useful when using packed tensor format (single dimension for batch and sequence length).`,name:"logits_to_keep"}],source:"https://github.com/huggingface/transformers/blob/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L1037",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <a
href="/docs/transformers/pr_37374/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/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaConfig"
>DiffLlamaConfig</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/pr_37374/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Q=new Ye({props:{$$slots:{default:[jo]},$$scope:{ctx:v}}}),V=new Kt({props:{anchor:"transformers.DiffLlamaForCausalLM.forward.example",$$slots:{default:[Jo]},$$scope:{ctx:v}}}),_e=new A({props:{title:"DiffLlamaForSequenceClassification",local:"transformers.DiffLlamaForSequenceClassification",headingTag:"h2"}}),be=new Z({props:{name:"class transformers.DiffLlamaForSequenceClassification",anchor:"transformers.DiffLlamaForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.DiffLlamaForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaConfig">DiffLlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_37374/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/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L1124"}}),ye=new Z({props:{name:"forward",anchor:"transformers.DiffLlamaForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DiffLlamaForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/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.DiffLlamaForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.DiffLlamaForSequenceClassification.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.DiffLlamaForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</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>It is a <a href="/docs/transformers/pr_37374/en/internal/generation_utils#transformers.Cache">Cache</a> instance. For more details, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>.</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.DiffLlamaForSequenceClassification.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.DiffLlamaForSequenceClassification.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.DiffLlamaForSequenceClassification.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.DiffLlamaForSequenceClassification.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.DiffLlamaForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_37374/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DiffLlamaForSequenceClassification.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.DiffLlamaForSequenceClassification.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/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L1155"}}),Y=new Ye({props:{$$slots:{default:[Zo]},$$scope:{ctx:v}}}),Te=new A({props:{title:"DiffLlamaForQuestionAnswering",local:"transformers.DiffLlamaForQuestionAnswering",headingTag:"h2"}}),ke=new Z({props:{name:"class transformers.DiffLlamaForQuestionAnswering",anchor:"transformers.DiffLlamaForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.DiffLlamaForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaConfig">DiffLlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_37374/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/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L1225"}}),ve=new Z({props:{name:"forward",anchor:"transformers.DiffLlamaForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.DiffLlamaForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/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.DiffLlamaForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.DiffLlamaForQuestionAnswering.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.DiffLlamaForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</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>It is a <a href="/docs/transformers/pr_37374/en/internal/generation_utils#transformers.Cache">Cache</a> instance. For more details, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>.</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.DiffLlamaForQuestionAnswering.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.DiffLlamaForQuestionAnswering.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.DiffLlamaForQuestionAnswering.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.DiffLlamaForQuestionAnswering.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.DiffLlamaForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_37374/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DiffLlamaForQuestionAnswering.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.DiffLlamaForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.DiffLlamaForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L1249"}}),X=new Ye({props:{$$slots:{default:[Uo]},$$scope:{ctx:v}}}),we=new A({props:{title:"DiffLlamaForTokenClassification",local:"transformers.DiffLlamaForTokenClassification",headingTag:"h2"}}),Le=new Z({props:{name:"class transformers.DiffLlamaForTokenClassification",anchor:"transformers.DiffLlamaForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.DiffLlamaForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaConfig">DiffLlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/pr_37374/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/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L1305"}}),Me=new Z({props:{name:"forward",anchor:"transformers.DiffLlamaForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.DiffLlamaForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/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.DiffLlamaForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/pr_37374/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/pr_37374/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.DiffLlamaForTokenClassification.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.DiffLlamaForTokenClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</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>It is a <a href="/docs/transformers/pr_37374/en/internal/generation_utils#transformers.Cache">Cache</a> instance. For more details, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>.</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.DiffLlamaForTokenClassification.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.DiffLlamaForTokenClassification.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.DiffLlamaForTokenClassification.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.DiffLlamaForTokenClassification.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.DiffLlamaForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/pr_37374/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.DiffLlamaForTokenClassification.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.DiffLlamaForTokenClassification.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/vr_37374/src/transformers/models/diffllama/modeling_diffllama.py#L1335",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A <a
href="/docs/transformers/pr_37374/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</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/pr_37374/en/model_doc/diffllama#transformers.DiffLlamaConfig"
>DiffLlamaConfig</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) — Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) — Classification scores (before SoftMax).</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/pr_37374/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),K=new Ye({props:{$$slots:{default:[Bo]},$$scope:{ctx:v}}}),ee=new Kt({props:{anchor:"transformers.DiffLlamaForTokenClassification.forward.example",$$slots:{default:[Go]},$$scope:{ctx:v}}}),$e=new qo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/diffllama.md"}}),{c(){t=l("meta"),T=s(),i=l("p"),p=s(),h(w.$$.fragment),f=s(),M=l("div"),M.innerHTML=to,Xe=s(),h(ne.$$.fragment),Ke=s(),ae=l("p"),ae.innerHTML=oo,et=s(),se=l("p"),se.textContent=no,tt=s(),re=l("p"),re.innerHTML=ao,ot=s(),h(ie.$$.fragment),nt=s(),le=l("p"),le.textContent=so,at=s(),h(de.$$.fragment),st=s(),z=l("div"),h(ce.$$.fragment),yt=s(),Ce=l("p"),Ce.innerHTML=ro,Tt=s(),De=l("p"),De.innerHTML=io,kt=s(),h(O.$$.fragment),rt=s(),h(fe.$$.fragment),it=s(),$=l("div"),h(me.$$.fragment),vt=s(),ze=l("p"),ze.innerHTML=lo,wt=s(),Fe=l("p"),Fe.innerHTML=co,Lt=s(),Ie=l("p"),Ie.innerHTML=fo,Mt=s(),U=l("div"),h(pe.$$.fragment),$t=s(),qe=l("p"),qe.innerHTML=mo,xt=s(),h(R.$$.fragment),lt=s(),h(he.$$.fragment),dt=s(),S=l("div"),h(ue.$$.fragment),Ct=s(),P=l("div"),h(ge.$$.fragment),Dt=s(),Pe=l("p"),Pe.innerHTML=po,zt=s(),h(Q.$$.fragment),Ft=s(),h(V.$$.fragment),ct=s(),h(_e.$$.fragment),ft=s(),k=l("div"),h(be.$$.fragment),It=s(),We=l("p"),We.textContent=ho,qt=s(),je=l("p"),je.innerHTML=uo,Pt=s(),Je=l("p"),Je.innerHTML=go,Wt=s(),Ze=l("p"),Ze.innerHTML=_o,jt=s(),Ue=l("p"),Ue.innerHTML=bo,Jt=s(),B=l("div"),h(ye.$$.fragment),Zt=s(),Be=l("p"),Be.innerHTML=yo,Ut=s(),h(Y.$$.fragment),mt=s(),h(Te.$$.fragment),pt=s(),x=l("div"),h(ke.$$.fragment),Bt=s(),Ge=l("p"),Ge.innerHTML=To,Gt=s(),He=l("p"),He.innerHTML=ko,Ht=s(),Se=l("p"),Se.innerHTML=vo,St=s(),G=l("div"),h(ve.$$.fragment),Nt=s(),Ne=l("p"),Ne.innerHTML=wo,Et=s(),h(X.$$.fragment),ht=s(),h(we.$$.fragment),ut=s(),C=l("div"),h(Le.$$.fragment),At=s(),Ee=l("p"),Ee.textContent=Lo,Ot=s(),Ae=l("p"),Ae.innerHTML=Mo,Rt=s(),Oe=l("p"),Oe.innerHTML=$o,Qt=s(),W=l("div"),h(Me.$$.fragment),Vt=s(),Re=l("p"),Re.innerHTML=xo,Yt=s(),h(K.$$.fragment),Xt=s(),h(ee.$$.fragment),gt=s(),h($e.$$.fragment),_t=s(),Ve=l("p"),this.h()},l(e){const o=Io("svelte-u9bgzb",document.head);t=d(o,"META",{name:!0,content:!0}),o.forEach(a),T=r(e),i=d(e,"P",{}),q(i).forEach(a),p=r(e),u(w.$$.fragment,e),f=r(e),M=d(e,"DIV",{class:!0,"data-svelte-h":!0}),m(M)!=="svelte-b95w5j"&&(M.innerHTML=to),Xe=r(e),u(ne.$$.fragment,e),Ke=r(e),ae=d(e,"P",{"data-svelte-h":!0}),m(ae)!=="svelte-1wpzflm"&&(ae.innerHTML=oo),et=r(e),se=d(e,"P",{"data-svelte-h":!0}),m(se)!=="svelte-vfdo9a"&&(se.textContent=no),tt=r(e),re=d(e,"P",{"data-svelte-h":!0}),m(re)!=="svelte-1ncjn49"&&(re.innerHTML=ao),ot=r(e),u(ie.$$.fragment,e),nt=r(e),le=d(e,"P",{"data-svelte-h":!0}),m(le)!=="svelte-1vygrzq"&&(le.textContent=so),at=r(e),u(de.$$.fragment,e),st=r(e),z=d(e,"DIV",{class:!0});var j=q(z);u(ce.$$.fragment,j),yt=r(j),Ce=d(j,"P",{"data-svelte-h":!0}),m(Ce)!=="svelte-cbpoke"&&(Ce.innerHTML=ro),Tt=r(j),De=d(j,"P",{"data-svelte-h":!0}),m(De)!=="svelte-s9hsnr"&&(De.innerHTML=io),kt=r(j),u(O.$$.fragment,j),j.forEach(a),rt=r(e),u(fe.$$.fragment,e),it=r(e),$=d(e,"DIV",{class:!0});var F=q($);u(me.$$.fragment,F),vt=r(F),ze=d(F,"P",{"data-svelte-h":!0}),m(ze)!=="svelte-zov9nw"&&(ze.innerHTML=lo),wt=r(F),Fe=d(F,"P",{"data-svelte-h":!0}),m(Fe)!=="svelte-hswkmf"&&(Fe.innerHTML=co),Lt=r(F),Ie=d(F,"P",{"data-svelte-h":!0}),m(Ie)!=="svelte-yq79wh"&&(Ie.innerHTML=fo),Mt=r(F),U=d(F,"DIV",{class:!0});var N=q(U);u(pe.$$.fragment,N),$t=r(N),qe=d(N,"P",{"data-svelte-h":!0}),m(qe)!=="svelte-b4kmuh"&&(qe.innerHTML=mo),xt=r(N),u(R.$$.fragment,N),N.forEach(a),F.forEach(a),lt=r(e),u(he.$$.fragment,e),dt=r(e),S=d(e,"DIV",{class:!0});var xe=q(S);u(ue.$$.fragment,xe),Ct=r(xe),P=d(xe,"DIV",{class:!0});var J=q(P);u(ge.$$.fragment,J),Dt=r(J),Pe=d(J,"P",{"data-svelte-h":!0}),m(Pe)!=="svelte-9krpql"&&(Pe.innerHTML=po),zt=r(J),u(Q.$$.fragment,J),Ft=r(J),u(V.$$.fragment,J),J.forEach(a),xe.forEach(a),ct=r(e),u(_e.$$.fragment,e),ft=r(e),k=d(e,"DIV",{class:!0});var L=q(k);u(be.$$.fragment,L),It=r(L),We=d(L,"P",{"data-svelte-h":!0}),m(We)!=="svelte-mcwsnc"&&(We.textContent=ho),qt=r(L),je=d(L,"P",{"data-svelte-h":!0}),m(je)!=="svelte-7z5ck2"&&(je.innerHTML=uo),Pt=r(L),Je=d(L,"P",{"data-svelte-h":!0}),m(Je)!=="svelte-10ugs3m"&&(Je.innerHTML=go),Wt=r(L),Ze=d(L,"P",{"data-svelte-h":!0}),m(Ze)!=="svelte-1ke0co"&&(Ze.innerHTML=_o),jt=r(L),Ue=d(L,"P",{"data-svelte-h":!0}),m(Ue)!=="svelte-hswkmf"&&(Ue.innerHTML=bo),Jt=r(L),B=d(L,"DIV",{class:!0});var E=q(B);u(ye.$$.fragment,E),Zt=r(E),Be=d(E,"P",{"data-svelte-h":!0}),m(Be)!=="svelte-m12l5j"&&(Be.innerHTML=yo),Ut=r(E),u(Y.$$.fragment,E),E.forEach(a),L.forEach(a),mt=r(e),u(Te.$$.fragment,e),pt=r(e),x=d(e,"DIV",{class:!0});var I=q(x);u(ke.$$.fragment,I),Bt=r(I),Ge=d(I,"P",{"data-svelte-h":!0}),m(Ge)!=="svelte-6ebg1o"&&(Ge.innerHTML=To),Gt=r(I),He=d(I,"P",{"data-svelte-h":!0}),m(He)!=="svelte-1ke0co"&&(He.innerHTML=ko),Ht=r(I),Se=d(I,"P",{"data-svelte-h":!0}),m(Se)!=="svelte-hswkmf"&&(Se.innerHTML=vo),St=r(I),G=d(I,"DIV",{class:!0});var Qe=q(G);u(ve.$$.fragment,Qe),Nt=r(Qe),Ne=d(Qe,"P",{"data-svelte-h":!0}),m(Ne)!=="svelte-1jqr34b"&&(Ne.innerHTML=wo),Et=r(Qe),u(X.$$.fragment,Qe),Qe.forEach(a),I.forEach(a),ht=r(e),u(we.$$.fragment,e),ut=r(e),C=d(e,"DIV",{class:!0});var H=q(C);u(Le.$$.fragment,H),At=r(H),Ee=d(H,"P",{"data-svelte-h":!0}),m(Ee)!=="svelte-1bz69gn"&&(Ee.textContent=Lo),Ot=r(H),Ae=d(H,"P",{"data-svelte-h":!0}),m(Ae)!=="svelte-1ke0co"&&(Ae.innerHTML=Mo),Rt=r(H),Oe=d(H,"P",{"data-svelte-h":!0}),m(Oe)!=="svelte-hswkmf"&&(Oe.innerHTML=$o),Qt=r(H),W=d(H,"DIV",{class:!0});var te=q(W);u(Me.$$.fragment,te),Vt=r(te),Re=d(te,"P",{"data-svelte-h":!0}),m(Re)!=="svelte-1k1eayz"&&(Re.innerHTML=xo),Yt=r(te),u(K.$$.fragment,te),Xt=r(te),u(ee.$$.fragment,te),te.forEach(a),H.forEach(a),gt=r(e),u($e.$$.fragment,e),_t=r(e),Ve=d(e,"P",{}),q(Ve).forEach(a),this.h()},h(){D(t,"name","hf:doc:metadata"),D(t,"content",So),D(M,"class","flex flex-wrap space-x-1"),D(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),D(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){n(document.head,t),c(e,T,o),c(e,i,o),c(e,p,o),g(w,e,o),c(e,f,o),c(e,M,o),c(e,Xe,o),g(ne,e,o),c(e,Ke,o),c(e,ae,o),c(e,et,o),c(e,se,o),c(e,tt,o),c(e,re,o),c(e,ot,o),g(ie,e,o),c(e,nt,o),c(e,le,o),c(e,at,o),g(de,e,o),c(e,st,o),c(e,z,o),g(ce,z,null),n(z,yt),n(z,Ce),n(z,Tt),n(z,De),n(z,kt),g(O,z,null),c(e,rt,o),g(fe,e,o),c(e,it,o),c(e,$,o),g(me,$,null),n($,vt),n($,ze),n($,wt),n($,Fe),n($,Lt),n($,Ie),n($,Mt),n($,U),g(pe,U,null),n(U,$t),n(U,qe),n(U,xt),g(R,U,null),c(e,lt,o),g(he,e,o),c(e,dt,o),c(e,S,o),g(ue,S,null),n(S,Ct),n(S,P),g(ge,P,null),n(P,Dt),n(P,Pe),n(P,zt),g(Q,P,null),n(P,Ft),g(V,P,null),c(e,ct,o),g(_e,e,o),c(e,ft,o),c(e,k,o),g(be,k,null),n(k,It),n(k,We),n(k,qt),n(k,je),n(k,Pt),n(k,Je),n(k,Wt),n(k,Ze),n(k,jt),n(k,Ue),n(k,Jt),n(k,B),g(ye,B,null),n(B,Zt),n(B,Be),n(B,Ut),g(Y,B,null),c(e,mt,o),g(Te,e,o),c(e,pt,o),c(e,x,o),g(ke,x,null),n(x,Bt),n(x,Ge),n(x,Gt),n(x,He),n(x,Ht),n(x,Se),n(x,St),n(x,G),g(ve,G,null),n(G,Nt),n(G,Ne),n(G,Et),g(X,G,null),c(e,ht,o),g(we,e,o),c(e,ut,o),c(e,C,o),g(Le,C,null),n(C,At),n(C,Ee),n(C,Ot),n(C,Ae),n(C,Rt),n(C,Oe),n(C,Qt),n(C,W),g(Me,W,null),n(W,Vt),n(W,Re),n(W,Yt),g(K,W,null),n(W,Xt),g(ee,W,null),c(e,gt,o),g($e,e,o),c(e,_t,o),c(e,Ve,o),bt=!0},p(e,[o]){const j={};o&2&&(j.$$scope={dirty:o,ctx:e}),O.$set(j);const F={};o&2&&(F.$$scope={dirty:o,ctx:e}),R.$set(F);const N={};o&2&&(N.$$scope={dirty:o,ctx:e}),Q.$set(N);const xe={};o&2&&(xe.$$scope={dirty:o,ctx:e}),V.$set(xe);const J={};o&2&&(J.$$scope={dirty:o,ctx:e}),Y.$set(J);const L={};o&2&&(L.$$scope={dirty:o,ctx:e}),X.$set(L);const E={};o&2&&(E.$$scope={dirty:o,ctx:e}),K.$set(E);const I={};o&2&&(I.$$scope={dirty:o,ctx:e}),ee.$set(I)},i(e){bt||(_(w.$$.fragment,e),_(ne.$$.fragment,e),_(ie.$$.fragment,e),_(de.$$.fragment,e),_(ce.$$.fragment,e),_(O.$$.fragment,e),_(fe.$$.fragment,e),_(me.$$.fragment,e),_(pe.$$.fragment,e),_(R.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(ge.$$.fragment,e),_(Q.$$.fragment,e),_(V.$$.fragment,e),_(_e.$$.fragment,e),_(be.$$.fragment,e),_(ye.$$.fragment,e),_(Y.$$.fragment,e),_(Te.$$.fragment,e),_(ke.$$.fragment,e),_(ve.$$.fragment,e),_(X.$$.fragment,e),_(we.$$.fragment,e),_(Le.$$.fragment,e),_(Me.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_($e.$$.fragment,e),bt=!0)},o(e){b(w.$$.fragment,e),b(ne.$$.fragment,e),b(ie.$$.fragment,e),b(de.$$.fragment,e),b(ce.$$.fragment,e),b(O.$$.fragment,e),b(fe.$$.fragment,e),b(me.$$.fragment,e),b(pe.$$.fragment,e),b(R.$$.fragment,e),b(he.$$.fragment,e),b(ue.$$.fragment,e),b(ge.$$.fragment,e),b(Q.$$.fragment,e),b(V.$$.fragment,e),b(_e.$$.fragment,e),b(be.$$.fragment,e),b(ye.$$.fragment,e),b(Y.$$.fragment,e),b(Te.$$.fragment,e),b(ke.$$.fragment,e),b(ve.$$.fragment,e),b(X.$$.fragment,e),b(we.$$.fragment,e),b(Le.$$.fragment,e),b(Me.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b($e.$$.fragment,e),bt=!1},d(e){e&&(a(T),a(i),a(p),a(f),a(M),a(Xe),a(Ke),a(ae),a(et),a(se),a(tt),a(re),a(ot),a(nt),a(le),a(at),a(st),a(z),a(rt),a(it),a($),a(lt),a(dt),a(S),a(ct),a(ft),a(k),a(mt),a(pt),a(x),a(ht),a(ut),a(C),a(gt),a(_t),a(Ve)),a(t),y(w,e),y(ne,e),y(ie,e),y(de,e),y(ce),y(O),y(fe,e),y(me),y(pe),y(R),y(he,e),y(ue),y(ge),y(Q),y(V),y(_e,e),y(be),y(ye),y(Y),y(Te,e),y(ke),y(ve),y(X),y(we,e),y(Le),y(Me),y(K),y(ee),y($e,e)}}}const So='{"title":"DiffLlama","local":"diffllama","sections":[{"title":"Overview","local":"overview","sections":[{"title":"Usage tips","local":"usage-tips","sections":[],"depth":3}],"depth":2},{"title":"DiffLlamaConfig","local":"transformers.DiffLlamaConfig","sections":[],"depth":2},{"title":"DiffLlamaModel","local":"transformers.DiffLlamaModel","sections":[],"depth":2},{"title":"DiffLlamaForCausalLM","local":"transformers.DiffLlamaForCausalLM","sections":[],"depth":2},{"title":"DiffLlamaForSequenceClassification","local":"transformers.DiffLlamaForSequenceClassification","sections":[],"depth":2},{"title":"DiffLlamaForQuestionAnswering","local":"transformers.DiffLlamaForQuestionAnswering","sections":[],"depth":2},{"title":"DiffLlamaForTokenClassification","local":"transformers.DiffLlamaForTokenClassification","sections":[],"depth":2}],"depth":1}';function No(v){return Do(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Xo extends zo{constructor(t){super(),Fo(this,t,No,Ho,Co,{})}}export{Xo as component};

Xet Storage Details

Size:
91.3 kB
·
Xet hash:
bbfff9b2b30869bc1dd41d6aca7d9d4c80e4faff15988a61e77f6c82487eb6aa

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.