import{s as er,o as tr,n as N}from"../chunks/scheduler.9bc65507.js";import{S as or,i as nr,g as i,s as n,r as u,A as ar,h as l,f as s,c as a,j as $,u as h,x as m,k as L,y as t,a as d,v as f,d as g,t as _,w as b}from"../chunks/index.707bf1b6.js";import{T as $e}from"../chunks/Tip.c2ecdbf4.js";import{D as M}from"../chunks/Docstring.17db21ae.js";import{C as Le}from"../chunks/CodeBlock.54a9f38d.js";import{E as Co}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{P as Ks}from"../chunks/PipelineTag.44585822.js";import{H as E}from"../chunks/Heading.342b1fa6.js";function sr(y){let r,v;return r=new Le({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`,wrap:!1}}),{c(){u(r.$$.fragment)},l(c){h(r.$$.fragment,c)},m(c,k){f(r,c,k),v=!0},p:N,i(c){v||(g(r.$$.fragment,c),v=!0)},o(c){_(r.$$.fragment,c),v=!1},d(c){b(r,c)}}}function rr(y){let r,v="sequence pair mask has the following format:",c,k,T;return k=new Le({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 |`,wrap:!1}}),{c(){r=i("p"),r.textContent=v,c=n(),u(k.$$.fragment)},l(p){r=l(p,"P",{"data-svelte-h":!0}),m(r)!=="svelte-16klr56"&&(r.textContent=v),c=a(p),h(k.$$.fragment,p)},m(p,z){d(p,r,z),d(p,c,z),f(k,p,z),T=!0},p:N,i(p){T||(g(k.$$.fragment,p),T=!0)},o(p){_(k.$$.fragment,p),T=!1},d(p){p&&(s(r),s(c)),b(k,p)}}}function ir(y){let r,v;return r=new Le({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYW1hVG9rZW5pemVyRmFzdCUwQSUwQXRva2VuaXplciUyMCUzRCUyMExsYW1hVG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxsYW1hLXRva2VuaXplciUyMiklMEF0b2tlbml6ZXIuZW5jb2RlKCUyMkhlbGxvJTIwdGhpcyUyMGlzJTIwYSUyMHRlc3QlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = LlamaTokenizerFast.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/llama-tokenizer&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.encode(<span class="hljs-string">&quot;Hello this is a test&quot;</span>)
[<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>]`,wrap:!1}}),{c(){u(r.$$.fragment)},l(c){h(r.$$.fragment,c)},m(c,k){f(r,c,k),v=!0},p:N,i(c){v||(g(r.$$.fragment,c),v=!0)},o(c){_(r.$$.fragment,c),v=!1},d(c){b(r,c)}}}function lr(y){let r,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=v},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=v)},m(c,k){d(c,r,k)},p:N,d(c){c&&s(r)}}}function dr(y){let r,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=v},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=v)},m(c,k){d(c,r,k)},p:N,d(c){c&&s(r)}}}function cr(y){let r,v="Example:",c,k,T;return k=new Le({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMbGFtYUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBMbGFtYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJtZXRhLWxsYW1hJTJGTGxhbWEtMi03Yi1oZiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtZXRhLWxsYW1hJTJGTGxhbWEtMi03Yi1oZiUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",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(<span class="hljs-string">&quot;meta-llama/Llama-2-7b-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;meta-llama/Llama-2-7b-hf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?\\nI&#x27;m not conscious, but I can talk to you.&quot;</span>`,wrap:!1}}),{c(){r=i("p"),r.textContent=v,c=n(),u(k.$$.fragment)},l(p){r=l(p,"P",{"data-svelte-h":!0}),m(r)!=="svelte-11lpom8"&&(r.textContent=v),c=a(p),h(k.$$.fragment,p)},m(p,z){d(p,r,z),d(p,c,z),f(k,p,z),T=!0},p:N,i(p){T||(g(k.$$.fragment,p),T=!0)},o(p){_(k.$$.fragment,p),T=!1},d(p){p&&(s(r),s(c)),b(k,p)}}}function mr(y){let r,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=v},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=v)},m(c,k){d(c,r,k)},p:N,d(c){c&&s(r)}}}function pr(y){let r,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=v},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=v)},m(c,k){d(c,r,k)},p:N,d(c){c&&s(r)}}}function ur(y){let r,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=v},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=v)},m(c,k){d(c,r,k)},p:N,d(c){c&&s(r)}}}function hr(y){let r,v=`This example uses a random model as the real ones are all very big. To get proper results, you should use
openlm-research/open_llama_3b_v2 instead of afmck/testing-llama-tiny. If you get out-of-memory when loading that checkpoint, you can try
adding <code>device_map=&quot;auto&quot;</code> in the <code>from_pretrained</code> call.`;return{c(){r=i("p"),r.innerHTML=v},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-29cnl4"&&(r.innerHTML=v)},m(c,k){d(c,r,k)},p:N,d(c){c&&s(r)}}}function fr(y){let r,v="Example:",c,k,T;return k=new Le({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4TGxhbWFNb2RlbCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmFmbWNrJTJGdGVzdGluZy1sbGFtYS10aW55JTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheExsYW1hTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmFmbWNrJTJGdGVzdGluZy1sbGFtYS10aW55JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJqYXglMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxLlamaModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;afmck/testing-llama-tiny&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxLlamaModel.from_pretrained(<span class="hljs-string">&quot;afmck/testing-llama-tiny&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;jax&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){r=i("p"),r.textContent=v,c=n(),u(k.$$.fragment)},l(p){r=l(p,"P",{"data-svelte-h":!0}),m(r)!=="svelte-11lpom8"&&(r.textContent=v),c=a(p),h(k.$$.fragment,p)},m(p,z){d(p,r,z),d(p,c,z),f(k,p,z),T=!0},p:N,i(p){T||(g(k.$$.fragment,p),T=!0)},o(p){_(k.$$.fragment,p),T=!1},d(p){p&&(s(r),s(c)),b(k,p)}}}function gr(y){let r,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){r=i("p"),r.innerHTML=v},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-fincs2"&&(r.innerHTML=v)},m(c,k){d(c,r,k)},p:N,d(c){c&&s(r)}}}function _r(y){let r,v=`This example uses a random model as the real ones are all very big. To get proper results, you should use
openlm-research/open_llama_3b_v2 instead of afmck/testing-llama-tiny. If you get out-of-memory when loading that checkpoint, you can try
adding <code>device_map=&quot;auto&quot;</code> in the <code>from_pretrained</code> call.`;return{c(){r=i("p"),r.innerHTML=v},l(c){r=l(c,"P",{"data-svelte-h":!0}),m(r)!=="svelte-29cnl4"&&(r.innerHTML=v)},m(c,k){d(c,r,k)},p:N,d(c){c&&s(r)}}}function br(y){let r,v="Example:",c,k,T;return k=new Le({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4TGxhbWFGb3JDYXVzYWxMTSUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmFmbWNrJTJGdGVzdGluZy1sbGFtYS10aW55JTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheExsYW1hRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmFmbWNrJTJGdGVzdGluZy1sbGFtYS10aW55JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBJTIzJTIwcmV0cmlldmUlMjBsb2d0cyUyMGZvciUyMG5leHQlMjB0b2tlbiUwQW5leHRfdG9rZW5fbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHMlNUIlM0ElMkMlMjAtMSU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxLlamaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;afmck/testing-llama-tiny&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxLlamaForCausalLM.from_pretrained(<span class="hljs-string">&quot;afmck/testing-llama-tiny&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve logts for next token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs.logits[:, -<span class="hljs-number">1</span>]`,wrap:!1}}),{c(){r=i("p"),r.textContent=v,c=n(),u(k.$$.fragment)},l(p){r=l(p,"P",{"data-svelte-h":!0}),m(r)!=="svelte-11lpom8"&&(r.textContent=v),c=a(p),h(k.$$.fragment,p)},m(p,z){d(p,r,z),d(p,c,z),f(k,p,z),T=!0},p:N,i(p){T||(g(k.$$.fragment,p),T=!0)},o(p){_(k.$$.fragment,p),T=!1},d(p){p&&(s(r),s(c)),b(k,p)}}}function kr(y){let r,v,c,k,T,p,z,Io,xe,Da='The LLaMA model was proposed in <a href="https://arxiv.org/abs/2302.13971" rel="nofollow">LLaMA: Open and Efficient Foundation Language Models</a> by Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, Guillaume Lample. It is a collection of foundation language models ranging from 7B to 65B parameters.',Uo,Me,Va="The abstract from the paper is the following:",Ao,ze,Za="<em>We introduce LLaMA, a collection of foundation language models ranging from 7B to 65B parameters. We train our models on trillions of tokens, and show that it is possible to train state-of-the-art models using publicly available datasets exclusively, without resorting to proprietary and inaccessible datasets. In particular, LLaMA-13B outperforms GPT-3 (175B) on most benchmarks, and LLaMA-65B is competitive with the best models, Chinchilla-70B and PaLM-540B. We release all our models to the research community.</em>",Wo,Ce,Ra='This model was contributed by <a href="https://huggingface.co/zphang" rel="nofollow">zphang</a> with contributions from <a href="https://huggingface.co/BlackSamorez" rel="nofollow">BlackSamorez</a>. The code of the implementation in Hugging Face is based on GPT-NeoX <a href="https://github.com/EleutherAI/gpt-neox" rel="nofollow">here</a>. The original code of the authors can be found <a href="https://github.com/facebookresearch/llama" rel="nofollow">here</a>.',Ho,Fe,Jo,qe,Oa='<li>Weights for the LLaMA models can be obtained from by filling out <a href="https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform?usp=send_form" rel="nofollow">this form</a></li> <li>After downloading the weights, they will need to be converted to the Hugging Face Transformers format using the <a href="https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/convert_llama_weights_to_hf.py" rel="nofollow">conversion script</a>. The script can be called with the following (example) command:</li>',Go,Pe,No,je,Xa="<li>After conversion, the model and tokenizer can be loaded via:</li>",So,Ie,Bo,Ue,Qa=`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 65B model, it’s thus 130GB of RAM needed.`,Eo,Ae,Ya='<li>The LLaMA tokenizer is a BPE model based on <a href="https://github.com/google/sentencepiece" rel="nofollow">sentencepiece</a>. One quirk of sentencepiece is that when decoding a sequence, if the first token is the start of the word (e.g. “Banana”), the tokenizer does not prepend the prefix space to the string.</li>',Do,We,Ka='This model was contributed by <a href="https://huggingface.co/zphang" rel="nofollow">zphang</a> with contributions from <a href="https://huggingface.co/BlackSamorez" rel="nofollow">BlackSamorez</a>. The code of the implementation in Hugging Face is based on GPT-NeoX <a href="https://github.com/EleutherAI/gpt-neox" rel="nofollow">here</a>. The original code of the authors can be found <a href="https://github.com/facebookresearch/llama" rel="nofollow">here</a>. The Flax version of the implementation was contributed by <a href="https://huggingface.co/afmck" rel="nofollow">afmck</a> with the code in the implementation based on Hugging Face’s Flax GPT-Neo.',Vo,He,es="Based on the original LLaMA model, Meta AI has released some follow-up works:",Zo,Je,ts='<li><strong>Llama2</strong>: Llama2 is an improved version of Llama with some architectural tweaks (Grouped Query Attention), and is pre-trained on 2Trillion tokens. Refer to the documentation of Llama2 which can be found <a href="llama2">here</a>.</li>',Ro,Ge,Oo,Ne,os="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with LLaMA. If you’re interested in submitting a resource to be included here, please feel free to open a Pull Request and we’ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.",Xo,Se,Qo,Be,ns='<li>A <a href="https://colab.research.google.com/github/bigscience-workshop/petals/blob/main/examples/prompt-tuning-sst2.ipynb#scrollTo=f04ba4d2" rel="nofollow">notebook</a> on how to use prompt tuning to adapt the LLaMA model for text classification task. 🌎</li>',Yo,Ee,Ko,De,as='<li><a href="https://huggingface.co/blog/stackllama#stackllama-a-hands-on-guide-to-train-llama-with-rlhf" rel="nofollow">StackLLaMA: A hands-on guide to train LLaMA with RLHF</a>, a blog post about how to train LLaMA to answer questions on <a href="https://stackexchange.com/" rel="nofollow">Stack Exchange</a> with RLHF.</li>',en,Ve,ss="⚗️ Optimization",tn,Ze,rs='<li>A <a href="https://colab.research.google.com/drive/1SQUXq1AMZPSLD4mk3A3swUIc6Y2dclme?usp=sharing" rel="nofollow">notebook</a> on how to fine-tune LLaMA model using xturing library on GPU which has limited memory. 🌎</li>',on,Re,is="⚡️ Inference",nn,Oe,ls='<li>A <a href="https://colab.research.google.com/github/DominguesM/alpaca-lora-ptbr-7b/blob/main/notebooks/02%20-%20Evaluate.ipynb" rel="nofollow">notebook</a> on how to run the LLaMA Model using PeftModel from the 🤗 PEFT library. 🌎</li> <li>A <a href="https://colab.research.google.com/drive/1l2GiSSPbajVyp2Nk3CFT4t3uH6-5TiBe?usp=sharing" rel="nofollow">notebook</a> on how to load a PEFT adapter LLaMA model with LangChain. 🌎</li>',an,Xe,ds="🚀 Deploy",sn,Qe,cs='<li>A <a href="https://colab.research.google.com/github/lxe/simple-llama-finetuner/blob/master/Simple_LLaMA_FineTuner.ipynb#scrollTo=3PM_DilAZD8T" rel="nofollow">notebook</a> on how to fine-tune LLaMA model using LoRA method via the 🤗 PEFT library with intuitive UI. 🌎</li> <li>A <a href="https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart-foundation-models/text-generation-open-llama.ipynb" rel="nofollow">notebook</a> on how to deploy Open-LLaMA model for text generation on Amazon SageMaker. 🌎</li>',rn,Ye,ln,S,Ke,zn,Ut,ms=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.39.1/en/model_doc/llama2#transformers.LlamaModel">LlamaModel</a>. 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.`,Cn,At,ps=`Configuration objects inherit from <a href="/docs/transformers/v4.39.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.39.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Fn,se,dn,et,cn,P,tt,qn,Wt,us=`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.`,Pn,Ht,ot,jn,re,nt,In,Jt,hs=`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer <code>prepare_for_model</code> method.`,Un,D,at,An,Gt,fs="Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT",Wn,ie,Hn,Nt,gs="if token_ids_1 is None, only returns the first portion of the mask (0s).",Jn,le,st,Gn,St,_s="Save the vocabulary and special tokens file to a directory.",mn,rt,pn,w,it,Nn,Bt,bs="Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding.",Sn,Et,ks="This uses notably ByteFallback and no normalization.",Bn,de,En,Dt,vs=`If you want to change the <code>bos_token</code> or the <code>eos_token</code>, make sure to specify them when initializing the model, or
call <code>tokenizer.update_post_processor()</code> 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] (<a href="https://huggingface.co/docs/tokenizers/api/post-processors" rel="nofollow">https://huggingface.co/docs/tokenizers/api/post-processors</a>) documentation.`,Dn,Vt,ys=`This tokenizer inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,Vn,Zt,lt,Zn,ce,dt,Rn,Rt,Ts=`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer <code>prepare_for_model</code> or <code>encode_plus</code> methods.`,On,O,ct,Xn,Ot,ws=`Create the token type IDs corresponding to the sequences passed. <a href="../glossary#token-type-ids">What are token type
IDs?</a>`,Qn,Xt,$s="Should be overridden in a subclass if the model has a special way of building those.",Yn,me,mt,Kn,Qt,Ls="Updates the underlying post processor with the current <code>bos_token</code> and <code>eos_token</code>.",ea,Yt,pt,un,ut,hn,j,ht,ta,Kt,xs=`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,oa,eo,Ms=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,na,to,zs="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>LlamaDecoderLayer</code>",aa,X,ft,sa,oo,Cs='The <a href="/docs/transformers/v4.39.1/en/model_doc/llama2#transformers.LlamaModel">LlamaModel</a> forward method, overrides the <code>__call__</code> special method.',ra,pe,fn,gt,gn,oe,_t,ia,V,bt,la,no,Fs='The <a href="/docs/transformers/v4.39.1/en/model_doc/llama2#transformers.LlamaForCausalLM">LlamaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',da,ue,ca,he,_n,kt,bn,C,vt,ma,ao,qs="The LLaMa Model transformer with a sequence classification head on top (linear layer).",pa,so,Ps=`<a href="/docs/transformers/v4.39.1/en/model_doc/llama2#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,ua,ro,js=`Since it does classification on the last token, it requires to know the position of the last token. If a
<code>pad_token_id</code> is defined in the configuration, it finds the last token that is not a padding token in each row. If
no <code>pad_token_id</code> is defined, it simply takes the last value in each row of the batch. Since it cannot guess the
padding tokens when <code>inputs_embeds</code> are passed instead of <code>input_ids</code>, it does the same (take the last value in
each row of the batch).`,ha,io,Is=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,fa,lo,Us=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,ga,Q,yt,_a,co,As='The <a href="/docs/transformers/v4.39.1/en/model_doc/llama2#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',ba,fe,kn,Tt,vn,I,wt,ka,mo,Ws=`The Llama Model transformer with a span classification head on top for extractive question-answering tasks like
SQuAD (a linear layer on top of the hidden-states output to compute <code>span start logits</code> and <code>span end logits</code>).`,va,po,Hs=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ya,uo,Js=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ta,Y,$t,wa,ho,Gs='The <a href="/docs/transformers/v4.39.1/en/model_doc/llama#transformers.LlamaForQuestionAnswering">LlamaForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',$a,ge,yn,Lt,Tn,F,xt,La,fo,Ns="The bare Llama Model transformer outputting raw hidden-states without any specific head on top.",xa,go,Ss=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ma,_o,Bs=`This model is also a Flax Linen
<a href="https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html" rel="nofollow">flax.nn.Module</a> subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`,za,bo,Es="Finally, this model supports inherent JAX features such as:",Ca,ko,Ds='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',Fa,A,Mt,qa,vo,Vs="The <code>FlaxLlamaPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",Pa,_e,ja,be,Ia,ke,wn,zt,$n,q,Ct,Ua,yo,Zs="The Llama Model transformer with a language modeling head (linear layer) on top.",Aa,To,Rs=`This model inherits from <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.FlaxPreTrainedModel">FlaxPreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Wa,wo,Os=`This model is also a Flax Linen
<a href="https://flax.readthedocs.io/en/latest/_autosummary/flax.nn.module.html" rel="nofollow">flax.nn.Module</a> subclass. Use it as a
regular Flax Module and refer to the Flax documentation for all matter related to general usage and behavior.`,Ha,$o,Xs="Finally, this model supports inherent JAX features such as:",Ja,Lo,Qs='<li><a href="https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit" rel="nofollow">Just-In-Time (JIT) compilation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation" rel="nofollow">Automatic Differentiation</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap" rel="nofollow">Vectorization</a></li> <li><a href="https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap" rel="nofollow">Parallelization</a></li>',Ga,W,Ft,Na,xo,Ys="The <code>FlaxLlamaPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",Sa,ve,Ba,ye,Ea,Te,Ln,Fo,xn;return T=new E({props:{title:"LLaMA",local:"llama",headingTag:"h1"}}),z=new E({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Fe=new E({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),Pe=new Le({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`,wrap:!1}}),Ie=new Le({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>)`,wrap:!1}}),Ge=new E({props:{title:"Resources",local:"resources",headingTag:"h2"}}),Se=new Ks({props:{pipeline:"text-classification"}}),Ee=new Ks({props:{pipeline:"question-answering"}}),Ye=new E({props:{title:"LlamaConfig",local:"transformers.LlamaConfig",headingTag:"h2"}}),Ke=new M({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_theta",val:" = 10000.0"},{name:"rope_scaling",val:" = None"},{name:"attention_bias",val:" = False"},{name:"attention_dropout",val:" = 0.0"},{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.39.1/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 decoder.`,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 decoder.`,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.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. Llama 1 supports up to 2048 tokens,
Llama 2 up to 4096, CodeLlama up to 16384.`,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-06) &#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.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.LlamaConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.LlamaConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.LlamaConfig.pretraining_tp",description:`<strong>pretraining_tp</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to <a href="https://huggingface.co/docs/transformers/main/perf_train_gpu_many#tensor-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.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.LlamaConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 10000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.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 a 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.`,name:"rope_scaling"},{anchor:"transformers.LlamaConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, defaults to <code>False</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in the query, key, value and output projection layers during self-attention.`,name:"attention_bias"},{anchor:"transformers.LlamaConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/configuration_llama.py#L31"}}),se=new Co({props:{anchor:"transformers.LlamaConfig.example",$$slots:{default:[sr]},$$scope:{ctx:y}}}),et=new E({props:{title:"LlamaTokenizer",local:"transformers.LlamaTokenizer",headingTag:"h2"}}),tt=new M({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:": Optional = 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:" = False"},{name:"spaces_between_special_tokens",val:" = False"},{name:"legacy",val:" = None"},{name:"add_prefix_space",val:" = True"},{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.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</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"},{anchor:"transformers.LlamaTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</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.LlamaTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.LlamaTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation.`,name:"pad_token"},{anchor:"transformers.LlamaTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>Dict[str, Any]</code>, <code>Optional</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.LlamaTokenizer.add_bos_token",description:`<strong>add_bos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add an <code>bos_token</code> at the start of sequences.`,name:"add_bos_token"},{anchor:"transformers.LlamaTokenizer.add_eos_token",description:`<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an <code>eos_token</code> at the end of sequences.`,name:"add_eos_token"},{anchor:"transformers.LlamaTokenizer.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to cleanup spaces after decoding, cleanup consists in removing potential artifacts like
extra spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.LlamaTokenizer.use_default_system_prompt",description:`<strong>use_default_system_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the default system prompt for Llama should be used.`,name:"use_default_system_prompt"},{anchor:"transformers.LlamaTokenizer.spaces_between_special_tokens",description:`<strong>spaces_between_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add spaces between special tokens.`,name:"spaces_between_special_tokens"},{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.39.1/src/transformers/models/llama/tokenization_llama.py#L66"}}),ot=new M({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.39.1/src/transformers/models/llama/tokenization_llama.py#L343"}}),nt=new M({props:{name:"get_special_tokens_mask",anchor:"transformers.LlamaTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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.39.1/src/transformers/models/llama/tokenization_llama.py#L354",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),at=new M({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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.39.1/src/transformers/models/llama/tokenization_llama.py#L391",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),ie=new Co({props:{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[rr]},$$scope:{ctx:y}}}),st=new M({props:{name:"save_vocabulary",anchor:"transformers.LlamaTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:""},{name:"filename_prefix",val:": Optional = 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.39.1/src/transformers/models/llama/tokenization_llama.py#L316",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Paths to the files saved.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Tuple(str)</code></p>
`}}),rt=new E({props:{title:"LlamaTokenizerFast",local:"transformers.LlamaTokenizerFast",headingTag:"h2"}}),it=new M({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:" = False"},{name:"add_prefix_space",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>, <em>optional</em>) &#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>, <em>optional</em>) &#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>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to cleanup spaces after decoding, cleanup consists in removing potential artifacts like
extra spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.LlamaTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</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"},{anchor:"transformers.LlamaTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</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> or <code>tokenizers.AddedToken</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.add_bos_token",description:`<strong>add_bos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add an <code>bos_token</code> at the start of sequences.`,name:"add_bos_token"},{anchor:"transformers.LlamaTokenizerFast.add_eos_token",description:`<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an <code>eos_token</code> at the end of sequences.`,name:"add_eos_token"},{anchor:"transformers.LlamaTokenizerFast.use_default_system_prompt",description:`<strong>use_default_system_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the default system prompt for Llama should be used.`,name:"use_default_system_prompt"},{anchor:"transformers.LlamaTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the tokenizer should automatically add a prefix space`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/tokenization_llama_fast.py#L57"}}),de=new Co({props:{anchor:"transformers.LlamaTokenizerFast.example",$$slots:{default:[ir]},$$scope:{ctx:y}}}),lt=new M({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LlamaTokenizerFast.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.39.1/src/transformers/models/llama/tokenization_llama_fast.py#L281"}}),dt=new M({props:{name:"get_special_tokens_mask",anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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.39.1/src/transformers/tokenization_utils_base.py#L3841",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>1 for a special token, 0 for a sequence token.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A list of integers in the range [0, 1]</p>
`}}),ct=new M({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = 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.39.1/src/transformers/tokenization_utils_base.py#L3371",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The token type ids.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),mt=new M({props:{name:"update_post_processor",anchor:"transformers.LlamaTokenizerFast.update_post_processor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/tokenization_llama_fast.py#L155"}}),pt=new M({props:{name:"save_vocabulary",anchor:"transformers.LlamaTokenizerFast.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/tokenization_llama_fast.py#L199"}}),ut=new E({props:{title:"LlamaModel",local:"transformers.LlamaModel",headingTag:"h2"}}),ht=new M({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.39.1/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.39.1/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.39.1/src/transformers/models/llama/modeling_llama.py#L906"}}),ft=new M({props:{name:"forward",anchor:"transformers.LlamaModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.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>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/v4.39.1/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.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.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/modeling_llama.py#L939"}}),pe=new $e({props:{$$slots:{default:[lr]},$$scope:{ctx:y}}}),gt=new E({props:{title:"LlamaForCausalLM",local:"transformers.LlamaForCausalLM",headingTag:"h2"}}),_t=new M({props:{name:"class transformers.LlamaForCausalLM",anchor:"transformers.LlamaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/modeling_llama.py#L1118"}}),bt=new M({props:{name:"forward",anchor:"transformers.LlamaForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.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>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/v4.39.1/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.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.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaForCausalLM.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/modeling_llama.py#L1148",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.39.1/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.39.1/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) — Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ue=new $e({props:{$$slots:{default:[dr]},$$scope:{ctx:y}}}),he=new Co({props:{anchor:"transformers.LlamaForCausalLM.forward.example",$$slots:{default:[cr]},$$scope:{ctx:y}}}),kt=new E({props:{title:"LlamaForSequenceClassification",local:"transformers.LlamaForSequenceClassification",headingTag:"h2"}}),vt=new M({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.39.1/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.39.1/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.39.1/src/transformers/models/llama/modeling_llama.py#L1335"}}),yt=new M({props:{name:"forward",anchor:"transformers.LlamaForSequenceClassification.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.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>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/v4.39.1/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.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.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaForSequenceClassification.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.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.39.1/src/transformers/models/llama/modeling_llama.py#L1366"}}),fe=new $e({props:{$$slots:{default:[mr]},$$scope:{ctx:y}}}),Tt=new E({props:{title:"LlamaForQuestionAnswering",local:"transformers.LlamaForQuestionAnswering",headingTag:"h2"}}),wt=new M({props:{name:"class transformers.LlamaForQuestionAnswering",anchor:"transformers.LlamaForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LlamaForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/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.39.1/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.39.1/src/transformers/models/llama/modeling_llama.py#L1458"}}),$t=new M({props:{name:"forward",anchor:"transformers.LlamaForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Optional = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"start_positions",val:": Optional = None"},{name:"end_positions",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LlamaForQuestionAnswering.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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/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.LlamaForQuestionAnswering.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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForQuestionAnswering.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.LlamaForQuestionAnswering.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/v4.39.1/en/internal/generation_utils#transformers.Cache">Cache</a> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForQuestionAnswering.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.LlamaForQuestionAnswering.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.LlamaForQuestionAnswering.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.LlamaForQuestionAnswering.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.LlamaForQuestionAnswering.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.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaForQuestionAnswering.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.LlamaForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.LlamaForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/modeling_llama.py#L1483"}}),ge=new $e({props:{$$slots:{default:[pr]},$$scope:{ctx:y}}}),Lt=new E({props:{title:"FlaxLlamaModel",local:"transformers.FlaxLlamaModel",headingTag:"h2"}}),xt=new M({props:{name:"class transformers.FlaxLlamaModel",anchor:"transformers.FlaxLlamaModel",parameters:[{name:"config",val:": LlamaConfig"},{name:"input_shape",val:": Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxLlamaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/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.39.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxLlamaModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code>, or
<code>jax.numpy.bfloat16</code>.</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/modeling_flax_llama.py#L634"}}),Mt=new M({props:{name:"__call__",anchor:"transformers.FlaxLlamaModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.FlaxLlamaModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, input_ids_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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/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.FlaxLlamaModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/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.FlaxLlamaModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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.FlaxLlamaModel.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxLlamaModel.__call__.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.FlaxLlamaModel.__call__.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.FlaxLlamaModel.__call__.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.39.1/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.39.1/src/transformers/models/llama/modeling_flax_llama.py#L458",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</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.39.1/en/model_doc/llama2#transformers.LlamaConfig"
>LlamaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutput"
>transformers.modeling_flax_outputs.FlaxBaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new $e({props:{$$slots:{default:[ur]},$$scope:{ctx:y}}}),be=new $e({props:{warning:!0,$$slots:{default:[hr]},$$scope:{ctx:y}}}),ke=new Co({props:{anchor:"transformers.FlaxLlamaModel.__call__.example",$$slots:{default:[fr]},$$scope:{ctx:y}}}),zt=new E({props:{title:"FlaxLlamaForCausalLM",local:"transformers.FlaxLlamaForCausalLM",headingTag:"h2"}}),Ct=new M({props:{name:"class transformers.FlaxLlamaForCausalLM",anchor:"transformers.FlaxLlamaForCausalLM",parameters:[{name:"config",val:": LlamaConfig"},{name:"input_shape",val:": Tuple = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxLlamaForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.39.1/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.39.1/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxLlamaForCausalLM.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code>, or
<code>jax.numpy.bfloat16</code>.</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.39.1/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/llama/modeling_flax_llama.py#L695"}}),Ft=new M({props:{name:"__call__",anchor:"transformers.FlaxLlamaForCausalLM.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"past_key_values",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.FlaxLlamaForCausalLM.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, input_ids_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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/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.FlaxLlamaForCausalLM.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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.39.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.39.1/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.FlaxLlamaForCausalLM.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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.FlaxLlamaForCausalLM.__call__.past_key_values",description:`<strong>past_key_values</strong> (<code>Dict[str, np.ndarray]</code>, <em>optional</em>, returned by <code>init_cache</code> or when passing previous <code>past_key_values</code>) &#x2014;
Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
auto-regressive decoding. Pre-computed key and value hidden-states are of shape <em>[batch_size, max_length]</em>.`,name:"past_key_values"},{anchor:"transformers.FlaxLlamaForCausalLM.__call__.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.FlaxLlamaForCausalLM.__call__.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.FlaxLlamaForCausalLM.__call__.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.39.1/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.39.1/src/transformers/models/llama/modeling_flax_llama.py#L458",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</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.39.1/en/model_doc/llama2#transformers.LlamaConfig"
>LlamaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/v4.39.1/en/main_classes/output#transformers.modeling_flax_outputs.FlaxMaskedLMOutput"
>transformers.modeling_flax_outputs.FlaxMaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new $e({props:{$$slots:{default:[gr]},$$scope:{ctx:y}}}),ye=new $e({props:{warning:!0,$$slots:{default:[_r]},$$scope:{ctx:y}}}),Te=new Co({props:{anchor:"transformers.FlaxLlamaForCausalLM.__call__.example",$$slots:{default:[br]},$$scope:{ctx:y}}}),{c(){r=i("meta"),v=n(),c=i("p"),k=n(),u(T.$$.fragment),p=n(),u(z.$$.fragment),Io=n(),xe=i("p"),xe.innerHTML=Da,Uo=n(),Me=i("p"),Me.textContent=Va,Ao=n(),ze=i("p"),ze.innerHTML=Za,Wo=n(),Ce=i("p"),Ce.innerHTML=Ra,Ho=n(),u(Fe.$$.fragment),Jo=n(),qe=i("ul"),qe.innerHTML=Oa,Go=n(),u(Pe.$$.fragment),No=n(),je=i("ul"),je.innerHTML=Xa,So=n(),u(Ie.$$.fragment),Bo=n(),Ue=i("p"),Ue.textContent=Qa,Eo=n(),Ae=i("ul"),Ae.innerHTML=Ya,Do=n(),We=i("p"),We.innerHTML=Ka,Vo=n(),He=i("p"),He.textContent=es,Zo=n(),Je=i("ul"),Je.innerHTML=ts,Ro=n(),u(Ge.$$.fragment),Oo=n(),Ne=i("p"),Ne.textContent=os,Xo=n(),u(Se.$$.fragment),Qo=n(),Be=i("ul"),Be.innerHTML=ns,Yo=n(),u(Ee.$$.fragment),Ko=n(),De=i("ul"),De.innerHTML=as,en=n(),Ve=i("p"),Ve.textContent=ss,tn=n(),Ze=i("ul"),Ze.innerHTML=rs,on=n(),Re=i("p"),Re.textContent=is,nn=n(),Oe=i("ul"),Oe.innerHTML=ls,an=n(),Xe=i("p"),Xe.textContent=ds,sn=n(),Qe=i("ul"),Qe.innerHTML=cs,rn=n(),u(Ye.$$.fragment),ln=n(),S=i("div"),u(Ke.$$.fragment),zn=n(),Ut=i("p"),Ut.innerHTML=ms,Cn=n(),At=i("p"),At.innerHTML=ps,Fn=n(),u(se.$$.fragment),dn=n(),u(et.$$.fragment),cn=n(),P=i("div"),u(tt.$$.fragment),qn=n(),Wt=i("p"),Wt.textContent=us,Pn=n(),Ht=i("div"),u(ot.$$.fragment),jn=n(),re=i("div"),u(nt.$$.fragment),In=n(),Jt=i("p"),Jt.innerHTML=hs,Un=n(),D=i("div"),u(at.$$.fragment),An=n(),Gt=i("p"),Gt.textContent=fs,Wn=n(),u(ie.$$.fragment),Hn=n(),Nt=i("p"),Nt.textContent=gs,Jn=n(),le=i("div"),u(st.$$.fragment),Gn=n(),St=i("p"),St.textContent=_s,mn=n(),u(rt.$$.fragment),pn=n(),w=i("div"),u(it.$$.fragment),Nn=n(),Bt=i("p"),Bt.textContent=bs,Sn=n(),Et=i("p"),Et.textContent=ks,Bn=n(),u(de.$$.fragment),En=n(),Dt=i("p"),Dt.innerHTML=vs,Dn=n(),Vt=i("p"),Vt.innerHTML=ys,Vn=n(),Zt=i("div"),u(lt.$$.fragment),Zn=n(),ce=i("div"),u(dt.$$.fragment),Rn=n(),Rt=i("p"),Rt.innerHTML=Ts,On=n(),O=i("div"),u(ct.$$.fragment),Xn=n(),Ot=i("p"),Ot.innerHTML=ws,Qn=n(),Xt=i("p"),Xt.textContent=$s,Yn=n(),me=i("div"),u(mt.$$.fragment),Kn=n(),Qt=i("p"),Qt.innerHTML=Ls,ea=n(),Yt=i("div"),u(pt.$$.fragment),un=n(),u(ut.$$.fragment),hn=n(),j=i("div"),u(ht.$$.fragment),ta=n(),Kt=i("p"),Kt.innerHTML=xs,oa=n(),eo=i("p"),eo.innerHTML=Ms,na=n(),to=i("p"),to.innerHTML=zs,aa=n(),X=i("div"),u(ft.$$.fragment),sa=n(),oo=i("p"),oo.innerHTML=Cs,ra=n(),u(pe.$$.fragment),fn=n(),u(gt.$$.fragment),gn=n(),oe=i("div"),u(_t.$$.fragment),ia=n(),V=i("div"),u(bt.$$.fragment),la=n(),no=i("p"),no.innerHTML=Fs,da=n(),u(ue.$$.fragment),ca=n(),u(he.$$.fragment),_n=n(),u(kt.$$.fragment),bn=n(),C=i("div"),u(vt.$$.fragment),ma=n(),ao=i("p"),ao.textContent=qs,pa=n(),so=i("p"),so.innerHTML=Ps,ua=n(),ro=i("p"),ro.innerHTML=js,ha=n(),io=i("p"),io.innerHTML=Is,fa=n(),lo=i("p"),lo.innerHTML=Us,ga=n(),Q=i("div"),u(yt.$$.fragment),_a=n(),co=i("p"),co.innerHTML=As,ba=n(),u(fe.$$.fragment),kn=n(),u(Tt.$$.fragment),vn=n(),I=i("div"),u(wt.$$.fragment),ka=n(),mo=i("p"),mo.innerHTML=Ws,va=n(),po=i("p"),po.innerHTML=Hs,ya=n(),uo=i("p"),uo.innerHTML=Js,Ta=n(),Y=i("div"),u($t.$$.fragment),wa=n(),ho=i("p"),ho.innerHTML=Gs,$a=n(),u(ge.$$.fragment),yn=n(),u(Lt.$$.fragment),Tn=n(),F=i("div"),u(xt.$$.fragment),La=n(),fo=i("p"),fo.textContent=Ns,xa=n(),go=i("p"),go.innerHTML=Ss,Ma=n(),_o=i("p"),_o.innerHTML=Bs,za=n(),bo=i("p"),bo.textContent=Es,Ca=n(),ko=i("ul"),ko.innerHTML=Ds,Fa=n(),A=i("div"),u(Mt.$$.fragment),qa=n(),vo=i("p"),vo.innerHTML=Vs,Pa=n(),u(_e.$$.fragment),ja=n(),u(be.$$.fragment),Ia=n(),u(ke.$$.fragment),wn=n(),u(zt.$$.fragment),$n=n(),q=i("div"),u(Ct.$$.fragment),Ua=n(),yo=i("p"),yo.textContent=Zs,Aa=n(),To=i("p"),To.innerHTML=Rs,Wa=n(),wo=i("p"),wo.innerHTML=Os,Ha=n(),$o=i("p"),$o.textContent=Xs,Ja=n(),Lo=i("ul"),Lo.innerHTML=Qs,Ga=n(),W=i("div"),u(Ft.$$.fragment),Na=n(),xo=i("p"),xo.innerHTML=Ys,Sa=n(),u(ve.$$.fragment),Ba=n(),u(ye.$$.fragment),Ea=n(),u(Te.$$.fragment),Ln=n(),Fo=i("p"),this.h()},l(e){const o=ar("svelte-u9bgzb",document.head);r=l(o,"META",{name:!0,content:!0}),o.forEach(s),v=a(e),c=l(e,"P",{}),$(c).forEach(s),k=a(e),h(T.$$.fragment,e),p=a(e),h(z.$$.fragment,e),Io=a(e),xe=l(e,"P",{"data-svelte-h":!0}),m(xe)!=="svelte-1mfapnf"&&(xe.innerHTML=Da),Uo=a(e),Me=l(e,"P",{"data-svelte-h":!0}),m(Me)!=="svelte-vfdo9a"&&(Me.textContent=Va),Ao=a(e),ze=l(e,"P",{"data-svelte-h":!0}),m(ze)!=="svelte-sl0nly"&&(ze.innerHTML=Za),Wo=a(e),Ce=l(e,"P",{"data-svelte-h":!0}),m(Ce)!=="svelte-1ivivso"&&(Ce.innerHTML=Ra),Ho=a(e),h(Fe.$$.fragment,e),Jo=a(e),qe=l(e,"UL",{"data-svelte-h":!0}),m(qe)!=="svelte-oqmv1y"&&(qe.innerHTML=Oa),Go=a(e),h(Pe.$$.fragment,e),No=a(e),je=l(e,"UL",{"data-svelte-h":!0}),m(je)!=="svelte-yjbkch"&&(je.innerHTML=Xa),So=a(e),h(Ie.$$.fragment,e),Bo=a(e),Ue=l(e,"P",{"data-svelte-h":!0}),m(Ue)!=="svelte-3h7jh3"&&(Ue.textContent=Qa),Eo=a(e),Ae=l(e,"UL",{"data-svelte-h":!0}),m(Ae)!=="svelte-1xmggxn"&&(Ae.innerHTML=Ya),Do=a(e),We=l(e,"P",{"data-svelte-h":!0}),m(We)!=="svelte-1s478nn"&&(We.innerHTML=Ka),Vo=a(e),He=l(e,"P",{"data-svelte-h":!0}),m(He)!=="svelte-a39vkx"&&(He.textContent=es),Zo=a(e),Je=l(e,"UL",{"data-svelte-h":!0}),m(Je)!=="svelte-y8u21a"&&(Je.innerHTML=ts),Ro=a(e),h(Ge.$$.fragment,e),Oo=a(e),Ne=l(e,"P",{"data-svelte-h":!0}),m(Ne)!=="svelte-h1kz0m"&&(Ne.textContent=os),Xo=a(e),h(Se.$$.fragment,e),Qo=a(e),Be=l(e,"UL",{"data-svelte-h":!0}),m(Be)!=="svelte-dp296g"&&(Be.innerHTML=ns),Yo=a(e),h(Ee.$$.fragment,e),Ko=a(e),De=l(e,"UL",{"data-svelte-h":!0}),m(De)!=="svelte-ab7kge"&&(De.innerHTML=as),en=a(e),Ve=l(e,"P",{"data-svelte-h":!0}),m(Ve)!=="svelte-liq2q7"&&(Ve.textContent=ss),tn=a(e),Ze=l(e,"UL",{"data-svelte-h":!0}),m(Ze)!=="svelte-10a5770"&&(Ze.innerHTML=rs),on=a(e),Re=l(e,"P",{"data-svelte-h":!0}),m(Re)!=="svelte-1wntqpp"&&(Re.textContent=is),nn=a(e),Oe=l(e,"UL",{"data-svelte-h":!0}),m(Oe)!=="svelte-1t43wyu"&&(Oe.innerHTML=ls),an=a(e),Xe=l(e,"P",{"data-svelte-h":!0}),m(Xe)!=="svelte-lk14e4"&&(Xe.textContent=ds),sn=a(e),Qe=l(e,"UL",{"data-svelte-h":!0}),m(Qe)!=="svelte-162yhfz"&&(Qe.innerHTML=cs),rn=a(e),h(Ye.$$.fragment,e),ln=a(e),S=l(e,"DIV",{class:!0});var Z=$(S);h(Ke.$$.fragment,Z),zn=a(Z),Ut=l(Z,"P",{"data-svelte-h":!0}),m(Ut)!=="svelte-1qkkvfi"&&(Ut.innerHTML=ms),Cn=a(Z),At=l(Z,"P",{"data-svelte-h":!0}),m(At)!=="svelte-1nrxf0l"&&(At.innerHTML=ps),Fn=a(Z),h(se.$$.fragment,Z),Z.forEach(s),dn=a(e),h(et.$$.fragment,e),cn=a(e),P=l(e,"DIV",{class:!0});var U=$(P);h(tt.$$.fragment,U),qn=a(U),Wt=l(U,"P",{"data-svelte-h":!0}),m(Wt)!=="svelte-qfiu5a"&&(Wt.textContent=us),Pn=a(U),Ht=l(U,"DIV",{class:!0});var qo=$(Ht);h(ot.$$.fragment,qo),qo.forEach(s),jn=a(U),re=l(U,"DIV",{class:!0});var qt=$(re);h(nt.$$.fragment,qt),In=a(qt),Jt=l(qt,"P",{"data-svelte-h":!0}),m(Jt)!=="svelte-1f4f5kp"&&(Jt.innerHTML=hs),qt.forEach(s),Un=a(U),D=l(U,"DIV",{class:!0});var R=$(D);h(at.$$.fragment,R),An=a(R),Gt=l(R,"P",{"data-svelte-h":!0}),m(Gt)!=="svelte-13bfd60"&&(Gt.textContent=fs),Wn=a(R),h(ie.$$.fragment,R),Hn=a(R),Nt=l(R,"P",{"data-svelte-h":!0}),m(Nt)!=="svelte-wtrslu"&&(Nt.textContent=gs),R.forEach(s),Jn=a(U),le=l(U,"DIV",{class:!0});var Pt=$(le);h(st.$$.fragment,Pt),Gn=a(Pt),St=l(Pt,"P",{"data-svelte-h":!0}),m(St)!=="svelte-1slb66l"&&(St.textContent=_s),Pt.forEach(s),U.forEach(s),mn=a(e),h(rt.$$.fragment,e),pn=a(e),w=l(e,"DIV",{class:!0});var x=$(w);h(it.$$.fragment,x),Nn=a(x),Bt=l(x,"P",{"data-svelte-h":!0}),m(Bt)!=="svelte-15tdcz8"&&(Bt.textContent=bs),Sn=a(x),Et=l(x,"P",{"data-svelte-h":!0}),m(Et)!=="svelte-llhmpa"&&(Et.textContent=ks),Bn=a(x),h(de.$$.fragment,x),En=a(x),Dt=l(x,"P",{"data-svelte-h":!0}),m(Dt)!=="svelte-cnb6q1"&&(Dt.innerHTML=vs),Dn=a(x),Vt=l(x,"P",{"data-svelte-h":!0}),m(Vt)!=="svelte-1gpq966"&&(Vt.innerHTML=ys),Vn=a(x),Zt=l(x,"DIV",{class:!0});var Po=$(Zt);h(lt.$$.fragment,Po),Po.forEach(s),Zn=a(x),ce=l(x,"DIV",{class:!0});var jt=$(ce);h(dt.$$.fragment,jt),Rn=a(jt),Rt=l(jt,"P",{"data-svelte-h":!0}),m(Rt)!=="svelte-1wmjg8a"&&(Rt.innerHTML=Ts),jt.forEach(s),On=a(x),O=l(x,"DIV",{class:!0});var ne=$(O);h(ct.$$.fragment,ne),Xn=a(ne),Ot=l(ne,"P",{"data-svelte-h":!0}),m(Ot)!=="svelte-zj1vf1"&&(Ot.innerHTML=ws),Qn=a(ne),Xt=l(ne,"P",{"data-svelte-h":!0}),m(Xt)!=="svelte-9vptpw"&&(Xt.textContent=$s),ne.forEach(s),Yn=a(x),me=l(x,"DIV",{class:!0});var It=$(me);h(mt.$$.fragment,It),Kn=a(It),Qt=l(It,"P",{"data-svelte-h":!0}),m(Qt)!=="svelte-nfci2w"&&(Qt.innerHTML=Ls),It.forEach(s),ea=a(x),Yt=l(x,"DIV",{class:!0});var jo=$(Yt);h(pt.$$.fragment,jo),jo.forEach(s),x.forEach(s),un=a(e),h(ut.$$.fragment,e),hn=a(e),j=l(e,"DIV",{class:!0});var B=$(j);h(ht.$$.fragment,B),ta=a(B),Kt=l(B,"P",{"data-svelte-h":!0}),m(Kt)!=="svelte-dmnf7z"&&(Kt.innerHTML=xs),oa=a(B),eo=l(B,"P",{"data-svelte-h":!0}),m(eo)!=="svelte-hswkmf"&&(eo.innerHTML=Ms),na=a(B),to=l(B,"P",{"data-svelte-h":!0}),m(to)!=="svelte-eom0yk"&&(to.innerHTML=zs),aa=a(B),X=l(B,"DIV",{class:!0});var ae=$(X);h(ft.$$.fragment,ae),sa=a(ae),oo=l(ae,"P",{"data-svelte-h":!0}),m(oo)!=="svelte-kpd818"&&(oo.innerHTML=Cs),ra=a(ae),h(pe.$$.fragment,ae),ae.forEach(s),B.forEach(s),fn=a(e),h(gt.$$.fragment,e),gn=a(e),oe=l(e,"DIV",{class:!0});var Mn=$(oe);h(_t.$$.fragment,Mn),ia=a(Mn),V=l(Mn,"DIV",{class:!0});var we=$(V);h(bt.$$.fragment,we),la=a(we),no=l(we,"P",{"data-svelte-h":!0}),m(no)!=="svelte-1dysya4"&&(no.innerHTML=Fs),da=a(we),h(ue.$$.fragment,we),ca=a(we),h(he.$$.fragment,we),we.forEach(s),Mn.forEach(s),_n=a(e),h(kt.$$.fragment,e),bn=a(e),C=l(e,"DIV",{class:!0});var H=$(C);h(vt.$$.fragment,H),ma=a(H),ao=l(H,"P",{"data-svelte-h":!0}),m(ao)!=="svelte-62must"&&(ao.textContent=qs),pa=a(H),so=l(H,"P",{"data-svelte-h":!0}),m(so)!=="svelte-a43fg7"&&(so.innerHTML=Ps),ua=a(H),ro=l(H,"P",{"data-svelte-h":!0}),m(ro)!=="svelte-10ugs3m"&&(ro.innerHTML=js),ha=a(H),io=l(H,"P",{"data-svelte-h":!0}),m(io)!=="svelte-1t3ln5c"&&(io.innerHTML=Is),fa=a(H),lo=l(H,"P",{"data-svelte-h":!0}),m(lo)!=="svelte-hswkmf"&&(lo.innerHTML=Us),ga=a(H),Q=l(H,"DIV",{class:!0});var Mo=$(Q);h(yt.$$.fragment,Mo),_a=a(Mo),co=l(Mo,"P",{"data-svelte-h":!0}),m(co)!=="svelte-bg2dxm"&&(co.innerHTML=As),ba=a(Mo),h(fe.$$.fragment,Mo),Mo.forEach(s),H.forEach(s),kn=a(e),h(Tt.$$.fragment,e),vn=a(e),I=l(e,"DIV",{class:!0});var K=$(I);h(wt.$$.fragment,K),ka=a(K),mo=l(K,"P",{"data-svelte-h":!0}),m(mo)!=="svelte-2ba709"&&(mo.innerHTML=Ws),va=a(K),po=l(K,"P",{"data-svelte-h":!0}),m(po)!=="svelte-1t3ln5c"&&(po.innerHTML=Hs),ya=a(K),uo=l(K,"P",{"data-svelte-h":!0}),m(uo)!=="svelte-hswkmf"&&(uo.innerHTML=Js),Ta=a(K),Y=l(K,"DIV",{class:!0});var zo=$(Y);h($t.$$.fragment,zo),wa=a(zo),ho=l(zo,"P",{"data-svelte-h":!0}),m(ho)!=="svelte-7cveey"&&(ho.innerHTML=Gs),$a=a(zo),h(ge.$$.fragment,zo),zo.forEach(s),K.forEach(s),yn=a(e),h(Lt.$$.fragment,e),Tn=a(e),F=l(e,"DIV",{class:!0});var J=$(F);h(xt.$$.fragment,J),La=a(J),fo=l(J,"P",{"data-svelte-h":!0}),m(fo)!=="svelte-1g8y7nc"&&(fo.textContent=Ns),xa=a(J),go=l(J,"P",{"data-svelte-h":!0}),m(go)!=="svelte-1wgv4kc"&&(go.innerHTML=Ss),Ma=a(J),_o=l(J,"P",{"data-svelte-h":!0}),m(_o)!=="svelte-idybz1"&&(_o.innerHTML=Bs),za=a(J),bo=l(J,"P",{"data-svelte-h":!0}),m(bo)!=="svelte-1pplc4a"&&(bo.textContent=Es),Ca=a(J),ko=l(J,"UL",{"data-svelte-h":!0}),m(ko)!=="svelte-1w7z84m"&&(ko.innerHTML=Ds),Fa=a(J),A=l(J,"DIV",{class:!0});var ee=$(A);h(Mt.$$.fragment,ee),qa=a(ee),vo=l(ee,"P",{"data-svelte-h":!0}),m(vo)!=="svelte-9bmwma"&&(vo.innerHTML=Vs),Pa=a(ee),h(_e.$$.fragment,ee),ja=a(ee),h(be.$$.fragment,ee),Ia=a(ee),h(ke.$$.fragment,ee),ee.forEach(s),J.forEach(s),wn=a(e),h(zt.$$.fragment,e),$n=a(e),q=l(e,"DIV",{class:!0});var G=$(q);h(Ct.$$.fragment,G),Ua=a(G),yo=l(G,"P",{"data-svelte-h":!0}),m(yo)!=="svelte-1as0j1x"&&(yo.textContent=Zs),Aa=a(G),To=l(G,"P",{"data-svelte-h":!0}),m(To)!=="svelte-1wgv4kc"&&(To.innerHTML=Rs),Wa=a(G),wo=l(G,"P",{"data-svelte-h":!0}),m(wo)!=="svelte-idybz1"&&(wo.innerHTML=Os),Ha=a(G),$o=l(G,"P",{"data-svelte-h":!0}),m($o)!=="svelte-1pplc4a"&&($o.textContent=Xs),Ja=a(G),Lo=l(G,"UL",{"data-svelte-h":!0}),m(Lo)!=="svelte-1w7z84m"&&(Lo.innerHTML=Qs),Ga=a(G),W=l(G,"DIV",{class:!0});var te=$(W);h(Ft.$$.fragment,te),Na=a(te),xo=l(te,"P",{"data-svelte-h":!0}),m(xo)!=="svelte-9bmwma"&&(xo.innerHTML=Ys),Sa=a(te),h(ve.$$.fragment,te),Ba=a(te),h(ye.$$.fragment,te),Ea=a(te),h(Te.$$.fragment,te),te.forEach(s),G.forEach(s),Ln=a(e),Fo=l(e,"P",{}),$(Fo).forEach(s),this.h()},h(){L(r,"name","hf:doc:metadata"),L(r,"content",vr),L(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(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(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(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(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(O,"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,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(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(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){t(document.head,r),d(e,v,o),d(e,c,o),d(e,k,o),f(T,e,o),d(e,p,o),f(z,e,o),d(e,Io,o),d(e,xe,o),d(e,Uo,o),d(e,Me,o),d(e,Ao,o),d(e,ze,o),d(e,Wo,o),d(e,Ce,o),d(e,Ho,o),f(Fe,e,o),d(e,Jo,o),d(e,qe,o),d(e,Go,o),f(Pe,e,o),d(e,No,o),d(e,je,o),d(e,So,o),f(Ie,e,o),d(e,Bo,o),d(e,Ue,o),d(e,Eo,o),d(e,Ae,o),d(e,Do,o),d(e,We,o),d(e,Vo,o),d(e,He,o),d(e,Zo,o),d(e,Je,o),d(e,Ro,o),f(Ge,e,o),d(e,Oo,o),d(e,Ne,o),d(e,Xo,o),f(Se,e,o),d(e,Qo,o),d(e,Be,o),d(e,Yo,o),f(Ee,e,o),d(e,Ko,o),d(e,De,o),d(e,en,o),d(e,Ve,o),d(e,tn,o),d(e,Ze,o),d(e,on,o),d(e,Re,o),d(e,nn,o),d(e,Oe,o),d(e,an,o),d(e,Xe,o),d(e,sn,o),d(e,Qe,o),d(e,rn,o),f(Ye,e,o),d(e,ln,o),d(e,S,o),f(Ke,S,null),t(S,zn),t(S,Ut),t(S,Cn),t(S,At),t(S,Fn),f(se,S,null),d(e,dn,o),f(et,e,o),d(e,cn,o),d(e,P,o),f(tt,P,null),t(P,qn),t(P,Wt),t(P,Pn),t(P,Ht),f(ot,Ht,null),t(P,jn),t(P,re),f(nt,re,null),t(re,In),t(re,Jt),t(P,Un),t(P,D),f(at,D,null),t(D,An),t(D,Gt),t(D,Wn),f(ie,D,null),t(D,Hn),t(D,Nt),t(P,Jn),t(P,le),f(st,le,null),t(le,Gn),t(le,St),d(e,mn,o),f(rt,e,o),d(e,pn,o),d(e,w,o),f(it,w,null),t(w,Nn),t(w,Bt),t(w,Sn),t(w,Et),t(w,Bn),f(de,w,null),t(w,En),t(w,Dt),t(w,Dn),t(w,Vt),t(w,Vn),t(w,Zt),f(lt,Zt,null),t(w,Zn),t(w,ce),f(dt,ce,null),t(ce,Rn),t(ce,Rt),t(w,On),t(w,O),f(ct,O,null),t(O,Xn),t(O,Ot),t(O,Qn),t(O,Xt),t(w,Yn),t(w,me),f(mt,me,null),t(me,Kn),t(me,Qt),t(w,ea),t(w,Yt),f(pt,Yt,null),d(e,un,o),f(ut,e,o),d(e,hn,o),d(e,j,o),f(ht,j,null),t(j,ta),t(j,Kt),t(j,oa),t(j,eo),t(j,na),t(j,to),t(j,aa),t(j,X),f(ft,X,null),t(X,sa),t(X,oo),t(X,ra),f(pe,X,null),d(e,fn,o),f(gt,e,o),d(e,gn,o),d(e,oe,o),f(_t,oe,null),t(oe,ia),t(oe,V),f(bt,V,null),t(V,la),t(V,no),t(V,da),f(ue,V,null),t(V,ca),f(he,V,null),d(e,_n,o),f(kt,e,o),d(e,bn,o),d(e,C,o),f(vt,C,null),t(C,ma),t(C,ao),t(C,pa),t(C,so),t(C,ua),t(C,ro),t(C,ha),t(C,io),t(C,fa),t(C,lo),t(C,ga),t(C,Q),f(yt,Q,null),t(Q,_a),t(Q,co),t(Q,ba),f(fe,Q,null),d(e,kn,o),f(Tt,e,o),d(e,vn,o),d(e,I,o),f(wt,I,null),t(I,ka),t(I,mo),t(I,va),t(I,po),t(I,ya),t(I,uo),t(I,Ta),t(I,Y),f($t,Y,null),t(Y,wa),t(Y,ho),t(Y,$a),f(ge,Y,null),d(e,yn,o),f(Lt,e,o),d(e,Tn,o),d(e,F,o),f(xt,F,null),t(F,La),t(F,fo),t(F,xa),t(F,go),t(F,Ma),t(F,_o),t(F,za),t(F,bo),t(F,Ca),t(F,ko),t(F,Fa),t(F,A),f(Mt,A,null),t(A,qa),t(A,vo),t(A,Pa),f(_e,A,null),t(A,ja),f(be,A,null),t(A,Ia),f(ke,A,null),d(e,wn,o),f(zt,e,o),d(e,$n,o),d(e,q,o),f(Ct,q,null),t(q,Ua),t(q,yo),t(q,Aa),t(q,To),t(q,Wa),t(q,wo),t(q,Ha),t(q,$o),t(q,Ja),t(q,Lo),t(q,Ga),t(q,W),f(Ft,W,null),t(W,Na),t(W,xo),t(W,Sa),f(ve,W,null),t(W,Ba),f(ye,W,null),t(W,Ea),f(Te,W,null),d(e,Ln,o),d(e,Fo,o),xn=!0},p(e,[o]){const Z={};o&2&&(Z.$$scope={dirty:o,ctx:e}),se.$set(Z);const U={};o&2&&(U.$$scope={dirty:o,ctx:e}),ie.$set(U);const qo={};o&2&&(qo.$$scope={dirty:o,ctx:e}),de.$set(qo);const qt={};o&2&&(qt.$$scope={dirty:o,ctx:e}),pe.$set(qt);const R={};o&2&&(R.$$scope={dirty:o,ctx:e}),ue.$set(R);const Pt={};o&2&&(Pt.$$scope={dirty:o,ctx:e}),he.$set(Pt);const x={};o&2&&(x.$$scope={dirty:o,ctx:e}),fe.$set(x);const Po={};o&2&&(Po.$$scope={dirty:o,ctx:e}),ge.$set(Po);const jt={};o&2&&(jt.$$scope={dirty:o,ctx:e}),_e.$set(jt);const ne={};o&2&&(ne.$$scope={dirty:o,ctx:e}),be.$set(ne);const It={};o&2&&(It.$$scope={dirty:o,ctx:e}),ke.$set(It);const jo={};o&2&&(jo.$$scope={dirty:o,ctx:e}),ve.$set(jo);const B={};o&2&&(B.$$scope={dirty:o,ctx:e}),ye.$set(B);const ae={};o&2&&(ae.$$scope={dirty:o,ctx:e}),Te.$set(ae)},i(e){xn||(g(T.$$.fragment,e),g(z.$$.fragment,e),g(Fe.$$.fragment,e),g(Pe.$$.fragment,e),g(Ie.$$.fragment,e),g(Ge.$$.fragment,e),g(Se.$$.fragment,e),g(Ee.$$.fragment,e),g(Ye.$$.fragment,e),g(Ke.$$.fragment,e),g(se.$$.fragment,e),g(et.$$.fragment,e),g(tt.$$.fragment,e),g(ot.$$.fragment,e),g(nt.$$.fragment,e),g(at.$$.fragment,e),g(ie.$$.fragment,e),g(st.$$.fragment,e),g(rt.$$.fragment,e),g(it.$$.fragment,e),g(de.$$.fragment,e),g(lt.$$.fragment,e),g(dt.$$.fragment,e),g(ct.$$.fragment,e),g(mt.$$.fragment,e),g(pt.$$.fragment,e),g(ut.$$.fragment,e),g(ht.$$.fragment,e),g(ft.$$.fragment,e),g(pe.$$.fragment,e),g(gt.$$.fragment,e),g(_t.$$.fragment,e),g(bt.$$.fragment,e),g(ue.$$.fragment,e),g(he.$$.fragment,e),g(kt.$$.fragment,e),g(vt.$$.fragment,e),g(yt.$$.fragment,e),g(fe.$$.fragment,e),g(Tt.$$.fragment,e),g(wt.$$.fragment,e),g($t.$$.fragment,e),g(ge.$$.fragment,e),g(Lt.$$.fragment,e),g(xt.$$.fragment,e),g(Mt.$$.fragment,e),g(_e.$$.fragment,e),g(be.$$.fragment,e),g(ke.$$.fragment,e),g(zt.$$.fragment,e),g(Ct.$$.fragment,e),g(Ft.$$.fragment,e),g(ve.$$.fragment,e),g(ye.$$.fragment,e),g(Te.$$.fragment,e),xn=!0)},o(e){_(T.$$.fragment,e),_(z.$$.fragment,e),_(Fe.$$.fragment,e),_(Pe.$$.fragment,e),_(Ie.$$.fragment,e),_(Ge.$$.fragment,e),_(Se.$$.fragment,e),_(Ee.$$.fragment,e),_(Ye.$$.fragment,e),_(Ke.$$.fragment,e),_(se.$$.fragment,e),_(et.$$.fragment,e),_(tt.$$.fragment,e),_(ot.$$.fragment,e),_(nt.$$.fragment,e),_(at.$$.fragment,e),_(ie.$$.fragment,e),_(st.$$.fragment,e),_(rt.$$.fragment,e),_(it.$$.fragment,e),_(de.$$.fragment,e),_(lt.$$.fragment,e),_(dt.$$.fragment,e),_(ct.$$.fragment,e),_(mt.$$.fragment,e),_(pt.$$.fragment,e),_(ut.$$.fragment,e),_(ht.$$.fragment,e),_(ft.$$.fragment,e),_(pe.$$.fragment,e),_(gt.$$.fragment,e),_(_t.$$.fragment,e),_(bt.$$.fragment,e),_(ue.$$.fragment,e),_(he.$$.fragment,e),_(kt.$$.fragment,e),_(vt.$$.fragment,e),_(yt.$$.fragment,e),_(fe.$$.fragment,e),_(Tt.$$.fragment,e),_(wt.$$.fragment,e),_($t.$$.fragment,e),_(ge.$$.fragment,e),_(Lt.$$.fragment,e),_(xt.$$.fragment,e),_(Mt.$$.fragment,e),_(_e.$$.fragment,e),_(be.$$.fragment,e),_(ke.$$.fragment,e),_(zt.$$.fragment,e),_(Ct.$$.fragment,e),_(Ft.$$.fragment,e),_(ve.$$.fragment,e),_(ye.$$.fragment,e),_(Te.$$.fragment,e),xn=!1},d(e){e&&(s(v),s(c),s(k),s(p),s(Io),s(xe),s(Uo),s(Me),s(Ao),s(ze),s(Wo),s(Ce),s(Ho),s(Jo),s(qe),s(Go),s(No),s(je),s(So),s(Bo),s(Ue),s(Eo),s(Ae),s(Do),s(We),s(Vo),s(He),s(Zo),s(Je),s(Ro),s(Oo),s(Ne),s(Xo),s(Qo),s(Be),s(Yo),s(Ko),s(De),s(en),s(Ve),s(tn),s(Ze),s(on),s(Re),s(nn),s(Oe),s(an),s(Xe),s(sn),s(Qe),s(rn),s(ln),s(S),s(dn),s(cn),s(P),s(mn),s(pn),s(w),s(un),s(hn),s(j),s(fn),s(gn),s(oe),s(_n),s(bn),s(C),s(kn),s(vn),s(I),s(yn),s(Tn),s(F),s(wn),s($n),s(q),s(Ln),s(Fo)),s(r),b(T,e),b(z,e),b(Fe,e),b(Pe,e),b(Ie,e),b(Ge,e),b(Se,e),b(Ee,e),b(Ye,e),b(Ke),b(se),b(et,e),b(tt),b(ot),b(nt),b(at),b(ie),b(st),b(rt,e),b(it),b(de),b(lt),b(dt),b(ct),b(mt),b(pt),b(ut,e),b(ht),b(ft),b(pe),b(gt,e),b(_t),b(bt),b(ue),b(he),b(kt,e),b(vt),b(yt),b(fe),b(Tt,e),b(wt),b($t),b(ge),b(Lt,e),b(xt),b(Mt),b(_e),b(be),b(ke),b(zt,e),b(Ct),b(Ft),b(ve),b(ye),b(Te)}}}const vr='{"title":"LLaMA","local":"llama","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"LlamaConfig","local":"transformers.LlamaConfig","sections":[],"depth":2},{"title":"LlamaTokenizer","local":"transformers.LlamaTokenizer","sections":[],"depth":2},{"title":"LlamaTokenizerFast","local":"transformers.LlamaTokenizerFast","sections":[],"depth":2},{"title":"LlamaModel","local":"transformers.LlamaModel","sections":[],"depth":2},{"title":"LlamaForCausalLM","local":"transformers.LlamaForCausalLM","sections":[],"depth":2},{"title":"LlamaForSequenceClassification","local":"transformers.LlamaForSequenceClassification","sections":[],"depth":2},{"title":"LlamaForQuestionAnswering","local":"transformers.LlamaForQuestionAnswering","sections":[],"depth":2},{"title":"FlaxLlamaModel","local":"transformers.FlaxLlamaModel","sections":[],"depth":2},{"title":"FlaxLlamaForCausalLM","local":"transformers.FlaxLlamaForCausalLM","sections":[],"depth":2}],"depth":1}';function yr(y){return tr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fr extends or{constructor(r){super(),nr(this,r,yr,kr,er,{})}}export{Fr as component};
