import{S as qd,i as Id,s as Sd,e as n,k as d,w as _,t as r,M as jd,c as a,d as o,m as c,a as s,x as v,h as i,b as l,G as e,g as f,y as k,q as b,o as y,B as w,v as Dd,L as fa}from"../../chunks/vendor-hf-doc-builder.js";import{T as tl}from"../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../chunks/Docstring-hf-doc-builder.js";import{C as _o}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as je}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ua}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Nd(F){let m,L;return m=new _o({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYW1hTW9kZWwlMkMlMjBMbGFtYUNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBMTGFNQSUyMGxsYW1hLTdiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMExsYW1hQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwbGxhbWEtN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMExsYW1hTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaModel, LlamaConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a LLaMA llama-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = LlamaConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the llama-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LlamaModel(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`}}),{c(){_(m.$$.fragment)},l(p){v(m.$$.fragment,p)},m(p,g){k(m,p,g),L=!0},p:fa,i(p){L||(b(m.$$.fragment,p),L=!0)},o(p){y(m.$$.fragment,p),L=!1},d(p){w(m,p)}}}function Bd(F){let m,L,p,g,$;return g=new _o({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){m=n("p"),L=r("sequence pair mask has the following format:"),p=d(),_(g.$$.fragment)},l(u){m=a(u,"P",{});var T=s(m);L=i(T,"sequence pair mask has the following format:"),T.forEach(o),p=c(u),v(g.$$.fragment,u)},m(u,T){f(u,m,T),e(m,L),f(u,p,T),k(g,u,T),$=!0},p:fa,i(u){$||(b(g.$$.fragment,u),$=!0)},o(u){y(g.$$.fragment,u),$=!1},d(u){u&&o(m),u&&o(p),w(g,u)}}}function Ud(F){let m,L;return m=new _o({props:{code:"JTBBJTVCMSUyQyUyMDE1MDQzJTJDJTIwNDQ1JTJDJTIwMzM4JTJDJTIwMjYzJTJDJTIwMTI0MyU1RA==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaTokenizerFast

tokenizer = LlamaTokenizerFast.from_pretrained(&quot;hf-internal-testing/llama-tokenizer&quot;)
tokenizer.encode(&quot;Hello this is a test&quot;)
&gt;&gt;&gt; [<span class="hljs-number">1</span>, <span class="hljs-number">15043</span>, <span class="hljs-number">445</span>, <span class="hljs-number">338</span>, <span class="hljs-number">263</span>, <span class="hljs-number">1243</span>]`}}),{c(){_(m.$$.fragment)},l(p){v(m.$$.fragment,p)},m(p,g){k(m,p,g),L=!0},p:fa,i(p){L||(b(m.$$.fragment,p),L=!0)},o(p){y(m.$$.fragment,p),L=!1},d(p){w(m,p)}}}function Wd(F){let m,L,p,g,$;return{c(){m=n("p"),L=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),p=n("code"),g=r("Module"),$=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(u){m=a(u,"P",{});var T=s(m);L=i(T,"Although the recipe for forward pass needs to be defined within this function, one should call the "),p=a(T,"CODE",{});var q=s(p);g=i(q,"Module"),q.forEach(o),$=i(T,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),T.forEach(o)},m(u,T){f(u,m,T),e(m,L),e(m,p),e(p,g),e(m,$)},d(u){u&&o(m)}}}function Od(F){let m,L,p,g,$;return{c(){m=n("p"),L=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),p=n("code"),g=r("Module"),$=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(u){m=a(u,"P",{});var T=s(m);L=i(T,"Although the recipe for forward pass needs to be defined within this function, one should call the "),p=a(T,"CODE",{});var q=s(p);g=i(q,"Module"),q.forEach(o),$=i(T,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),T.forEach(o)},m(u,T){f(u,m,T),e(m,L),e(m,p),e(p,g),e(m,$)},d(u){u&&o(m)}}}function Jd(F){let m,L,p,g,$;return g=new _o({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMbGFtYUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBMbGFtYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZChQQVRIX1RPX0NPTlZFUlRFRF9XRUlHSFRTKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKFBBVEhfVE9fQ09OVkVSVEVEX1RPS0VOSVpFUiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LlamaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LlamaForCausalLM.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>`}}),{c(){m=n("p"),L=r("Example:"),p=d(),_(g.$$.fragment)},l(u){m=a(u,"P",{});var T=s(m);L=i(T,"Example:"),T.forEach(o),p=c(u),v(g.$$.fragment,u)},m(u,T){f(u,m,T),e(m,L),f(u,p,T),k(g,u,T),$=!0},p:fa,i(u){$||(b(g.$$.fragment,u),$=!0)},o(u){y(g.$$.fragment,u),$=!1},d(u){u&&o(m),u&&o(p),w(g,u)}}}function Rd(F){let m,L,p,g,$;return{c(){m=n("p"),L=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),p=n("code"),g=r("Module"),$=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(u){m=a(u,"P",{});var T=s(m);L=i(T,"Although the recipe for forward pass needs to be defined within this function, one should call the "),p=a(T,"CODE",{});var q=s(p);g=i(q,"Module"),q.forEach(o),$=i(T,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),T.forEach(o)},m(u,T){f(u,m,T),e(m,L),e(m,p),e(p,g),e(m,$)},d(u){u&&o(m)}}}function Gd(F){let m,L,p,g,$,u,T,q,ga,bn,ee,ue,vo,De,_a,ko,va,yn,fe,ka,Ne,ba,ya,wn,jt,wa,Tn,Dt,bo,Ta,Ln,Be,La,Ue,$a,$n,Nt,Ma,Mn,I,Bt,za,We,Ea,Ca,Ut,xa,Oe,Fa,Aa,Je,Pa,yo,qa,Ia,Sa,A,ja,wo,Da,Na,To,Ba,Ua,Lo,Wa,Oa,$o,Ja,Ra,Mo,Ga,Va,Za,Re,Xa,Ge,Ha,Ya,zn,Ve,En,Wt,zo,Qa,Cn,Ze,xn,Ot,Ka,Fn,Jt,Xe,es,He,ts,os,An,S,ns,Ye,as,ss,Qe,rs,is,Ke,ls,ds,et,cs,hs,Pn,te,ge,Eo,tt,ms,Co,ps,qn,D,ot,us,nt,fs,Rt,gs,_s,vs,oe,ks,Gt,bs,ys,Vt,ws,Ts,Ls,_e,In,ne,ve,xo,at,$s,Fo,Ms,Sn,x,st,zs,Ao,Es,Cs,Zt,rt,xs,ke,it,Fs,lt,As,Po,Ps,qs,Is,U,dt,Ss,qo,js,Ds,be,Ns,Io,Bs,Us,ye,ct,Ws,So,Os,jn,ae,we,jo,ht,Js,Do,Rs,Dn,M,mt,Gs,No,Vs,Zs,Bo,Xs,Hs,Te,Ys,N,Qs,Uo,Ks,er,Wo,tr,or,Oo,nr,ar,pt,sr,rr,ir,ut,lr,Xt,dr,cr,hr,R,ft,mr,Jo,pr,ur,Ro,fr,gr,Le,gt,_r,se,vr,Go,kr,br,Vo,yr,wr,Tr,G,_t,Lr,Ht,$r,Yt,Mr,zr,Zo,Er,Cr,$e,vt,xr,re,Fr,Xo,Ar,Pr,Ho,qr,Ir,Sr,Qt,kt,Nn,ie,Me,Yo,bt,jr,Qo,Dr,Bn,P,yt,Nr,wt,Br,Kt,Ur,Wr,Or,Tt,Jr,Lt,Rr,Gr,Vr,ze,Zr,Ko,Xr,Hr,en,Yr,Qr,V,$t,Kr,le,ei,eo,ti,oi,tn,ni,ai,si,Ee,Un,de,Ce,on,Mt,ri,nn,ii,Wn,ce,zt,li,W,Et,di,he,ci,to,hi,mi,an,pi,ui,fi,xe,gi,Fe,On,me,Ae,sn,Ct,_i,rn,vi,Jn,E,xt,ki,ln,bi,yi,oo,no,wi,Ti,Li,B,$i,dn,Mi,zi,cn,Ei,Ci,hn,xi,Fi,mn,Ai,Pi,qi,Ft,Ii,ao,Si,ji,Di,At,Ni,Pt,Bi,Ui,Wi,Z,qt,Oi,pe,Ji,so,Ri,Gi,pn,Vi,Zi,Xi,Pe,Rn;return u=new je({}),De=new je({}),Ve=new _o({props:{code:"cHl0aG9uJTIwc3JjJTJGdHJhbnNmb3JtZXJzJTJGbW9kZWxzJTJGbGxhbWElMkZjb252ZXJ0X2xsYW1hX3dlaWdodHNfdG9faGYucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLWlucHV0X2RpciUyMCUyRnBhdGglMkZ0byUyRmRvd25sb2FkZWQlMkZsbGFtYSUyRndlaWdodHMlMjAtLW1vZGVsX3NpemUlMjA3QiUyMC0tb3V0cHV0X2RpciUyMCUyRm91dHB1dCUyRnBhdGg=",highlighted:`python src/transformers/models/llama/convert_llama_weights_to_hf.py \\
    --input_dir /path/to/downloaded/llama/weights --model_size 7B --output_dir /output/path`}}),Ze=new _o({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYW1hRm9yQ2F1c2FsTE0lMkMlMjBMbGFtYVRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMExsYW1hVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjIlMkZvdXRwdXQlMkZwYXRoJTIyKSUwQW1vZGVsJTIwJTNEJTIwTGxhbWFGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyJTJGb3V0cHV0JTJGcGF0aCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaForCausalLM, LlamaTokenizer

tokenizer = LlamaTokenizer.from_pretrained(<span class="hljs-string">&quot;/output/path&quot;</span>)
model = LlamaForCausalLM.from_pretrained(<span class="hljs-string">&quot;/output/path&quot;</span>)`}}),tt=new je({}),ot=new C({props:{name:"class transformers.LlamaConfig",anchor:"transformers.LlamaConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 11008"},{name:"num_hidden_layers",val:" = 32"},{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-06"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = None"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"pretraining_tp",val:" = 1"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_scaling",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the LLaMA model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.32.0/en/model_doc/llama2#transformers.LlamaModel">LlamaModel</a>`,name:"vocab_size"},{anchor:"transformers.LlamaConfig.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.LlamaConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 11008) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.LlamaConfig.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.LlamaConfig.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.LlamaConfig.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 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>num_attention_heads\`.`,name:"num_key_value_heads"},{anchor:"transformers.LlamaConfig.pretraining_tp",description:`<strong>pretraining_tp</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) &#x2014;
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to <a href="https://huggingface.co/docs/transformers/parallelism" rel="nofollow">this
document</a> to understand more about it. This value is
necessary to ensure exact reproducibility of the pretraining results. Please refer to <a href="https://github.com/pytorch/pytorch/issues/76232" rel="nofollow">this
issue</a>.`,name:"pretraining_tp"},{anchor:"transformers.LlamaConfig.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.LlamaConfig.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. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.LlamaConfig.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.LlamaConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.LlamaConfig.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.LlamaConfig.tie_word_embeddings(bool,",description:`<strong>tie_word_embeddings(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings(bool,"},{anchor:"transformers.LlamaConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
strategies: linear and dynamic. Their scaling factor must be an float greater than 1. The expected format
is <code>{&quot;type&quot;: strategy name, &quot;factor&quot;: scaling factor}</code>. When using this flag, don&#x2019;t update
<code>max_position_embeddings</code> to the expected new maximum. See the following thread for more information on how
these scaling strategies behave:
<a href="https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/" rel="nofollow">https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/</a>. This is an
experimental feature, subject to breaking API changes in future versions.</p>
<p>Example &#x2014;`,name:"rope_scaling"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/configuration_llama.py#L31"}}),_e=new ua({props:{anchor:"transformers.LlamaConfig.example",$$slots:{default:[Nd]},$$scope:{ctx:F}}}),at=new je({}),st=new C({props:{name:"class transformers.LlamaTokenizer",anchor:"transformers.LlamaTokenizer",parameters:[{name:"vocab_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"pad_token",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"add_bos_token",val:" = True"},{name:"add_eos_token",val:" = False"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"use_default_system_prompt",val:" = True"},{name:"spaces_between_special_tokens",val:" = False"},{name:"legacy",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.LlamaTokenizer.legacy",description:`<strong>legacy</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the <code>legacy</code> behavior of the tokenizer should be used. Legacy is before the merge of #24622
and #25224 which includes fixes to properly handle tokens that appear after special tokens. A simple
example:</p>
<ul>
<li><code>legacy=True</code>:</li>
</ul>`,name:"legacy"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/tokenization_llama.py#L67"}}),rt=new C({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LlamaTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/tokenization_llama.py#L291"}}),it=new C({props:{name:"get_special_tokens_mask",anchor:"transformers.LlamaTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/tokenization_llama.py#L302",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),dt=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/tokenization_llama.py#L339",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),be=new ua({props:{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Bd]},$$scope:{ctx:F}}}),ct=new C({props:{name:"save_vocabulary",anchor:"transformers.LlamaTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:""},{name:"filename_prefix",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.save_vocabulary.save_directory",description:`<strong>save_directory</strong> (<code>str</code>) &#x2014;
The directory in which to save the vocabulary.`,name:"save_directory"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/tokenization_llama.py#L264",returnDescription:`
<p>Paths to the files saved.</p>
`,returnType:`
<p><code>Tuple(str)</code></p>
`}}),ht=new je({}),mt=new C({props:{name:"class transformers.LlamaTokenizerFast",anchor:"transformers.LlamaTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"add_bos_token",val:" = True"},{name:"add_eos_token",val:" = False"},{name:"use_default_system_prompt",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .model extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.LlamaTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>) &#x2014;
<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.LlamaTokenizerFast.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Wether to cleanup spaces after decoding, cleanup consists in removing potential artifacts like extra
spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.LlamaTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.`,name:"bos_token"},{anchor:"transformers.LlamaTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.LlamaTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&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"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/tokenization_llama_fast.py#L52"}}),Te=new ua({props:{anchor:"transformers.LlamaTokenizerFast.example",$$slots:{default:[Ud]},$$scope:{ctx:F}}}),ft=new C({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LlamaTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.LlamaTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3121",returnDescription:`
<p>The model input with special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),gt=new C({props:{name:"get_special_tokens_mask",anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids of the first sequence.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
List of ids of the second sequence.`,name:"token_ids_1"},{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3566",returnDescription:`
<p>1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p>A list of integers in the range [0, 1]</p>
`}}),_t=new C({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/tokenization_utils_base.py#L3101",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),vt=new C({props:{name:"update_post_processor",anchor:"transformers.LlamaTokenizerFast.update_post_processor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/tokenization_llama_fast.py#L133"}}),kt=new C({props:{name:"save_vocabulary",anchor:"transformers.LlamaTokenizerFast.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/tokenization_llama_fast.py#L173"}}),bt=new je({}),yt=new C({props:{name:"class transformers.LlamaModel",anchor:"transformers.LlamaModel",parameters:[{name:"config",val:": LlamaConfig"}],parametersDescription:[{anchor:"transformers.LlamaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/llama2#transformers.LlamaConfig">LlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; LlamaConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/modeling_llama.py#L552"}}),$t=new C({props:{name:"forward",anchor:"transformers.LlamaModel.forward",parameters:[{name:"input_ids",val:": 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[typing.List[torch.FloatTensor]] = 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:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LlamaModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LlamaModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaModel.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.LlamaModel.forward.past_key_values",description:`<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>) &#x2014;
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>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_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>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaModel.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.LlamaModel.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.LlamaModel.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.LlamaModel.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.LlamaModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/modeling_llama.py#L603"}}),Ee=new tl({props:{$$slots:{default:[Wd]},$$scope:{ctx:F}}}),Mt=new je({}),zt=new C({props:{name:"class transformers.LlamaForCausalLM",anchor:"transformers.LlamaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/modeling_llama.py#L731"}}),Et=new C({props:{name:"forward",anchor:"transformers.LlamaForCausalLM.forward",parameters:[{name:"input_ids",val:": 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[typing.List[torch.FloatTensor]] = 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:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LlamaForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LlamaForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForCausalLM.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.LlamaForCausalLM.forward.past_key_values",description:`<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>) &#x2014;
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>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_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>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForCausalLM.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.LlamaForCausalLM.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.LlamaForCausalLM.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.LlamaForCausalLM.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.LlamaForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/modeling_llama.py#L761",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/en/model_doc/llama2#transformers.LlamaConfig"
>LlamaConfig</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) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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>) \u2014 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:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new tl({props:{$$slots:{default:[Od]},$$scope:{ctx:F}}}),Fe=new ua({props:{anchor:"transformers.LlamaForCausalLM.forward.example",$$slots:{default:[Jd]},$$scope:{ctx:F}}}),Ct=new je({}),xt=new C({props:{name:"class transformers.LlamaForSequenceClassification",anchor:"transformers.LlamaForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LlamaForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/llama2#transformers.LlamaConfig">LlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/modeling_llama.py#L910"}}),qt=new C({props:{name:"forward",anchor:"transformers.LlamaForSequenceClassification.forward",parameters:[{name:"input_ids",val:": 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[typing.List[torch.FloatTensor]] = 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:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LlamaForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LlamaForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForSequenceClassification.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.LlamaForSequenceClassification.forward.past_key_values",description:`<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>) &#x2014;
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>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_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>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForSequenceClassification.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.LlamaForSequenceClassification.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.LlamaForSequenceClassification.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.LlamaForSequenceClassification.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.LlamaForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/llama/modeling_llama.py#L926"}}),Pe=new tl({props:{$$slots:{default:[Rd]},$$scope:{ctx:F}}}),{c(){m=n("meta"),L=d(),p=n("h1"),g=n("a"),$=n("span"),_(u.$$.fragment),T=d(),q=n("span"),ga=r("Llama2"),bn=d(),ee=n("h2"),ue=n("a"),vo=n("span"),_(De.$$.fragment),_a=d(),ko=n("span"),va=r("Overview"),yn=d(),fe=n("p"),ka=r("The Llama2 model was proposed in "),Ne=n("a"),ba=r("LLaMA: Open Foundation and Fine-Tuned Chat Models"),ya=r(" by Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez Madian Khabsa, Isabel Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov, Pushka rMishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaoqing EllenTan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu, Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan, Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom. It is a collection of foundation language models ranging from 7B to 70B parameters, with checkpoints finetuned for chat application!"),wn=d(),jt=n("p"),wa=r("The abstract from the paper is the following:"),Tn=d(),Dt=n("p"),bo=n("em"),Ta=r("In this work, we develop and release Llama 2, a collection of pretrained and fine-tuned large language models (LLMs) ranging in scale from 7 billion to 70 billion parameters. Our fine-tuned LLMs, called Llama 2-Chat, are optimized for dialogue use cases. Our models outperform open-source chat models on most benchmarks we tested, and based on our human evaluations for helpfulness and safety, may be a suitable substitute for closed-source models. We provide a detailed description of our approach to fine-tuning and safety improvements of Llama 2-Chat in order to enable the community to build on our work and contribute to the responsible development of LLMs."),Ln=d(),Be=n("p"),La=r("Checkout all Llama2 models "),Ue=n("a"),$a=r("here"),$n=d(),Nt=n("p"),Ma=r("Tips:"),Mn=d(),I=n("ul"),Bt=n("li"),za=r("Weights for the Llama2 models can be obtained by filling out "),We=n("a"),Ea=r("this form"),Ca=d(),Ut=n("li"),xa=r("The architecture is very similar to the first Llama, with the addition of Grouped Query Attention (GQA) following this "),Oe=n("a"),Fa=r("paper"),Aa=d(),Je=n("li"),Pa=r("Setting "),yo=n("code"),qa=r("config.pretraining_tp"),Ia=r(" to a value different than 1 will activate the more accurate but slower computation of the linear layers, which should better match the original logits."),Sa=d(),A=n("li"),ja=r("The original model uses "),wo=n("code"),Da=r("pad_id = -1"),Na=r(" which means that there is no padding token. We can\u2019t have the same logic, make sure to add a padding token using "),To=n("code"),Ba=r('tokenizer.add_special_tokens({"pad_token":"<pad>"})'),Ua=r(" and resize the token embedding accordingly. You should also set the "),Lo=n("code"),Wa=r("model.config.pad_token_id"),Oa=r(". The "),$o=n("code"),Ja=r("embed_tokens"),Ra=r(" layer of the model is initialized with "),Mo=n("code"),Ga=r("self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.config.padding_idx)"),Va=r(", which makes sure that encoding the padding token will output zeros, so passing it when initializing is recommended."),Za=d(),Re=n("li"),Xa=r("After filling out the form and gaining access to the model checkpoints, you should be able to use the already converted checkpoints. Otherwise, if you are converting your own model, feel free to use the "),Ge=n("a"),Ha=r("conversion script"),Ya=r(". The script can be called with the following (example) command:"),zn=d(),_(Ve.$$.fragment),En=d(),Wt=n("ul"),zo=n("li"),Qa=r("After conversion, the model and tokenizer can be loaded via:"),Cn=d(),_(Ze.$$.fragment),xn=d(),Ot=n("p"),Ka=r(`Note that executing the script requires enough CPU RAM to host the whole model in float16 precision (even if the biggest versions
come in several checkpoints they each contain a part of each weight of the model, so we need to load them all in RAM). For the 75B model, it\u2019s thus 145GB of RAM needed.`),Fn=d(),Jt=n("ul"),Xe=n("li"),es=r("The LLaMA tokenizer is a BPE model based on "),He=n("a"),ts=r("sentencepiece"),os=r(". One quirk of sentencepiece is that when decoding a sequence, if the first token is the start of the word (e.g. \u201CBanana\u201D), the tokenizer does not prepend the prefix space to the string."),An=d(),S=n("p"),ns=r("This model was contributed by "),Ye=n("a"),as=r("Arthur Zucker"),ss=r(" with contributions from "),Qe=n("a"),rs=r("Lysandre Debut"),is=r(". The code of the implementation in Hugging Face is based on GPT-NeoX "),Ke=n("a"),ls=r("here"),ds=r(". The original code of the authors can be found "),et=n("a"),cs=r("here"),hs=r("."),Pn=d(),te=n("h2"),ge=n("a"),Eo=n("span"),_(tt.$$.fragment),ms=d(),Co=n("span"),ps=r("LlamaConfig"),qn=d(),D=n("div"),_(ot.$$.fragment),us=d(),nt=n("p"),fs=r("This is the configuration class to store the configuration of a "),Rt=n("a"),gs=r("LlamaModel"),_s=r(`. It is used to instantiate an LLaMA
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 LLaMA-7B.`),vs=d(),oe=n("p"),ks=r("Configuration objects inherit from "),Gt=n("a"),bs=r("PretrainedConfig"),ys=r(` and can be used to control the model outputs. Read the
documentation from `),Vt=n("a"),ws=r("PretrainedConfig"),Ts=r(" for more information."),Ls=d(),_(_e.$$.fragment),In=d(),ne=n("h2"),ve=n("a"),xo=n("span"),_(at.$$.fragment),$s=d(),Fo=n("span"),Ms=r("LlamaTokenizer"),Sn=d(),x=n("div"),_(st.$$.fragment),zs=d(),Ao=n("p"),Es=r(`Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding. The default padding token is unset as there is
no padding token in the original model.`),Cs=d(),Zt=n("div"),_(rt.$$.fragment),xs=d(),ke=n("div"),_(it.$$.fragment),Fs=d(),lt=n("p"),As=r(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Po=n("code"),Ps=r("prepare_for_model"),qs=r(" method."),Is=d(),U=n("div"),_(dt.$$.fragment),Ss=d(),qo=n("p"),js=r("Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT"),Ds=d(),_(be.$$.fragment),Ns=d(),Io=n("p"),Bs=r("if token_ids_1 is None, only returns the first portion of the mask (0s)."),Us=d(),ye=n("div"),_(ct.$$.fragment),Ws=d(),So=n("p"),Os=r("Save the vocabulary and special tokens file to a directory."),jn=d(),ae=n("h2"),we=n("a"),jo=n("span"),_(ht.$$.fragment),Js=d(),Do=n("span"),Rs=r("LlamaTokenizerFast"),Dn=d(),M=n("div"),_(mt.$$.fragment),Gs=d(),No=n("p"),Vs=r("Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding."),Zs=d(),Bo=n("p"),Xs=r("This uses notably ByteFallback and no normalization."),Hs=d(),_(Te.$$.fragment),Ys=d(),N=n("p"),Qs=r("If you want to change the "),Uo=n("code"),Ks=r("bos_token"),er=r(" or the "),Wo=n("code"),tr=r("eos_token"),or=r(`, make sure to specify them when initializing the model, or
call `),Oo=n("code"),nr=r("tokenizer.update_post_processor()"),ar=r(` to make sure that the post-processing is correctly done (otherwise the
values of the first token and final token of an encoded sequence will not be correct). For more details, checkout
[post-processors] (`),pt=n("a"),sr=r("https://huggingface.co/docs/tokenizers/api/post-processors"),rr=r(") documentation."),ir=d(),ut=n("p"),lr=r("This tokenizer inherits from "),Xt=n("a"),dr=r("PreTrainedTokenizerFast"),cr=r(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),hr=d(),R=n("div"),_(ft.$$.fragment),mr=d(),Jo=n("p"),pr=r(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens.`),ur=d(),Ro=n("p"),fr=r("This implementation does not add special tokens and this method should be overridden in a subclass."),gr=d(),Le=n("div"),_(gt.$$.fragment),_r=d(),se=n("p"),vr=r(`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Go=n("code"),kr=r("prepare_for_model"),br=r(" or "),Vo=n("code"),yr=r("encode_plus"),wr=r(" methods."),Tr=d(),G=n("div"),_(_t.$$.fragment),Lr=d(),Ht=n("p"),$r=r("Create the token type IDs corresponding to the sequences passed. "),Yt=n("a"),Mr=r(`What are token type
IDs?`),zr=d(),Zo=n("p"),Er=r("Should be overridden in a subclass if the model has a special way of building those."),Cr=d(),$e=n("div"),_(vt.$$.fragment),xr=d(),re=n("p"),Fr=r("Updates the underlying post processor with the current "),Xo=n("code"),Ar=r("bos_token"),Pr=r(" and "),Ho=n("code"),qr=r("eos_token"),Ir=r("."),Sr=d(),Qt=n("div"),_(kt.$$.fragment),Nn=d(),ie=n("h2"),Me=n("a"),Yo=n("span"),_(bt.$$.fragment),jr=d(),Qo=n("span"),Dr=r("LlamaModel"),Bn=d(),P=n("div"),_(yt.$$.fragment),Nr=d(),wt=n("p"),Br=r(`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Kt=n("a"),Ur=r("PreTrainedModel"),Wr=r(`. 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.)`),Or=d(),Tt=n("p"),Jr=r("This model is also a PyTorch "),Lt=n("a"),Rr=r("torch.nn.Module"),Gr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vr=d(),ze=n("p"),Zr=r("Transformer decoder consisting of "),Ko=n("em"),Xr=r("config.num_hidden_layers"),Hr=r(" layers. Each layer is a "),en=n("code"),Yr=r("LlamaDecoderLayer"),Qr=d(),V=n("div"),_($t.$$.fragment),Kr=d(),le=n("p"),ei=r("The "),eo=n("a"),ti=r("LlamaModel"),oi=r(" forward method, overrides the "),tn=n("code"),ni=r("__call__"),ai=r(" special method."),si=d(),_(Ee.$$.fragment),Un=d(),de=n("h2"),Ce=n("a"),on=n("span"),_(Mt.$$.fragment),ri=d(),nn=n("span"),ii=r("LlamaForCausalLM"),Wn=d(),ce=n("div"),_(zt.$$.fragment),li=d(),W=n("div"),_(Et.$$.fragment),di=d(),he=n("p"),ci=r("The "),to=n("a"),hi=r("LlamaForCausalLM"),mi=r(" forward method, overrides the "),an=n("code"),pi=r("__call__"),ui=r(" special method."),fi=d(),_(xe.$$.fragment),gi=d(),_(Fe.$$.fragment),On=d(),me=n("h2"),Ae=n("a"),sn=n("span"),_(Ct.$$.fragment),_i=d(),rn=n("span"),vi=r("LlamaForSequenceClassification"),Jn=d(),E=n("div"),_(xt.$$.fragment),ki=d(),ln=n("p"),bi=r("The LLaMa Model transformer with a sequence classification head on top (linear layer)."),yi=d(),oo=n("p"),no=n("a"),wi=r("LlamaForSequenceClassification"),Ti=r(` uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`),Li=d(),B=n("p"),$i=r(`Since it does classification on the last token, it requires to know the position of the last token. If a
`),dn=n("code"),Mi=r("pad_token_id"),zi=r(` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),cn=n("code"),Ei=r("pad_token_id"),Ci=r(` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),hn=n("code"),xi=r("inputs_embeds"),Fi=r(" are passed instead of "),mn=n("code"),Ai=r("input_ids"),Pi=r(`, it does the same (take the last value in
each row of the batch).`),qi=d(),Ft=n("p"),Ii=r("This model inherits from "),ao=n("a"),Si=r("PreTrainedModel"),ji=r(`. 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.)`),Di=d(),At=n("p"),Ni=r("This model is also a PyTorch "),Pt=n("a"),Bi=r("torch.nn.Module"),Ui=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Wi=d(),Z=n("div"),_(qt.$$.fragment),Oi=d(),pe=n("p"),Ji=r("The "),so=n("a"),Ri=r("LlamaForSequenceClassification"),Gi=r(" forward method, overrides the "),pn=n("code"),Vi=r("__call__"),Zi=r(" special method."),Xi=d(),_(Pe.$$.fragment),this.h()},l(t){const h=jd('[data-svelte="svelte-1phssyn"]',document.head);m=a(h,"META",{name:!0,content:!0}),h.forEach(o),L=c(t),p=a(t,"H1",{class:!0});var It=s(p);g=a(It,"A",{id:!0,class:!0,href:!0});var un=s(g);$=a(un,"SPAN",{});var fn=s($);v(u.$$.fragment,fn),fn.forEach(o),un.forEach(o),T=c(It),q=a(It,"SPAN",{});var gn=s(q);ga=i(gn,"Llama2"),gn.forEach(o),It.forEach(o),bn=c(t),ee=a(t,"H2",{class:!0});var St=s(ee);ue=a(St,"A",{id:!0,class:!0,href:!0});var _n=s(ue);vo=a(_n,"SPAN",{});var vn=s(vo);v(De.$$.fragment,vn),vn.forEach(o),_n.forEach(o),_a=c(St),ko=a(St,"SPAN",{});var ol=s(ko);va=i(ol,"Overview"),ol.forEach(o),St.forEach(o),yn=c(t),fe=a(t,"P",{});var Gn=s(fe);ka=i(Gn,"The Llama2 model was proposed in "),Ne=a(Gn,"A",{href:!0,rel:!0});var nl=s(Ne);ba=i(nl,"LLaMA: Open Foundation and Fine-Tuned Chat Models"),nl.forEach(o),ya=i(Gn," by Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez Madian Khabsa, Isabel Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov, Pushka rMishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaoqing EllenTan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu, Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan, Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom. It is a collection of foundation language models ranging from 7B to 70B parameters, with checkpoints finetuned for chat application!"),Gn.forEach(o),wn=c(t),jt=a(t,"P",{});var al=s(jt);wa=i(al,"The abstract from the paper is the following:"),al.forEach(o),Tn=c(t),Dt=a(t,"P",{});var sl=s(Dt);bo=a(sl,"EM",{});var rl=s(bo);Ta=i(rl,"In this work, we develop and release Llama 2, a collection of pretrained and fine-tuned large language models (LLMs) ranging in scale from 7 billion to 70 billion parameters. Our fine-tuned LLMs, called Llama 2-Chat, are optimized for dialogue use cases. Our models outperform open-source chat models on most benchmarks we tested, and based on our human evaluations for helpfulness and safety, may be a suitable substitute for closed-source models. We provide a detailed description of our approach to fine-tuning and safety improvements of Llama 2-Chat in order to enable the community to build on our work and contribute to the responsible development of LLMs."),rl.forEach(o),sl.forEach(o),Ln=c(t),Be=a(t,"P",{});var Hi=s(Be);La=i(Hi,"Checkout all Llama2 models "),Ue=a(Hi,"A",{href:!0,rel:!0});var il=s(Ue);$a=i(il,"here"),il.forEach(o),Hi.forEach(o),$n=c(t),Nt=a(t,"P",{});var ll=s(Nt);Ma=i(ll,"Tips:"),ll.forEach(o),Mn=c(t),I=a(t,"UL",{});var X=s(I);Bt=a(X,"LI",{});var Yi=s(Bt);za=i(Yi,"Weights for the Llama2 models can be obtained by filling out "),We=a(Yi,"A",{href:!0,rel:!0});var dl=s(We);Ea=i(dl,"this form"),dl.forEach(o),Yi.forEach(o),Ca=c(X),Ut=a(X,"LI",{});var Qi=s(Ut);xa=i(Qi,"The architecture is very similar to the first Llama, with the addition of Grouped Query Attention (GQA) following this "),Oe=a(Qi,"A",{href:!0,rel:!0});var cl=s(Oe);Fa=i(cl,"paper"),cl.forEach(o),Qi.forEach(o),Aa=c(X),Je=a(X,"LI",{});var Vn=s(Je);Pa=i(Vn,"Setting "),yo=a(Vn,"CODE",{});var hl=s(yo);qa=i(hl,"config.pretraining_tp"),hl.forEach(o),Ia=i(Vn," to a value different than 1 will activate the more accurate but slower computation of the linear layers, which should better match the original logits."),Vn.forEach(o),Sa=c(X),A=a(X,"LI",{});var O=s(A);ja=i(O,"The original model uses "),wo=a(O,"CODE",{});var ml=s(wo);Da=i(ml,"pad_id = -1"),ml.forEach(o),Na=i(O," which means that there is no padding token. We can\u2019t have the same logic, make sure to add a padding token using "),To=a(O,"CODE",{});var pl=s(To);Ba=i(pl,'tokenizer.add_special_tokens({"pad_token":"<pad>"})'),pl.forEach(o),Ua=i(O," and resize the token embedding accordingly. You should also set the "),Lo=a(O,"CODE",{});var ul=s(Lo);Wa=i(ul,"model.config.pad_token_id"),ul.forEach(o),Oa=i(O,". The "),$o=a(O,"CODE",{});var fl=s($o);Ja=i(fl,"embed_tokens"),fl.forEach(o),Ra=i(O," layer of the model is initialized with "),Mo=a(O,"CODE",{});var gl=s(Mo);Ga=i(gl,"self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.config.padding_idx)"),gl.forEach(o),Va=i(O,", which makes sure that encoding the padding token will output zeros, so passing it when initializing is recommended."),O.forEach(o),Za=c(X),Re=a(X,"LI",{});var Zn=s(Re);Xa=i(Zn,"After filling out the form and gaining access to the model checkpoints, you should be able to use the already converted checkpoints. Otherwise, if you are converting your own model, feel free to use the "),Ge=a(Zn,"A",{href:!0,rel:!0});var _l=s(Ge);Ha=i(_l,"conversion script"),_l.forEach(o),Ya=i(Zn,". The script can be called with the following (example) command:"),Zn.forEach(o),X.forEach(o),zn=c(t),v(Ve.$$.fragment,t),En=c(t),Wt=a(t,"UL",{});var vl=s(Wt);zo=a(vl,"LI",{});var kl=s(zo);Qa=i(kl,"After conversion, the model and tokenizer can be loaded via:"),kl.forEach(o),vl.forEach(o),Cn=c(t),v(Ze.$$.fragment,t),xn=c(t),Ot=a(t,"P",{});var bl=s(Ot);Ka=i(bl,`Note that executing the script requires enough CPU RAM to host the whole model in float16 precision (even if the biggest versions
come in several checkpoints they each contain a part of each weight of the model, so we need to load them all in RAM). For the 75B model, it\u2019s thus 145GB of RAM needed.`),bl.forEach(o),Fn=c(t),Jt=a(t,"UL",{});var yl=s(Jt);Xe=a(yl,"LI",{});var Xn=s(Xe);es=i(Xn,"The LLaMA tokenizer is a BPE model based on "),He=a(Xn,"A",{href:!0,rel:!0});var wl=s(He);ts=i(wl,"sentencepiece"),wl.forEach(o),os=i(Xn,". One quirk of sentencepiece is that when decoding a sequence, if the first token is the start of the word (e.g. \u201CBanana\u201D), the tokenizer does not prepend the prefix space to the string."),Xn.forEach(o),yl.forEach(o),An=c(t),S=a(t,"P",{});var H=s(S);ns=i(H,"This model was contributed by "),Ye=a(H,"A",{href:!0,rel:!0});var Tl=s(Ye);as=i(Tl,"Arthur Zucker"),Tl.forEach(o),ss=i(H," with contributions from "),Qe=a(H,"A",{href:!0,rel:!0});var Ll=s(Qe);rs=i(Ll,"Lysandre Debut"),Ll.forEach(o),is=i(H,". The code of the implementation in Hugging Face is based on GPT-NeoX "),Ke=a(H,"A",{href:!0,rel:!0});var $l=s(Ke);ls=i($l,"here"),$l.forEach(o),ds=i(H,". The original code of the authors can be found "),et=a(H,"A",{href:!0,rel:!0});var Ml=s(et);cs=i(Ml,"here"),Ml.forEach(o),hs=i(H,"."),H.forEach(o),Pn=c(t),te=a(t,"H2",{class:!0});var Hn=s(te);ge=a(Hn,"A",{id:!0,class:!0,href:!0});var zl=s(ge);Eo=a(zl,"SPAN",{});var El=s(Eo);v(tt.$$.fragment,El),El.forEach(o),zl.forEach(o),ms=c(Hn),Co=a(Hn,"SPAN",{});var Cl=s(Co);ps=i(Cl,"LlamaConfig"),Cl.forEach(o),Hn.forEach(o),qn=c(t),D=a(t,"DIV",{class:!0});var qe=s(D);v(ot.$$.fragment,qe),us=c(qe),nt=a(qe,"P",{});var Yn=s(nt);fs=i(Yn,"This is the configuration class to store the configuration of a "),Rt=a(Yn,"A",{href:!0});var xl=s(Rt);gs=i(xl,"LlamaModel"),xl.forEach(o),_s=i(Yn,`. It is used to instantiate an LLaMA
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 LLaMA-7B.`),Yn.forEach(o),vs=c(qe),oe=a(qe,"P",{});var ro=s(oe);ks=i(ro,"Configuration objects inherit from "),Gt=a(ro,"A",{href:!0});var Fl=s(Gt);bs=i(Fl,"PretrainedConfig"),Fl.forEach(o),ys=i(ro,` and can be used to control the model outputs. Read the
documentation from `),Vt=a(ro,"A",{href:!0});var Al=s(Vt);ws=i(Al,"PretrainedConfig"),Al.forEach(o),Ts=i(ro," for more information."),ro.forEach(o),Ls=c(qe),v(_e.$$.fragment,qe),qe.forEach(o),In=c(t),ne=a(t,"H2",{class:!0});var Qn=s(ne);ve=a(Qn,"A",{id:!0,class:!0,href:!0});var Pl=s(ve);xo=a(Pl,"SPAN",{});var ql=s(xo);v(at.$$.fragment,ql),ql.forEach(o),Pl.forEach(o),$s=c(Qn),Fo=a(Qn,"SPAN",{});var Il=s(Fo);Ms=i(Il,"LlamaTokenizer"),Il.forEach(o),Qn.forEach(o),Sn=c(t),x=a(t,"DIV",{class:!0});var J=s(x);v(st.$$.fragment,J),zs=c(J),Ao=a(J,"P",{});var Sl=s(Ao);Es=i(Sl,`Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding. The default padding token is unset as there is
no padding token in the original model.`),Sl.forEach(o),Cs=c(J),Zt=a(J,"DIV",{class:!0});var jl=s(Zt);v(rt.$$.fragment,jl),jl.forEach(o),xs=c(J),ke=a(J,"DIV",{class:!0});var Kn=s(ke);v(it.$$.fragment,Kn),Fs=c(Kn),lt=a(Kn,"P",{});var ea=s(lt);As=i(ea,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Po=a(ea,"CODE",{});var Dl=s(Po);Ps=i(Dl,"prepare_for_model"),Dl.forEach(o),qs=i(ea," method."),ea.forEach(o),Kn.forEach(o),Is=c(J),U=a(J,"DIV",{class:!0});var Ie=s(U);v(dt.$$.fragment,Ie),Ss=c(Ie),qo=a(Ie,"P",{});var Nl=s(qo);js=i(Nl,"Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT"),Nl.forEach(o),Ds=c(Ie),v(be.$$.fragment,Ie),Ns=c(Ie),Io=a(Ie,"P",{});var Bl=s(Io);Bs=i(Bl,"if token_ids_1 is None, only returns the first portion of the mask (0s)."),Bl.forEach(o),Ie.forEach(o),Us=c(J),ye=a(J,"DIV",{class:!0});var ta=s(ye);v(ct.$$.fragment,ta),Ws=c(ta),So=a(ta,"P",{});var Ul=s(So);Os=i(Ul,"Save the vocabulary and special tokens file to a directory."),Ul.forEach(o),ta.forEach(o),J.forEach(o),jn=c(t),ae=a(t,"H2",{class:!0});var oa=s(ae);we=a(oa,"A",{id:!0,class:!0,href:!0});var Wl=s(we);jo=a(Wl,"SPAN",{});var Ol=s(jo);v(ht.$$.fragment,Ol),Ol.forEach(o),Wl.forEach(o),Js=c(oa),Do=a(oa,"SPAN",{});var Jl=s(Do);Rs=i(Jl,"LlamaTokenizerFast"),Jl.forEach(o),oa.forEach(o),Dn=c(t),M=a(t,"DIV",{class:!0});var z=s(M);v(mt.$$.fragment,z),Gs=c(z),No=a(z,"P",{});var Rl=s(No);Vs=i(Rl,"Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding."),Rl.forEach(o),Zs=c(z),Bo=a(z,"P",{});var Gl=s(Bo);Xs=i(Gl,"This uses notably ByteFallback and no normalization."),Gl.forEach(o),Hs=c(z),v(Te.$$.fragment,z),Ys=c(z),N=a(z,"P",{});var Y=s(N);Qs=i(Y,"If you want to change the "),Uo=a(Y,"CODE",{});var Vl=s(Uo);Ks=i(Vl,"bos_token"),Vl.forEach(o),er=i(Y," or the "),Wo=a(Y,"CODE",{});var Zl=s(Wo);tr=i(Zl,"eos_token"),Zl.forEach(o),or=i(Y,`, make sure to specify them when initializing the model, or
call `),Oo=a(Y,"CODE",{});var Xl=s(Oo);nr=i(Xl,"tokenizer.update_post_processor()"),Xl.forEach(o),ar=i(Y,` to make sure that the post-processing is correctly done (otherwise the
values of the first token and final token of an encoded sequence will not be correct). For more details, checkout
[post-processors] (`),pt=a(Y,"A",{href:!0,rel:!0});var Hl=s(pt);sr=i(Hl,"https://huggingface.co/docs/tokenizers/api/post-processors"),Hl.forEach(o),rr=i(Y,") documentation."),Y.forEach(o),ir=c(z),ut=a(z,"P",{});var na=s(ut);lr=i(na,"This tokenizer inherits from "),Xt=a(na,"A",{href:!0});var Yl=s(Xt);dr=i(Yl,"PreTrainedTokenizerFast"),Yl.forEach(o),cr=i(na,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),na.forEach(o),hr=c(z),R=a(z,"DIV",{class:!0});var io=s(R);v(ft.$$.fragment,io),mr=c(io),Jo=a(io,"P",{});var Ql=s(Jo);pr=i(Ql,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens.`),Ql.forEach(o),ur=c(io),Ro=a(io,"P",{});var Kl=s(Ro);fr=i(Kl,"This implementation does not add special tokens and this method should be overridden in a subclass."),Kl.forEach(o),io.forEach(o),gr=c(z),Le=a(z,"DIV",{class:!0});var aa=s(Le);v(gt.$$.fragment,aa),_r=c(aa),se=a(aa,"P",{});var lo=s(se);vr=i(lo,`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Go=a(lo,"CODE",{});var ed=s(Go);kr=i(ed,"prepare_for_model"),ed.forEach(o),br=i(lo," or "),Vo=a(lo,"CODE",{});var td=s(Vo);yr=i(td,"encode_plus"),td.forEach(o),wr=i(lo," methods."),lo.forEach(o),aa.forEach(o),Tr=c(z),G=a(z,"DIV",{class:!0});var co=s(G);v(_t.$$.fragment,co),Lr=c(co),Ht=a(co,"P",{});var Ki=s(Ht);$r=i(Ki,"Create the token type IDs corresponding to the sequences passed. "),Yt=a(Ki,"A",{href:!0});var od=s(Yt);Mr=i(od,`What are token type
IDs?`),od.forEach(o),Ki.forEach(o),zr=c(co),Zo=a(co,"P",{});var nd=s(Zo);Er=i(nd,"Should be overridden in a subclass if the model has a special way of building those."),nd.forEach(o),co.forEach(o),Cr=c(z),$e=a(z,"DIV",{class:!0});var sa=s($e);v(vt.$$.fragment,sa),xr=c(sa),re=a(sa,"P",{});var ho=s(re);Fr=i(ho,"Updates the underlying post processor with the current "),Xo=a(ho,"CODE",{});var ad=s(Xo);Ar=i(ad,"bos_token"),ad.forEach(o),Pr=i(ho," and "),Ho=a(ho,"CODE",{});var sd=s(Ho);qr=i(sd,"eos_token"),sd.forEach(o),Ir=i(ho,"."),ho.forEach(o),sa.forEach(o),Sr=c(z),Qt=a(z,"DIV",{class:!0});var rd=s(Qt);v(kt.$$.fragment,rd),rd.forEach(o),z.forEach(o),Nn=c(t),ie=a(t,"H2",{class:!0});var ra=s(ie);Me=a(ra,"A",{id:!0,class:!0,href:!0});var id=s(Me);Yo=a(id,"SPAN",{});var ld=s(Yo);v(bt.$$.fragment,ld),ld.forEach(o),id.forEach(o),jr=c(ra),Qo=a(ra,"SPAN",{});var dd=s(Qo);Dr=i(dd,"LlamaModel"),dd.forEach(o),ra.forEach(o),Bn=c(t),P=a(t,"DIV",{class:!0});var Q=s(P);v(yt.$$.fragment,Q),Nr=c(Q),wt=a(Q,"P",{});var ia=s(wt);Br=i(ia,`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from `),Kt=a(ia,"A",{href:!0});var cd=s(Kt);Ur=i(cd,"PreTrainedModel"),cd.forEach(o),Wr=i(ia,`. 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.)`),ia.forEach(o),Or=c(Q),Tt=a(Q,"P",{});var la=s(Tt);Jr=i(la,"This model is also a PyTorch "),Lt=a(la,"A",{href:!0,rel:!0});var hd=s(Lt);Rr=i(hd,"torch.nn.Module"),hd.forEach(o),Gr=i(la,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),la.forEach(o),Vr=c(Q),ze=a(Q,"P",{});var kn=s(ze);Zr=i(kn,"Transformer decoder consisting of "),Ko=a(kn,"EM",{});var md=s(Ko);Xr=i(md,"config.num_hidden_layers"),md.forEach(o),Hr=i(kn," layers. Each layer is a "),en=a(kn,"CODE",{});var pd=s(en);Yr=i(pd,"LlamaDecoderLayer"),pd.forEach(o),kn.forEach(o),Qr=c(Q),V=a(Q,"DIV",{class:!0});var mo=s(V);v($t.$$.fragment,mo),Kr=c(mo),le=a(mo,"P",{});var po=s(le);ei=i(po,"The "),eo=a(po,"A",{href:!0});var ud=s(eo);ti=i(ud,"LlamaModel"),ud.forEach(o),oi=i(po," forward method, overrides the "),tn=a(po,"CODE",{});var fd=s(tn);ni=i(fd,"__call__"),fd.forEach(o),ai=i(po," special method."),po.forEach(o),si=c(mo),v(Ee.$$.fragment,mo),mo.forEach(o),Q.forEach(o),Un=c(t),de=a(t,"H2",{class:!0});var da=s(de);Ce=a(da,"A",{id:!0,class:!0,href:!0});var gd=s(Ce);on=a(gd,"SPAN",{});var _d=s(on);v(Mt.$$.fragment,_d),_d.forEach(o),gd.forEach(o),ri=c(da),nn=a(da,"SPAN",{});var vd=s(nn);ii=i(vd,"LlamaForCausalLM"),vd.forEach(o),da.forEach(o),Wn=c(t),ce=a(t,"DIV",{class:!0});var ca=s(ce);v(zt.$$.fragment,ca),li=c(ca),W=a(ca,"DIV",{class:!0});var Se=s(W);v(Et.$$.fragment,Se),di=c(Se),he=a(Se,"P",{});var uo=s(he);ci=i(uo,"The "),to=a(uo,"A",{href:!0});var kd=s(to);hi=i(kd,"LlamaForCausalLM"),kd.forEach(o),mi=i(uo," forward method, overrides the "),an=a(uo,"CODE",{});var bd=s(an);pi=i(bd,"__call__"),bd.forEach(o),ui=i(uo," special method."),uo.forEach(o),fi=c(Se),v(xe.$$.fragment,Se),gi=c(Se),v(Fe.$$.fragment,Se),Se.forEach(o),ca.forEach(o),On=c(t),me=a(t,"H2",{class:!0});var ha=s(me);Ae=a(ha,"A",{id:!0,class:!0,href:!0});var yd=s(Ae);sn=a(yd,"SPAN",{});var wd=s(sn);v(Ct.$$.fragment,wd),wd.forEach(o),yd.forEach(o),_i=c(ha),rn=a(ha,"SPAN",{});var Td=s(rn);vi=i(Td,"LlamaForSequenceClassification"),Td.forEach(o),ha.forEach(o),Jn=c(t),E=a(t,"DIV",{class:!0});var j=s(E);v(xt.$$.fragment,j),ki=c(j),ln=a(j,"P",{});var Ld=s(ln);bi=i(Ld,"The LLaMa Model transformer with a sequence classification head on top (linear layer)."),Ld.forEach(o),yi=c(j),oo=a(j,"P",{});var el=s(oo);no=a(el,"A",{href:!0});var $d=s(no);wi=i($d,"LlamaForSequenceClassification"),$d.forEach(o),Ti=i(el,` uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`),el.forEach(o),Li=c(j),B=a(j,"P",{});var K=s(B);$i=i(K,`Since it does classification on the last token, it requires to know the position of the last token. If a
`),dn=a(K,"CODE",{});var Md=s(dn);Mi=i(Md,"pad_token_id"),Md.forEach(o),zi=i(K,` is defined in the configuration, it finds the last token that is not a padding token in each row. If
no `),cn=a(K,"CODE",{});var zd=s(cn);Ei=i(zd,"pad_token_id"),zd.forEach(o),Ci=i(K,` is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when `),hn=a(K,"CODE",{});var Ed=s(hn);xi=i(Ed,"inputs_embeds"),Ed.forEach(o),Fi=i(K," are passed instead of "),mn=a(K,"CODE",{});var Cd=s(mn);Ai=i(Cd,"input_ids"),Cd.forEach(o),Pi=i(K,`, it does the same (take the last value in
each row of the batch).`),K.forEach(o),qi=c(j),Ft=a(j,"P",{});var ma=s(Ft);Ii=i(ma,"This model inherits from "),ao=a(ma,"A",{href:!0});var xd=s(ao);Si=i(xd,"PreTrainedModel"),xd.forEach(o),ji=i(ma,`. 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.)`),ma.forEach(o),Di=c(j),At=a(j,"P",{});var pa=s(At);Ni=i(pa,"This model is also a PyTorch "),Pt=a(pa,"A",{href:!0,rel:!0});var Fd=s(Pt);Bi=i(Fd,"torch.nn.Module"),Fd.forEach(o),Ui=i(pa,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pa.forEach(o),Wi=c(j),Z=a(j,"DIV",{class:!0});var fo=s(Z);v(qt.$$.fragment,fo),Oi=c(fo),pe=a(fo,"P",{});var go=s(pe);Ji=i(go,"The "),so=a(go,"A",{href:!0});var Ad=s(so);Ri=i(Ad,"LlamaForSequenceClassification"),Ad.forEach(o),Gi=i(go," forward method, overrides the "),pn=a(go,"CODE",{});var Pd=s(pn);Vi=i(Pd,"__call__"),Pd.forEach(o),Zi=i(go," special method."),go.forEach(o),Xi=c(fo),v(Pe.$$.fragment,fo),fo.forEach(o),j.forEach(o),this.h()},h(){l(m,"name","hf:doc:metadata"),l(m,"content",JSON.stringify(Vd)),l(g,"id","llama2"),l(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(g,"href","#llama2"),l(p,"class","relative group"),l(ue,"id","overview"),l(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ue,"href","#overview"),l(ee,"class","relative group"),l(Ne,"href","https://ai.meta.com/research/publications/llama-2-open-foundation-and-fine-tuned-chat-models/"),l(Ne,"rel","nofollow"),l(Ue,"href","https://huggingface.co/models?search=llama2"),l(Ue,"rel","nofollow"),l(We,"href","https://ai.meta.com/resources/models-and-libraries/llama-downloads/"),l(We,"rel","nofollow"),l(Oe,"href","https://arxiv.org/pdf/2305.13245.pdf"),l(Oe,"rel","nofollow"),l(Ge,"href","https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/convert_llama_weights_to_hf.py"),l(Ge,"rel","nofollow"),l(He,"href","https://github.com/google/sentencepiece"),l(He,"rel","nofollow"),l(Ye,"href","https://huggingface.co/ArthurZ"),l(Ye,"rel","nofollow"),l(Qe,"href","https://huggingface.co/lysandre"),l(Qe,"rel","nofollow"),l(Ke,"href","https://github.com/EleutherAI/gpt-neox"),l(Ke,"rel","nofollow"),l(et,"href","https://github.com/facebookresearch/llama"),l(et,"rel","nofollow"),l(ge,"id","transformers.LlamaConfig"),l(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ge,"href","#transformers.LlamaConfig"),l(te,"class","relative group"),l(Rt,"href","/docs/transformers/v4.32.0/en/model_doc/llama2#transformers.LlamaModel"),l(Gt,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Vt,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ve,"id","transformers.LlamaTokenizer"),l(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ve,"href","#transformers.LlamaTokenizer"),l(ne,"class","relative group"),l(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(we,"id","transformers.LlamaTokenizerFast"),l(we,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(we,"href","#transformers.LlamaTokenizerFast"),l(ae,"class","relative group"),l(pt,"href","https://huggingface.co/docs/tokenizers/api/post-processors"),l(pt,"rel","nofollow"),l(Xt,"href","/docs/transformers/v4.32.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Yt,"href","../glossary#token-type-ids"),l(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Me,"id","transformers.LlamaModel"),l(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Me,"href","#transformers.LlamaModel"),l(ie,"class","relative group"),l(Kt,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),l(Lt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Lt,"rel","nofollow"),l(eo,"href","/docs/transformers/v4.32.0/en/model_doc/llama2#transformers.LlamaModel"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ce,"id","transformers.LlamaForCausalLM"),l(Ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ce,"href","#transformers.LlamaForCausalLM"),l(de,"class","relative group"),l(to,"href","/docs/transformers/v4.32.0/en/model_doc/llama2#transformers.LlamaForCausalLM"),l(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ae,"id","transformers.LlamaForSequenceClassification"),l(Ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Ae,"href","#transformers.LlamaForSequenceClassification"),l(me,"class","relative group"),l(no,"href","/docs/transformers/v4.32.0/en/model_doc/llama2#transformers.LlamaForSequenceClassification"),l(ao,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),l(Pt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Pt,"rel","nofollow"),l(so,"href","/docs/transformers/v4.32.0/en/model_doc/llama2#transformers.LlamaForSequenceClassification"),l(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,m),f(t,L,h),f(t,p,h),e(p,g),e(g,$),k(u,$,null),e(p,T),e(p,q),e(q,ga),f(t,bn,h),f(t,ee,h),e(ee,ue),e(ue,vo),k(De,vo,null),e(ee,_a),e(ee,ko),e(ko,va),f(t,yn,h),f(t,fe,h),e(fe,ka),e(fe,Ne),e(Ne,ba),e(fe,ya),f(t,wn,h),f(t,jt,h),e(jt,wa),f(t,Tn,h),f(t,Dt,h),e(Dt,bo),e(bo,Ta),f(t,Ln,h),f(t,Be,h),e(Be,La),e(Be,Ue),e(Ue,$a),f(t,$n,h),f(t,Nt,h),e(Nt,Ma),f(t,Mn,h),f(t,I,h),e(I,Bt),e(Bt,za),e(Bt,We),e(We,Ea),e(I,Ca),e(I,Ut),e(Ut,xa),e(Ut,Oe),e(Oe,Fa),e(I,Aa),e(I,Je),e(Je,Pa),e(Je,yo),e(yo,qa),e(Je,Ia),e(I,Sa),e(I,A),e(A,ja),e(A,wo),e(wo,Da),e(A,Na),e(A,To),e(To,Ba),e(A,Ua),e(A,Lo),e(Lo,Wa),e(A,Oa),e(A,$o),e($o,Ja),e(A,Ra),e(A,Mo),e(Mo,Ga),e(A,Va),e(I,Za),e(I,Re),e(Re,Xa),e(Re,Ge),e(Ge,Ha),e(Re,Ya),f(t,zn,h),k(Ve,t,h),f(t,En,h),f(t,Wt,h),e(Wt,zo),e(zo,Qa),f(t,Cn,h),k(Ze,t,h),f(t,xn,h),f(t,Ot,h),e(Ot,Ka),f(t,Fn,h),f(t,Jt,h),e(Jt,Xe),e(Xe,es),e(Xe,He),e(He,ts),e(Xe,os),f(t,An,h),f(t,S,h),e(S,ns),e(S,Ye),e(Ye,as),e(S,ss),e(S,Qe),e(Qe,rs),e(S,is),e(S,Ke),e(Ke,ls),e(S,ds),e(S,et),e(et,cs),e(S,hs),f(t,Pn,h),f(t,te,h),e(te,ge),e(ge,Eo),k(tt,Eo,null),e(te,ms),e(te,Co),e(Co,ps),f(t,qn,h),f(t,D,h),k(ot,D,null),e(D,us),e(D,nt),e(nt,fs),e(nt,Rt),e(Rt,gs),e(nt,_s),e(D,vs),e(D,oe),e(oe,ks),e(oe,Gt),e(Gt,bs),e(oe,ys),e(oe,Vt),e(Vt,ws),e(oe,Ts),e(D,Ls),k(_e,D,null),f(t,In,h),f(t,ne,h),e(ne,ve),e(ve,xo),k(at,xo,null),e(ne,$s),e(ne,Fo),e(Fo,Ms),f(t,Sn,h),f(t,x,h),k(st,x,null),e(x,zs),e(x,Ao),e(Ao,Es),e(x,Cs),e(x,Zt),k(rt,Zt,null),e(x,xs),e(x,ke),k(it,ke,null),e(ke,Fs),e(ke,lt),e(lt,As),e(lt,Po),e(Po,Ps),e(lt,qs),e(x,Is),e(x,U),k(dt,U,null),e(U,Ss),e(U,qo),e(qo,js),e(U,Ds),k(be,U,null),e(U,Ns),e(U,Io),e(Io,Bs),e(x,Us),e(x,ye),k(ct,ye,null),e(ye,Ws),e(ye,So),e(So,Os),f(t,jn,h),f(t,ae,h),e(ae,we),e(we,jo),k(ht,jo,null),e(ae,Js),e(ae,Do),e(Do,Rs),f(t,Dn,h),f(t,M,h),k(mt,M,null),e(M,Gs),e(M,No),e(No,Vs),e(M,Zs),e(M,Bo),e(Bo,Xs),e(M,Hs),k(Te,M,null),e(M,Ys),e(M,N),e(N,Qs),e(N,Uo),e(Uo,Ks),e(N,er),e(N,Wo),e(Wo,tr),e(N,or),e(N,Oo),e(Oo,nr),e(N,ar),e(N,pt),e(pt,sr),e(N,rr),e(M,ir),e(M,ut),e(ut,lr),e(ut,Xt),e(Xt,dr),e(ut,cr),e(M,hr),e(M,R),k(ft,R,null),e(R,mr),e(R,Jo),e(Jo,pr),e(R,ur),e(R,Ro),e(Ro,fr),e(M,gr),e(M,Le),k(gt,Le,null),e(Le,_r),e(Le,se),e(se,vr),e(se,Go),e(Go,kr),e(se,br),e(se,Vo),e(Vo,yr),e(se,wr),e(M,Tr),e(M,G),k(_t,G,null),e(G,Lr),e(G,Ht),e(Ht,$r),e(Ht,Yt),e(Yt,Mr),e(G,zr),e(G,Zo),e(Zo,Er),e(M,Cr),e(M,$e),k(vt,$e,null),e($e,xr),e($e,re),e(re,Fr),e(re,Xo),e(Xo,Ar),e(re,Pr),e(re,Ho),e(Ho,qr),e(re,Ir),e(M,Sr),e(M,Qt),k(kt,Qt,null),f(t,Nn,h),f(t,ie,h),e(ie,Me),e(Me,Yo),k(bt,Yo,null),e(ie,jr),e(ie,Qo),e(Qo,Dr),f(t,Bn,h),f(t,P,h),k(yt,P,null),e(P,Nr),e(P,wt),e(wt,Br),e(wt,Kt),e(Kt,Ur),e(wt,Wr),e(P,Or),e(P,Tt),e(Tt,Jr),e(Tt,Lt),e(Lt,Rr),e(Tt,Gr),e(P,Vr),e(P,ze),e(ze,Zr),e(ze,Ko),e(Ko,Xr),e(ze,Hr),e(ze,en),e(en,Yr),e(P,Qr),e(P,V),k($t,V,null),e(V,Kr),e(V,le),e(le,ei),e(le,eo),e(eo,ti),e(le,oi),e(le,tn),e(tn,ni),e(le,ai),e(V,si),k(Ee,V,null),f(t,Un,h),f(t,de,h),e(de,Ce),e(Ce,on),k(Mt,on,null),e(de,ri),e(de,nn),e(nn,ii),f(t,Wn,h),f(t,ce,h),k(zt,ce,null),e(ce,li),e(ce,W),k(Et,W,null),e(W,di),e(W,he),e(he,ci),e(he,to),e(to,hi),e(he,mi),e(he,an),e(an,pi),e(he,ui),e(W,fi),k(xe,W,null),e(W,gi),k(Fe,W,null),f(t,On,h),f(t,me,h),e(me,Ae),e(Ae,sn),k(Ct,sn,null),e(me,_i),e(me,rn),e(rn,vi),f(t,Jn,h),f(t,E,h),k(xt,E,null),e(E,ki),e(E,ln),e(ln,bi),e(E,yi),e(E,oo),e(oo,no),e(no,wi),e(oo,Ti),e(E,Li),e(E,B),e(B,$i),e(B,dn),e(dn,Mi),e(B,zi),e(B,cn),e(cn,Ei),e(B,Ci),e(B,hn),e(hn,xi),e(B,Fi),e(B,mn),e(mn,Ai),e(B,Pi),e(E,qi),e(E,Ft),e(Ft,Ii),e(Ft,ao),e(ao,Si),e(Ft,ji),e(E,Di),e(E,At),e(At,Ni),e(At,Pt),e(Pt,Bi),e(At,Ui),e(E,Wi),e(E,Z),k(qt,Z,null),e(Z,Oi),e(Z,pe),e(pe,Ji),e(pe,so),e(so,Ri),e(pe,Gi),e(pe,pn),e(pn,Vi),e(pe,Zi),e(Z,Xi),k(Pe,Z,null),Rn=!0},p(t,[h]){const It={};h&2&&(It.$$scope={dirty:h,ctx:t}),_e.$set(It);const un={};h&2&&(un.$$scope={dirty:h,ctx:t}),be.$set(un);const fn={};h&2&&(fn.$$scope={dirty:h,ctx:t}),Te.$set(fn);const gn={};h&2&&(gn.$$scope={dirty:h,ctx:t}),Ee.$set(gn);const St={};h&2&&(St.$$scope={dirty:h,ctx:t}),xe.$set(St);const _n={};h&2&&(_n.$$scope={dirty:h,ctx:t}),Fe.$set(_n);const vn={};h&2&&(vn.$$scope={dirty:h,ctx:t}),Pe.$set(vn)},i(t){Rn||(b(u.$$.fragment,t),b(De.$$.fragment,t),b(Ve.$$.fragment,t),b(Ze.$$.fragment,t),b(tt.$$.fragment,t),b(ot.$$.fragment,t),b(_e.$$.fragment,t),b(at.$$.fragment,t),b(st.$$.fragment,t),b(rt.$$.fragment,t),b(it.$$.fragment,t),b(dt.$$.fragment,t),b(be.$$.fragment,t),b(ct.$$.fragment,t),b(ht.$$.fragment,t),b(mt.$$.fragment,t),b(Te.$$.fragment,t),b(ft.$$.fragment,t),b(gt.$$.fragment,t),b(_t.$$.fragment,t),b(vt.$$.fragment,t),b(kt.$$.fragment,t),b(bt.$$.fragment,t),b(yt.$$.fragment,t),b($t.$$.fragment,t),b(Ee.$$.fragment,t),b(Mt.$$.fragment,t),b(zt.$$.fragment,t),b(Et.$$.fragment,t),b(xe.$$.fragment,t),b(Fe.$$.fragment,t),b(Ct.$$.fragment,t),b(xt.$$.fragment,t),b(qt.$$.fragment,t),b(Pe.$$.fragment,t),Rn=!0)},o(t){y(u.$$.fragment,t),y(De.$$.fragment,t),y(Ve.$$.fragment,t),y(Ze.$$.fragment,t),y(tt.$$.fragment,t),y(ot.$$.fragment,t),y(_e.$$.fragment,t),y(at.$$.fragment,t),y(st.$$.fragment,t),y(rt.$$.fragment,t),y(it.$$.fragment,t),y(dt.$$.fragment,t),y(be.$$.fragment,t),y(ct.$$.fragment,t),y(ht.$$.fragment,t),y(mt.$$.fragment,t),y(Te.$$.fragment,t),y(ft.$$.fragment,t),y(gt.$$.fragment,t),y(_t.$$.fragment,t),y(vt.$$.fragment,t),y(kt.$$.fragment,t),y(bt.$$.fragment,t),y(yt.$$.fragment,t),y($t.$$.fragment,t),y(Ee.$$.fragment,t),y(Mt.$$.fragment,t),y(zt.$$.fragment,t),y(Et.$$.fragment,t),y(xe.$$.fragment,t),y(Fe.$$.fragment,t),y(Ct.$$.fragment,t),y(xt.$$.fragment,t),y(qt.$$.fragment,t),y(Pe.$$.fragment,t),Rn=!1},d(t){o(m),t&&o(L),t&&o(p),w(u),t&&o(bn),t&&o(ee),w(De),t&&o(yn),t&&o(fe),t&&o(wn),t&&o(jt),t&&o(Tn),t&&o(Dt),t&&o(Ln),t&&o(Be),t&&o($n),t&&o(Nt),t&&o(Mn),t&&o(I),t&&o(zn),w(Ve,t),t&&o(En),t&&o(Wt),t&&o(Cn),w(Ze,t),t&&o(xn),t&&o(Ot),t&&o(Fn),t&&o(Jt),t&&o(An),t&&o(S),t&&o(Pn),t&&o(te),w(tt),t&&o(qn),t&&o(D),w(ot),w(_e),t&&o(In),t&&o(ne),w(at),t&&o(Sn),t&&o(x),w(st),w(rt),w(it),w(dt),w(be),w(ct),t&&o(jn),t&&o(ae),w(ht),t&&o(Dn),t&&o(M),w(mt),w(Te),w(ft),w(gt),w(_t),w(vt),w(kt),t&&o(Nn),t&&o(ie),w(bt),t&&o(Bn),t&&o(P),w(yt),w($t),w(Ee),t&&o(Un),t&&o(de),w(Mt),t&&o(Wn),t&&o(ce),w(zt),w(Et),w(xe),w(Fe),t&&o(On),t&&o(me),w(Ct),t&&o(Jn),t&&o(E),w(xt),w(qt),w(Pe)}}}const Vd={local:"llama2",sections:[{local:"overview",title:"Overview"},{local:"transformers.LlamaConfig",title:"LlamaConfig"},{local:"transformers.LlamaTokenizer",title:"LlamaTokenizer"},{local:"transformers.LlamaTokenizerFast",title:"LlamaTokenizerFast"},{local:"transformers.LlamaModel",title:"LlamaModel"},{local:"transformers.LlamaForCausalLM",title:"LlamaForCausalLM"},{local:"transformers.LlamaForSequenceClassification",title:"LlamaForSequenceClassification"}],title:"Llama2"};function Zd(F){return Dd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class tc extends qd{constructor(m){super();Id(this,m,Zd,Gd,Sd,{})}}export{tc as default,Vd as metadata};
