import{s as or,o as nr,n as N}from"../chunks/scheduler.25b97de1.js";import{S as ar,i as sr,g as i,s as n,r as u,A as rr,h as l,f as s,c as a,j as $,u as h,x as m,k as L,y as o,a as d,v as f,d as g,t as _,w as b}from"../chunks/index.d9030fc9.js";import{T as $e}from"../chunks/Tip.baa67368.js";import{D as x}from"../chunks/Docstring.ffac8efa.js";import{C as Le}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Fo}from"../chunks/ExampleCodeBlock.22dfe688.js";import{P as tr}from"../chunks/PipelineTag.5f100392.js";import{H as E,E as ir}from"../chunks/EditOnGithub.91d95064.js";function lr(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 dr(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 cr(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 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="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 hr(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 fr(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 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:"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 kr(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 vr(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 yr(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 Tr(y){let r,v,c,k,T,p,z,Uo,Me,Za='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.',Ao,xe,Ra="The abstract from the paper is the following:",Wo,ze,Oa="<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>",Ho,Ce,Xa='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>.',Jo,Fe,Go,qe,Qa='<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>',No,Pe,So,je,Ya="<li>After conversion, the model and tokenizer can be loaded via:</li>",Bo,Ie,Eo,Ue,Ka=`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.`,Do,Ae,es='<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>',Vo,We,ts='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.',Zo,He,os="Based on the original LLaMA model, Meta AI has released some follow-up works:",Ro,Je,ns='<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>',Oo,Ge,Xo,Ne,as="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.",Qo,Se,Yo,Be,ss='<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>',Ko,Ee,en,De,rs='<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>',tn,Ve,is="⚗️ Optimization",on,Ze,ls='<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>',nn,Re,ds="⚡️ Inference",an,Oe,cs='<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>',sn,Xe,ms="🚀 Deploy",rn,Qe,ps='<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>',ln,Ye,dn,S,Ke,Fn,At,us=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.41.0/en/model_doc/llama#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.`,qn,Wt,hs=`Configuration objects inherit from <a href="/docs/transformers/v4.41.0/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.41.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Pn,se,cn,et,mn,P,tt,jn,Ht,fs=`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.`,In,Jt,ot,Un,re,nt,An,Gt,gs=`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.`,Wn,D,at,Hn,Nt,_s="Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT",Jn,ie,Gn,St,bs="if token_ids_1 is None, only returns the first portion of the mask (0s).",Nn,le,st,Sn,Bt,ks="Save the vocabulary and special tokens file to a directory.",pn,rt,un,w,it,Bn,Et,vs="Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding.",En,Dt,ys="This uses notably ByteFallback and no normalization.",Dn,de,Vn,Vt,Ts=`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.`,Zn,Zt,ws=`This tokenizer inherits from <a href="/docs/transformers/v4.41.0/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.`,Rn,Rt,lt,On,ce,dt,Xn,Ot,$s=`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.`,Qn,O,ct,Yn,Xt,Ls=`Create the token type IDs corresponding to the sequences passed. <a href="../glossary#token-type-ids">What are token type
IDs?</a>`,Kn,Qt,Ms="Should be overridden in a subclass if the model has a special way of building those.",ea,me,mt,ta,Yt,xs="Updates the underlying post processor with the current <code>bos_token</code> and <code>eos_token</code>.",oa,Kt,pt,hn,ut,fn,j,ht,na,eo,zs=`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/v4.41.0/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.)`,aa,to,Cs=`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.`,sa,oo,Fs="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>LlamaDecoderLayer</code>",ra,X,ft,ia,no,qs='The <a href="/docs/transformers/v4.41.0/en/model_doc/llama#transformers.LlamaModel">LlamaModel</a> forward method, overrides the <code>__call__</code> special method.',la,pe,gn,gt,_n,oe,_t,da,V,bt,ca,ao,Ps='The <a href="/docs/transformers/v4.41.0/en/model_doc/llama#transformers.LlamaForCausalLM">LlamaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',ma,ue,pa,he,bn,kt,kn,C,vt,ua,so,js="The LLaMa Model transformer with a sequence classification head on top (linear layer).",ha,ro,Is=`<a href="/docs/transformers/v4.41.0/en/model_doc/llama#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,fa,io,Us=`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).`,ga,lo,As=`This model inherits from <a href="/docs/transformers/v4.41.0/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.)`,_a,co,Ws=`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.`,ba,Q,yt,ka,mo,Hs='The <a href="/docs/transformers/v4.41.0/en/model_doc/llama#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',va,fe,vn,Tt,yn,I,wt,ya,po,Js=`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>).`,Ta,uo,Gs=`This model inherits from <a href="/docs/transformers/v4.41.0/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.)`,wa,ho,Ns=`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.`,$a,Y,$t,La,fo,Ss='The <a href="/docs/transformers/v4.41.0/en/model_doc/llama#transformers.LlamaForQuestionAnswering">LlamaForQuestionAnswering</a> forward method, overrides the <code>__call__</code> special method.',Ma,ge,Tn,Lt,wn,F,Mt,xa,go,Bs="The bare Llama Model transformer outputting raw hidden-states without any specific head on top.",za,_o,Es=`This model inherits from <a href="/docs/transformers/v4.41.0/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.)`,Ca,bo,Ds=`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.`,Fa,ko,Vs="Finally, this model supports inherent JAX features such as:",qa,vo,Zs='<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>',Pa,A,xt,ja,yo,Rs="The <code>FlaxLlamaPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",Ia,_e,Ua,be,Aa,ke,$n,zt,Ln,q,Ct,Wa,To,Os="The Llama Model transformer with a language modeling head (linear layer) on top.",Ha,wo,Xs=`This model inherits from <a href="/docs/transformers/v4.41.0/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.)`,Ja,$o,Qs=`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.`,Ga,Lo,Ys="Finally, this model supports inherent JAX features such as:",Na,Mo,Ks='<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>',Sa,W,Ft,Ba,xo,er="The <code>FlaxLlamaPreTrainedModel</code> forward method, overrides the <code>__call__</code> special method.",Ea,ve,Da,ye,Va,Te,Mn,qt,xn,qo,zn;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 tr({props:{pipeline:"text-classification"}}),Ee=new tr({props:{pipeline:"question-answering"}}),Ye=new E({props:{title:"LlamaConfig",local:"transformers.LlamaConfig",headingTag:"h2"}}),Ke=new x({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:"mlp_bias",val:" = False"},{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.41.0/en/model_doc/llama#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>, <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"},{anchor:"transformers.LlamaConfig.mlp_bias",description:`<strong>mlp_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in up_proj, down_proj and gate_proj layers in the MLP layers.`,name:"mlp_bias"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/configuration_llama.py#L29"}}),se=new Fo({props:{anchor:"transformers.LlamaConfig.example",$$slots:{default:[lr]},$$scope:{ctx:y}}}),et=new E({props:{title:"LlamaTokenizer",local:"transformers.LlamaTokenizer",headingTag:"h2"}}),tt=new x({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.
Make sure to also set <code>from_slow</code> to <code>True</code>.
A simple example:</p>
<ul>
<li><code>legacy=True</code>:</li>
</ul>`,name:"legacy"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/tokenization_llama.py#L55"}}),ot=new x({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.41.0/src/transformers/models/llama/tokenization_llama.py#L332"}}),nt=new x({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.41.0/src/transformers/models/llama/tokenization_llama.py#L343",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 x({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.41.0/src/transformers/models/llama/tokenization_llama.py#L380",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 Fo({props:{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[dr]},$$scope:{ctx:y}}}),st=new x({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.41.0/src/transformers/models/llama/tokenization_llama.py#L305",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 x({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:"legacy",val:" = None"},{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.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.
Make sure to also set <code>from_slow</code> to <code>True</code>.
A simple example:</p>
<ul>
<li><code>legacy=True</code>:</li>
</ul>`,name:"legacy"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/tokenization_llama_fast.py#L49"}}),de=new Fo({props:{anchor:"transformers.LlamaTokenizerFast.example",$$slots:{default:[cr]},$$scope:{ctx:y}}}),lt=new x({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.41.0/src/transformers/models/llama/tokenization_llama_fast.py#L299"}}),dt=new x({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.41.0/src/transformers/tokenization_utils_base.py#L3852",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 x({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.41.0/src/transformers/tokenization_utils_base.py#L3382",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 x({props:{name:"update_post_processor",anchor:"transformers.LlamaTokenizerFast.update_post_processor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/tokenization_llama_fast.py#L179"}}),pt=new x({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.41.0/src/transformers/models/llama/tokenization_llama_fast.py#L223"}}),ut=new E({props:{title:"LlamaModel",local:"transformers.LlamaModel",headingTag:"h2"}}),ht=new x({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.41.0/en/model_doc/llama#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.41.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; LlamaConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/modeling_llama.py#L859"}}),ft=new x({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:": Union = 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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LlamaModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>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.41.0/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.41.0/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.41.0/src/transformers/models/llama/modeling_llama.py#L892"}}),pe=new $e({props:{$$slots:{default:[mr]},$$scope:{ctx:y}}}),gt=new E({props:{title:"LlamaForCausalLM",local:"transformers.LlamaForCausalLM",headingTag:"h2"}}),_t=new x({props:{name:"class transformers.LlamaForCausalLM",anchor:"transformers.LlamaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/modeling_llama.py#L1086"}}),bt=new x({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:": Union = 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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LlamaForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>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.41.0/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.41.0/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.41.0/src/transformers/models/llama/modeling_llama.py#L1116",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.41.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.41.0/en/model_doc/llama#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.41.0/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:[pr]},$$scope:{ctx:y}}}),he=new Fo({props:{anchor:"transformers.LlamaForCausalLM.forward.example",$$slots:{default:[ur]},$$scope:{ctx:y}}}),kt=new E({props:{title:"LlamaForSequenceClassification",local:"transformers.LlamaForSequenceClassification",headingTag:"h2"}}),vt=new x({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.41.0/en/model_doc/llama#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.41.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/modeling_llama.py#L1299"}}),yt=new x({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:": Union = 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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LlamaForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>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.41.0/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.41.0/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.41.0/src/transformers/models/llama/modeling_llama.py#L1330"}}),fe=new $e({props:{$$slots:{default:[hr]},$$scope:{ctx:y}}}),Tt=new E({props:{title:"LlamaForQuestionAnswering",local:"transformers.LlamaForQuestionAnswering",headingTag:"h2"}}),wt=new x({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.41.0/en/model_doc/llama#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.41.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/modeling_llama.py#L1422"}}),$t=new x({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:": Union = 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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>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.41.0/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.41.0/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.41.0/src/transformers/models/llama/modeling_llama.py#L1447"}}),ge=new $e({props:{$$slots:{default:[fr]},$$scope:{ctx:y}}}),Lt=new E({props:{title:"FlaxLlamaModel",local:"transformers.FlaxLlamaModel",headingTag:"h2"}}),Mt=new x({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.41.0/en/model_doc/llama#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.41.0/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.41.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.41.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/modeling_flax_llama.py#L645"}}),xt=new x({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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.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.41.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/modeling_flax_llama.py#L469",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/v4.41.0/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.41.0/en/model_doc/llama#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.41.0/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:[gr]},$$scope:{ctx:y}}}),be=new $e({props:{warning:!0,$$slots:{default:[_r]},$$scope:{ctx:y}}}),ke=new Fo({props:{anchor:"transformers.FlaxLlamaModel.__call__.example",$$slots:{default:[br]},$$scope:{ctx:y}}}),zt=new E({props:{title:"FlaxLlamaForCausalLM",local:"transformers.FlaxLlamaForCausalLM",headingTag:"h2"}}),Ct=new x({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.41.0/en/model_doc/llama#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.41.0/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.41.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.41.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/modeling_flax_llama.py#L706"}}),Ft=new x({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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.41.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.41.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.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.41.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.41.0/src/transformers/models/llama/modeling_flax_llama.py#L469",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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