import{s as Js,o as Rs,n as Le}from"../chunks/scheduler.9bc65507.js";import{S as Bs,i as Vs,g as o,s as r,u as f,A as Gs,h as a,f as t,c as i,j as h,v as g,y as c,k as p,o as n,a as l,w as _,d as v,t as k,x as b}from"../chunks/index.78c82d43.js";import{T as To}from"../chunks/Tip.87d55b76.js";import{D as z}from"../chunks/Docstring.f3d04bd2.js";import{C as mn}from"../chunks/CodeBlock.48618ec2.js";import{I as ee}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Lo}from"../chunks/ExampleCodeBlock.872b014d.js";import{P as Os}from"../chunks/PipelineTag.75b0f707.js";function Zs(C){let d,w="The <code>Llama2</code> models were trained using <code>bfloat16</code>, but the original inference uses <code>float16. The checkpoints uploaded on the hub use </code>torch_dtype = ‘float16’<code>which will be used by the</code>AutoModel<code>API to cast the checkpoints from</code>torch.float32<code>to</code>torch.float16`.",m,y,L="The <code>dtype</code> of the online weights is mostly irrelevant, unless you are using <code>torch_dtype=&quot;auto&quot;</code> when initializing a model using <code>model = AutoModelForCausalLM.from_pretrained(&quot;path&quot;, torch_dtype = &quot;auto&quot;)</code>. The reason is that the model will first be downloaded ( using the <code>dtype</code> of the checkpoints online) then it will be casted to the default <code>dtype</code> of <code>torch</code> (becomes <code>torch.float32</code>) and finally, if there is a <code>torch_dtype</code> provided in the config, it will be used.",u,M,N="Training the model in <code>float16</code> is not recommended and known to produce <code>nan</code>, as such the model should be trained in <code>bfloat16</code>.";return{c(){d=o("p"),d.innerHTML=w,m=r(),y=o("p"),y.innerHTML=L,u=r(),M=o("p"),M.innerHTML=N},l(F){d=a(F,"P",{"data-svelte-h":!0}),c(d)!=="svelte-g9c9om"&&(d.innerHTML=w),m=i(F),y=a(F,"P",{"data-svelte-h":!0}),c(y)!=="svelte-ug0twd"&&(y.innerHTML=L),u=i(F),M=a(F,"P",{"data-svelte-h":!0}),c(M)!=="svelte-gosvm7"&&(M.innerHTML=N)},m(F,E){l(F,d,E),l(F,m,E),l(F,y,E),l(F,u,E),l(F,M,E)},p:Le,d(F){F&&(t(d),t(m),t(y),t(u),t(M))}}}function Xs(C){let d,w;return d=new mn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYW1hTW9kZWwlMkMlMjBMbGFtYUNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBMTGFNQSUyMGxsYW1hLTdiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMExsYW1hQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwbGxhbWEtN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMExsYW1hTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaModel, LlamaConfig

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){f(d.$$.fragment)},l(m){g(d.$$.fragment,m)},m(m,y){_(d,m,y),w=!0},p:Le,i(m){w||(v(d.$$.fragment,m),w=!0)},o(m){k(d.$$.fragment,m),w=!1},d(m){b(d,m)}}}function Ys(C){let d,w="sequence pair mask has the following format:",m,y,L;return y=new mn({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=o("p"),d.textContent=w,m=r(),f(y.$$.fragment)},l(u){d=a(u,"P",{"data-svelte-h":!0}),c(d)!=="svelte-16klr56"&&(d.textContent=w),m=i(u),g(y.$$.fragment,u)},m(u,M){l(u,d,M),l(u,m,M),_(y,u,M),L=!0},p:Le,i(u){L||(v(y.$$.fragment,u),L=!0)},o(u){k(y.$$.fragment,u),L=!1},d(u){u&&(t(d),t(m)),b(y,u)}}}function Qs(C){let d,w;return d=new mn({props:{code:"JTBBJTVCMSUyQyUyMDE1MDQzJTJDJTIwNDQ1JTJDJTIwMzM4JTJDJTIwMjYzJTJDJTIwMTI0MyU1RA==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaTokenizerFast

tokenizer = LlamaTokenizerFast.from_pretrained(&quot;hf-internal-testing/llama-tokenizer&quot;)
tokenizer.encode(&quot;Hello this is a test&quot;)
&gt;&gt;&gt; [<span class="hljs-number">1</span>, <span class="hljs-number">15043</span>, <span class="hljs-number">445</span>, <span class="hljs-number">338</span>, <span class="hljs-number">263</span>, <span class="hljs-number">1243</span>]`}}),{c(){f(d.$$.fragment)},l(m){g(d.$$.fragment,m)},m(m,y){_(d,m,y),w=!0},p:Le,i(m){w||(v(d.$$.fragment,m),w=!0)},o(m){k(d.$$.fragment,m),w=!1},d(m){b(d,m)}}}function Ks(C){let d,w=`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(){d=o("p"),d.innerHTML=w},l(m){d=a(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=w)},m(m,y){l(m,d,y)},p:Le,d(m){m&&t(d)}}}function er(C){let d,w=`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(){d=o("p"),d.innerHTML=w},l(m){d=a(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=w)},m(m,y){l(m,d,y)},p:Le,d(m){m&&t(d)}}}function tr(C){let d,w="Example:",m,y,L;return y=new mn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMbGFtYUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBMbGFtYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZChQQVRIX1RPX0NPTlZFUlRFRF9XRUlHSFRTKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKFBBVEhfVE9fQ09OVkVSVEVEX1RPS0VOSVpFUiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LlamaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LlamaForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?\\nI&#x27;m not conscious, but I can talk to you.&quot;</span>`}}),{c(){d=o("p"),d.textContent=w,m=r(),f(y.$$.fragment)},l(u){d=a(u,"P",{"data-svelte-h":!0}),c(d)!=="svelte-11lpom8"&&(d.textContent=w),m=i(u),g(y.$$.fragment,u)},m(u,M){l(u,d,M),l(u,m,M),_(y,u,M),L=!0},p:Le,i(u){L||(v(y.$$.fragment,u),L=!0)},o(u){k(y.$$.fragment,u),L=!1},d(u){u&&(t(d),t(m)),b(y,u)}}}function nr(C){let d,w=`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(){d=o("p"),d.innerHTML=w},l(m){d=a(m,"P",{"data-svelte-h":!0}),c(d)!=="svelte-fincs2"&&(d.innerHTML=w)},m(m,y){l(m,d,y)},p:Le,d(m){m&&t(d)}}}function or(C){let d,w,m,y,L,u,M,N,F,E,Ma="Llama2",Mn,B,te,pn,$e,$o,wt,xa="Overview",xn,Me,Ca='The Llama2 model was proposed in <a href="https://ai.meta.com/research/publications/llama-2-open-foundation-and-fine-tuned-chat-models/" rel="nofollow">LLaMA: Open Foundation and Fine-Tuned Chat Models</a> by Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez Madian Khabsa, Isabel Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov, Pushka rMishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaoqing EllenTan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu, Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan, Melanie Kambadur, Sharan Narang, Aurelien Rodriguez, Robert Stojnic, Sergey Edunov, Thomas Scialom. It is a collection of foundation language models ranging from 7B to 70B parameters, with checkpoints finetuned for chat application!',Cn,xe,za="The abstract from the paper is the following:",zn,Ce,Fa="<em>In this work, we develop and release Llama 2, a collection of pretrained and fine-tuned large language models (LLMs) ranging in scale from 7 billion to 70 billion parameters. Our fine-tuned LLMs, called Llama 2-Chat, are optimized for dialogue use cases. Our models outperform open-source chat models on most benchmarks we tested, and based on our human evaluations for helpfulness and safety, may be a suitable substitute for closed-source models. We provide a detailed description of our approach to fine-tuning and safety improvements of Llama 2-Chat in order to enable the community to build on our work and contribute to the responsible development of LLMs.</em>",Fn,ze,Pa='Checkout all Llama2 models <a href="https://huggingface.co/models?search=llama2" rel="nofollow">here</a>',Pn,ne,qn,Fe,qa="Tips:",An,Pe,Aa='<li>Weights for the Llama2 models can be obtained by filling out <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" rel="nofollow">this form</a></li> <li>The architecture is very similar to the first Llama, with the addition of Grouped Query Attention (GQA) following this <a href="https://arxiv.org/pdf/2305.13245.pdf" rel="nofollow">paper</a></li> <li>Setting <code>config.pretraining_tp</code> to a value different than 1 will activate the more accurate but slower computation of the linear layers, which should better match the original logits.</li> <li>The original model uses <code>pad_id = -1</code> which means that there is no padding token. We can’t have the same logic, make sure to add a padding token using <code>tokenizer.add_special_tokens({&quot;pad_token&quot;:&quot;&lt;pad&gt;&quot;})</code> and resize the token embedding accordingly. You should also set the <code>model.config.pad_token_id</code>. The <code>embed_tokens</code> layer of the model is initialized with <code>self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.config.padding_idx)</code>, which makes sure that encoding the padding token will output zeros, so passing it when initializing is recommended.</li> <li>After filling out the form and gaining access to the model checkpoints, you should be able to use the already converted checkpoints. Otherwise, if you are converting your own model, feel free to use the <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>',In,qe,En,Ae,Ia="<li>After conversion, the model and tokenizer can be loaded via:</li>",Hn,Ie,jn,Ee,Ea=`Note that executing the script requires enough CPU RAM to host the whole model in float16 precision (even if the biggest versions
come in several checkpoints they each contain a part of each weight of the model, so we need to load them all in RAM). For the 75B model, it’s thus 145GB of RAM needed.`,Sn,He,Ha='<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>',Nn,je,ja='This model was contributed by <a href="https://huggingface.co/ArthurZ" rel="nofollow">Arthur Zucker</a> with contributions from <a href="https://huggingface.co/lysandre" rel="nofollow">Lysandre Debut</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>.',Un,V,oe,hn,Se,Mo,Tt,Sa="Resources",Wn,Ne,Na="A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with LLaMA2. 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.",Dn,Ue,Ua='<li><a href="https://huggingface.co/blog/llama2" rel="nofollow">Llama 2 is here - get it on Hugging Face</a>, a blog post about Llama 2 and how to use it with 🤗 Transformers and 🤗 PEFT.</li> <li><a href="https://www.philschmid.de/llama-2" rel="nofollow">LLaMA 2 - Every Resource you need</a>, a compilation of relevant resources to learn about LLaMA 2 and how to get started quickly.</li>',Jn,We,Rn,De,Wa='<li>A <a href="https://colab.research.google.com/drive/1PEQyJO1-f6j0S_XJ8DV50NkpzasXkrzd?usp=sharing" rel="nofollow">notebook</a> on how to fine-tune Llama 2 in Google Colab using QLoRA and 4-bit precision. 🌎</li> <li>A <a href="https://colab.research.google.com/drive/134o_cXcMe_lsvl15ZE_4Y75Kstepsntu?usp=sharing" rel="nofollow">notebook</a> on how to fine-tune the “Llama-v2-7b-guanaco” model with 4-bit QLoRA and generate Q&amp;A datasets from PDFs. 🌎</li>',Bn,Je,Da="⚗️ Optimization",Vn,Re,Ja='<li><a href="https://huggingface.co/blog/dpo-trl" rel="nofollow">Fine-tune Llama 2 with DPO</a>, a guide to using the TRL library’s DPO method to fine tune Llama 2 on a specific dataset.</li> <li><a href="https://www.philschmid.de/instruction-tune-llama-2" rel="nofollow">Extended Guide: Instruction-tune Llama 2</a>, a guide to training Llama 2 to generate instructions from inputs, transforming the model from instruction-following to instruction-giving.</li> <li>A <a href="https://colab.research.google.com/drive/1SYpgFpcmtIUzdE7pxqknrM4ArCASfkFQ?usp=sharing" rel="nofollow">notebook</a> on how to fine-tune the Llama 2 model on a personal computer using QLoRa and TRL. 🌎</li>',Gn,Be,Ra="⚡️ Inference",On,Ve,Ba='<li>A <a href="https://colab.research.google.com/drive/1TC56ArKerXUpbgRy5vM3woRsbTEVNq7h?usp=sharing" rel="nofollow">notebook</a> on how to quantize the Llama 2 model using GPTQ from the AutoGPTQ library. 🌎</li> <li>A <a href="https://colab.research.google.com/drive/1X1z9Q6domMKl2CnEM0QGHNwidLfR4dW2?usp=sharing" rel="nofollow">notebook</a> on how to run the Llama 2 Chat Model with 4-bit quantization on a local computer or Google Colab. 🌎</li>',Zn,Ge,Va="🚀 Deploy",Xn,Oe,Ga='<li><a href="https://www.philschmid.de/sagemaker-llama2-qlora" rel="nofollow">Fine-tune LLaMA 2 (7-70B) on Amazon SageMaker</a>, a complete guide from setup to QLoRA fine-tuning and deployment on Amazon SageMaker.</li> <li><a href="https://www.philschmid.de/sagemaker-llama-llm" rel="nofollow">Deploy Llama 2 7B/13B/70B on Amazon SageMaker</a>, a guide on using Hugging Face’s LLM DLC container for secure and scalable deployment.</li>',Yn,G,ae,un,Ze,xo,Lt,Oa="LlamaConfig",Qn,I,Xe,Co,$t,Za=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.33.3/en/model_doc/llama2#transformers.LlamaModel">LlamaModel</a>. It is used to instantiate an LLaMA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LLaMA-7B.`,zo,Mt,Xa=`Configuration objects inherit from <a href="/docs/transformers/v4.33.3/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.33.3/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Fo,se,Kn,O,re,fn,Ye,Po,xt,Ya="LlamaTokenizer",eo,P,Qe,qo,Ct,Qa=`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.`,Ao,zt,Ke,Io,ie,et,Eo,Ft,Ka=`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.`,Ho,H,tt,jo,Pt,es="Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT",So,le,No,qt,ts="if token_ids_1 is None, only returns the first portion of the mask (0s).",Uo,de,nt,Wo,At,ns="Save the vocabulary and special tokens file to a directory.",to,Z,ce,gn,ot,Do,It,os="LlamaTokenizerFast",no,T,at,Jo,Et,as="Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding.",Ro,Ht,ss="This uses notably ByteFallback and no normalization.",Bo,me,Vo,jt,rs=`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.`,Go,St,is=`This tokenizer inherits from <a href="/docs/transformers/v4.33.3/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.`,Oo,U,st,Zo,Nt,ls=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens.`,Xo,Ut,ds="This implementation does not add special tokens and this method should be overridden in a subclass.",Yo,pe,rt,Qo,Wt,cs=`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.`,Ko,W,it,ea,Dt,ms=`Create the token type IDs corresponding to the sequences passed. <a href="../glossary#token-type-ids">What are token type
IDs?</a>`,ta,Jt,ps="Should be overridden in a subclass if the model has a special way of building those.",na,he,lt,oa,Rt,hs="Updates the underlying post processor with the current <code>bos_token</code> and <code>eos_token</code>.",aa,Bt,dt,oo,X,ue,_n,ct,sa,Vt,us="LlamaModel",ao,q,mt,ra,Gt,fs=`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/v4.33.3/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.)`,ia,Ot,gs=`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.`,la,Zt,_s="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>LlamaDecoderLayer</code>",da,D,pt,ca,Xt,vs='The <a href="/docs/transformers/v4.33.3/en/model_doc/llama2#transformers.LlamaModel">LlamaModel</a> forward method, overrides the <code>__call__</code> special method.',ma,fe,so,Y,ge,vn,ht,pa,Yt,ks="LlamaForCausalLM",ro,Q,ut,ha,j,ft,ua,Qt,bs='The <a href="/docs/transformers/v4.33.3/en/model_doc/llama2#transformers.LlamaForCausalLM">LlamaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',fa,_e,ga,ve,io,K,ke,kn,gt,_a,Kt,ys="LlamaForSequenceClassification",lo,x,_t,va,en,ws="The LLaMa Model transformer with a sequence classification head on top (linear layer).",ka,tn,Ts=`<a href="/docs/transformers/v4.33.3/en/model_doc/llama2#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,ba,nn,Ls=`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).`,ya,on,$s=`This model inherits from <a href="/docs/transformers/v4.33.3/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,an,Ms=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ta,J,vt,La,sn,xs='The <a href="/docs/transformers/v4.33.3/en/model_doc/llama2#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',$a,be,co,bn,mo;return N=new ee({}),$e=new ee({}),ne=new To({props:{warning:!0,$$slots:{default:[Zs]},$$scope:{ctx:C}}}),qe=new mn({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`}}),Ie=new mn({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>)`}}),Se=new ee({}),We=new Os({props:{pipeline:"text-generation"}}),Ze=new ee({}),Xe=new z({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:"**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.33.3/en/model_doc/llama2#transformers.LlamaModel">LlamaModel</a>`,name:"vocab_size"},{anchor:"transformers.LlamaConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.LlamaConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 11008) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.LlamaConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.LlamaConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.LlamaConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed by meanpooling all the original heads within that group. For more details checkout [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to </code>num_attention_heads\`.`,name:"num_key_value_heads"},{anchor:"transformers.LlamaConfig.pretraining_tp",description:`<strong>pretraining_tp</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) &#x2014;
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to <a href="https://huggingface.co/docs/transformers/parallelism" rel="nofollow">this
document</a> to understand more about it. This value is
necessary to ensure exact reproducibility of the pretraining results. Please refer to <a href="https://github.com/pytorch/pytorch/issues/76232" rel="nofollow">this
issue</a>.`,name:"pretraining_tp"},{anchor:"transformers.LlamaConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.LlamaConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length that this model might ever be used with. 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-12) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.LlamaConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.LlamaConfig.tie_word_embeddings(bool,",description:`<strong>tie_word_embeddings(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings(bool,"},{anchor:"transformers.LlamaConfig.rope_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 an float greater than 1. The expected format
is <code>{&quot;type&quot;: strategy name, &quot;factor&quot;: scaling factor}</code>. When using this flag, don&#x2019;t update
<code>max_position_embeddings</code> to the expected new maximum. See the following thread for more information on how
these scaling strategies behave:
<a href="https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/" rel="nofollow">https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/</a>. This is an
experimental feature, subject to breaking API changes in future versions.</p>
<p>Example &#x2014;`,name:"rope_scaling"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/configuration_llama.py#L31"}}),se=new Lo({props:{anchor:"transformers.LlamaConfig.example",$$slots:{default:[Xs]},$$scope:{ctx:C}}}),Ye=new ee({}),Qe=new z({props:{name:"class transformers.LlamaTokenizer",anchor:"transformers.LlamaTokenizer",parameters:[{name:"vocab_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"pad_token",val:" = None"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"add_bos_token",val:" = True"},{name:"add_eos_token",val:" = False"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"use_default_system_prompt",val:" = True"},{name:"spaces_between_special_tokens",val:" = False"},{name:"legacy",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.LlamaTokenizer.legacy",description:`<strong>legacy</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the <code>legacy</code> behavior of the tokenizer should be used. Legacy is before the merge of #24622
and #25224 which includes fixes to properly handle tokens that appear after special tokens. A simple
example:</p>
<ul>
<li><code>legacy=True</code>:</li>
</ul>`,name:"legacy"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/tokenization_llama.py#L67"}}),Ke=new z({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.33.3/src/transformers/models/llama/tokenization_llama.py#L296"}}),et=new z({props:{name:"get_special_tokens_mask",anchor:"transformers.LlamaTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/tokenization_llama.py#L307",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),tt=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/tokenization_llama.py#L344",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),le=new Lo({props:{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Ys]},$$scope:{ctx:C}}}),nt=new z({props:{name:"save_vocabulary",anchor:"transformers.LlamaTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:""},{name:"filename_prefix",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.save_vocabulary.save_directory",description:`<strong>save_directory</strong> (<code>str</code>) &#x2014;
The directory in which to save the vocabulary.`,name:"save_directory"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/tokenization_llama.py#L269",returnDescription:`
<p>Paths to the files saved.</p>
`,returnType:`
<p><code>Tuple(str)</code></p>
`}}),ot=new ee({}),at=new z({props:{name:"class transformers.LlamaTokenizerFast",anchor:"transformers.LlamaTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"add_bos_token",val:" = True"},{name:"add_eos_token",val:" = False"},{name:"use_default_system_prompt",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .model extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.LlamaTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/huggingface/tokenizers" rel="nofollow">tokenizers</a> file (generally has a .json extension) that
contains everything needed to load the tokenizer.`,name:"tokenizer_file"},{anchor:"transformers.LlamaTokenizerFast.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>str</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Wether to cleanup spaces after decoding, cleanup consists in removing potential artifacts like extra
spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.LlamaTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.`,name:"bos_token"},{anchor:"transformers.LlamaTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.LlamaTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/tokenization_llama_fast.py#L52"}}),me=new Lo({props:{anchor:"transformers.LlamaTokenizerFast.example",$$slots:{default:[Qs]},$$scope:{ctx:C}}}),st=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LlamaTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.LlamaTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/tokenization_utils_base.py#L3121",returnDescription:`
<p>The model input with special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),rt=new z({props:{name:"get_special_tokens_mask",anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids of the first sequence.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
List of ids of the second sequence.`,name:"token_ids_1"},{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/tokenization_utils_base.py#L3566",returnDescription:`
<p>1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p>A list of integers in the range [0, 1]</p>
`}}),it=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/tokenization_utils_base.py#L3101",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),lt=new z({props:{name:"update_post_processor",anchor:"transformers.LlamaTokenizerFast.update_post_processor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/tokenization_llama_fast.py#L136"}}),dt=new z({props:{name:"save_vocabulary",anchor:"transformers.LlamaTokenizerFast.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/tokenization_llama_fast.py#L176"}}),ct=new ee({}),mt=new z({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.33.3/en/model_doc/llama2#transformers.LlamaConfig">LlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.33.3/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.33.3/src/transformers/models/llama/modeling_llama.py#L563"}}),pt=new z({props:{name:"forward",anchor:"transformers.LlamaModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LlamaModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/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.33.3/src/transformers/models/llama/modeling_llama.py#L614"}}),fe=new To({props:{$$slots:{default:[Ks]},$$scope:{ctx:C}}}),ht=new ee({}),ut=new z({props:{name:"class transformers.LlamaForCausalLM",anchor:"transformers.LlamaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/modeling_llama.py#L742"}}),ft=new z({props:{name:"forward",anchor:"transformers.LlamaForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LlamaForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/modeling_llama.py#L772",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.3/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.33.3/en/model_doc/llama2#transformers.LlamaConfig"
>LlamaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) — Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new To({props:{$$slots:{default:[er]},$$scope:{ctx:C}}}),ve=new Lo({props:{anchor:"transformers.LlamaForCausalLM.forward.example",$$slots:{default:[tr]},$$scope:{ctx:C}}}),gt=new ee({}),_t=new z({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.33.3/en/model_doc/llama2#transformers.LlamaConfig">LlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.33.3/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.33.3/src/transformers/models/llama/modeling_llama.py#L921"}}),vt=new z({props:{name:"forward",anchor:"transformers.LlamaForSequenceClassification.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LlamaForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__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.33.3/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.3/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.3/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.33.3/src/transformers/models/llama/modeling_llama.py#L937"}}),be=new To({props:{$$slots:{default:[nr]},$$scope:{ctx:C}}}),{c(){d=o("meta"),w=r(),m=o("p"),y=r(),L=o("h1"),u=o("a"),M=o("span"),f(N.$$.fragment),F=r(),E=o("span"),E.textContent=Ma,Mn=r(),B=o("h2"),te=o("a"),pn=o("span"),f($e.$$.fragment),$o=r(),wt=o("span"),wt.textContent=xa,xn=r(),Me=o("p"),Me.innerHTML=Ca,Cn=r(),xe=o("p"),xe.textContent=za,zn=r(),Ce=o("p"),Ce.innerHTML=Fa,Fn=r(),ze=o("p"),ze.innerHTML=Pa,Pn=r(),f(ne.$$.fragment),qn=r(),Fe=o("p"),Fe.textContent=qa,An=r(),Pe=o("ul"),Pe.innerHTML=Aa,In=r(),f(qe.$$.fragment),En=r(),Ae=o("ul"),Ae.innerHTML=Ia,Hn=r(),f(Ie.$$.fragment),jn=r(),Ee=o("p"),Ee.textContent=Ea,Sn=r(),He=o("ul"),He.innerHTML=Ha,Nn=r(),je=o("p"),je.innerHTML=ja,Un=r(),V=o("h2"),oe=o("a"),hn=o("span"),f(Se.$$.fragment),Mo=r(),Tt=o("span"),Tt.textContent=Sa,Wn=r(),Ne=o("p"),Ne.textContent=Na,Dn=r(),Ue=o("ul"),Ue.innerHTML=Ua,Jn=r(),f(We.$$.fragment),Rn=r(),De=o("ul"),De.innerHTML=Wa,Bn=r(),Je=o("p"),Je.textContent=Da,Vn=r(),Re=o("ul"),Re.innerHTML=Ja,Gn=r(),Be=o("p"),Be.textContent=Ra,On=r(),Ve=o("ul"),Ve.innerHTML=Ba,Zn=r(),Ge=o("p"),Ge.textContent=Va,Xn=r(),Oe=o("ul"),Oe.innerHTML=Ga,Yn=r(),G=o("h2"),ae=o("a"),un=o("span"),f(Ze.$$.fragment),xo=r(),Lt=o("span"),Lt.textContent=Oa,Qn=r(),I=o("div"),f(Xe.$$.fragment),Co=r(),$t=o("p"),$t.innerHTML=Za,zo=r(),Mt=o("p"),Mt.innerHTML=Xa,Fo=r(),f(se.$$.fragment),Kn=r(),O=o("h2"),re=o("a"),fn=o("span"),f(Ye.$$.fragment),Po=r(),xt=o("span"),xt.textContent=Ya,eo=r(),P=o("div"),f(Qe.$$.fragment),qo=r(),Ct=o("p"),Ct.textContent=Qa,Ao=r(),zt=o("div"),f(Ke.$$.fragment),Io=r(),ie=o("div"),f(et.$$.fragment),Eo=r(),Ft=o("p"),Ft.innerHTML=Ka,Ho=r(),H=o("div"),f(tt.$$.fragment),jo=r(),Pt=o("p"),Pt.textContent=es,So=r(),f(le.$$.fragment),No=r(),qt=o("p"),qt.textContent=ts,Uo=r(),de=o("div"),f(nt.$$.fragment),Wo=r(),At=o("p"),At.textContent=ns,to=r(),Z=o("h2"),ce=o("a"),gn=o("span"),f(ot.$$.fragment),Do=r(),It=o("span"),It.textContent=os,no=r(),T=o("div"),f(at.$$.fragment),Jo=r(),Et=o("p"),Et.textContent=as,Ro=r(),Ht=o("p"),Ht.textContent=ss,Bo=r(),f(me.$$.fragment),Vo=r(),jt=o("p"),jt.innerHTML=rs,Go=r(),St=o("p"),St.innerHTML=is,Oo=r(),U=o("div"),f(st.$$.fragment),Zo=r(),Nt=o("p"),Nt.textContent=ls,Xo=r(),Ut=o("p"),Ut.textContent=ds,Yo=r(),pe=o("div"),f(rt.$$.fragment),Qo=r(),Wt=o("p"),Wt.innerHTML=cs,Ko=r(),W=o("div"),f(it.$$.fragment),ea=r(),Dt=o("p"),Dt.innerHTML=ms,ta=r(),Jt=o("p"),Jt.textContent=ps,na=r(),he=o("div"),f(lt.$$.fragment),oa=r(),Rt=o("p"),Rt.innerHTML=hs,aa=r(),Bt=o("div"),f(dt.$$.fragment),oo=r(),X=o("h2"),ue=o("a"),_n=o("span"),f(ct.$$.fragment),sa=r(),Vt=o("span"),Vt.textContent=us,ao=r(),q=o("div"),f(mt.$$.fragment),ra=r(),Gt=o("p"),Gt.innerHTML=fs,ia=r(),Ot=o("p"),Ot.innerHTML=gs,la=r(),Zt=o("p"),Zt.innerHTML=_s,da=r(),D=o("div"),f(pt.$$.fragment),ca=r(),Xt=o("p"),Xt.innerHTML=vs,ma=r(),f(fe.$$.fragment),so=r(),Y=o("h2"),ge=o("a"),vn=o("span"),f(ht.$$.fragment),pa=r(),Yt=o("span"),Yt.textContent=ks,ro=r(),Q=o("div"),f(ut.$$.fragment),ha=r(),j=o("div"),f(ft.$$.fragment),ua=r(),Qt=o("p"),Qt.innerHTML=bs,fa=r(),f(_e.$$.fragment),ga=r(),f(ve.$$.fragment),io=r(),K=o("h2"),ke=o("a"),kn=o("span"),f(gt.$$.fragment),_a=r(),Kt=o("span"),Kt.textContent=ys,lo=r(),x=o("div"),f(_t.$$.fragment),va=r(),en=o("p"),en.textContent=ws,ka=r(),tn=o("p"),tn.innerHTML=Ts,ba=r(),nn=o("p"),nn.innerHTML=Ls,ya=r(),on=o("p"),on.innerHTML=$s,wa=r(),an=o("p"),an.innerHTML=Ms,Ta=r(),J=o("div"),f(vt.$$.fragment),La=r(),sn=o("p"),sn.innerHTML=xs,$a=r(),f(be.$$.fragment),co=r(),bn=o("p"),this.h()},l(e){const s=Gs("svelte-1phssyn",document.head);d=a(s,"META",{name:!0,content:!0}),s.forEach(t),w=i(e),m=a(e,"P",{}),h(m).forEach(t),y=i(e),L=a(e,"H1",{class:!0});var kt=h(L);u=a(kt,"A",{id:!0,class:!0,href:!0});var yn=h(u);M=a(yn,"SPAN",{});var wn=h(M);g(N.$$.fragment,wn),wn.forEach(t),yn.forEach(t),F=i(kt),E=a(kt,"SPAN",{"data-svelte-h":!0}),c(E)!=="svelte-17w68hu"&&(E.textContent=Ma),kt.forEach(t),Mn=i(e),B=a(e,"H2",{class:!0});var bt=h(B);te=a(bt,"A",{id:!0,class:!0,href:!0});var Tn=h(te);pn=a(Tn,"SPAN",{});var Ln=h(pn);g($e.$$.fragment,Ln),Ln.forEach(t),Tn.forEach(t),$o=i(bt),wt=a(bt,"SPAN",{"data-svelte-h":!0}),c(wt)!=="svelte-1jsw1pg"&&(wt.textContent=xa),bt.forEach(t),xn=i(e),Me=a(e,"P",{"data-svelte-h":!0}),c(Me)!=="svelte-xm2zag"&&(Me.innerHTML=Ca),Cn=i(e),xe=a(e,"P",{"data-svelte-h":!0}),c(xe)!=="svelte-vfdo9a"&&(xe.textContent=za),zn=i(e),Ce=a(e,"P",{"data-svelte-h":!0}),c(Ce)!=="svelte-1wo3ztj"&&(Ce.innerHTML=Fa),Fn=i(e),ze=a(e,"P",{"data-svelte-h":!0}),c(ze)!=="svelte-forh14"&&(ze.innerHTML=Pa),Pn=i(e),g(ne.$$.fragment,e),qn=i(e),Fe=a(e,"P",{"data-svelte-h":!0}),c(Fe)!=="svelte-axv494"&&(Fe.textContent=qa),An=i(e),Pe=a(e,"UL",{"data-svelte-h":!0}),c(Pe)!=="svelte-tepalw"&&(Pe.innerHTML=Aa),In=i(e),g(qe.$$.fragment,e),En=i(e),Ae=a(e,"UL",{"data-svelte-h":!0}),c(Ae)!=="svelte-yjbkch"&&(Ae.innerHTML=Ia),Hn=i(e),g(Ie.$$.fragment,e),jn=i(e),Ee=a(e,"P",{"data-svelte-h":!0}),c(Ee)!=="svelte-199e5ee"&&(Ee.textContent=Ea),Sn=i(e),He=a(e,"UL",{"data-svelte-h":!0}),c(He)!=="svelte-1xmggxn"&&(He.innerHTML=Ha),Nn=i(e),je=a(e,"P",{"data-svelte-h":!0}),c(je)!=="svelte-x3p6lc"&&(je.innerHTML=ja),Un=i(e),V=a(e,"H2",{class:!0});var yt=h(V);oe=a(yt,"A",{id:!0,class:!0,href:!0});var $n=h(oe);hn=a($n,"SPAN",{});var Cs=h(hn);g(Se.$$.fragment,Cs),Cs.forEach(t),$n.forEach(t),Mo=i(yt),Tt=a(yt,"SPAN",{"data-svelte-h":!0}),c(Tt)!=="svelte-w4zzv6"&&(Tt.textContent=Sa),yt.forEach(t),Wn=i(e),Ne=a(e,"P",{"data-svelte-h":!0}),c(Ne)!=="svelte-1l10g8k"&&(Ne.textContent=Na),Dn=i(e),Ue=a(e,"UL",{"data-svelte-h":!0}),c(Ue)!=="svelte-189jef5"&&(Ue.innerHTML=Ua),Jn=i(e),g(We.$$.fragment,e),Rn=i(e),De=a(e,"UL",{"data-svelte-h":!0}),c(De)!=="svelte-1txpvb1"&&(De.innerHTML=Wa),Bn=i(e),Je=a(e,"P",{"data-svelte-h":!0}),c(Je)!=="svelte-liq2q7"&&(Je.textContent=Da),Vn=i(e),Re=a(e,"UL",{"data-svelte-h":!0}),c(Re)!=="svelte-1xuj4g0"&&(Re.innerHTML=Ja),Gn=i(e),Be=a(e,"P",{"data-svelte-h":!0}),c(Be)!=="svelte-1wntqpp"&&(Be.textContent=Ra),On=i(e),Ve=a(e,"UL",{"data-svelte-h":!0}),c(Ve)!=="svelte-gxsehz"&&(Ve.innerHTML=Ba),Zn=i(e),Ge=a(e,"P",{"data-svelte-h":!0}),c(Ge)!=="svelte-lk14e4"&&(Ge.textContent=Va),Xn=i(e),Oe=a(e,"UL",{"data-svelte-h":!0}),c(Oe)!=="svelte-1f88qgk"&&(Oe.innerHTML=Ga),Yn=i(e),G=a(e,"H2",{class:!0});var po=h(G);ae=a(po,"A",{id:!0,class:!0,href:!0});var zs=h(ae);un=a(zs,"SPAN",{});var Fs=h(un);g(Ze.$$.fragment,Fs),Fs.forEach(t),zs.forEach(t),xo=i(po),Lt=a(po,"SPAN",{"data-svelte-h":!0}),c(Lt)!=="svelte-7iuhrk"&&(Lt.textContent=Oa),po.forEach(t),Qn=i(e),I=a(e,"DIV",{class:!0});var ye=h(I);g(Xe.$$.fragment,ye),Co=i(ye),$t=a(ye,"P",{"data-svelte-h":!0}),c($t)!=="svelte-7gy906"&&($t.innerHTML=Za),zo=i(ye),Mt=a(ye,"P",{"data-svelte-h":!0}),c(Mt)!=="svelte-cfh5wl"&&(Mt.innerHTML=Xa),Fo=i(ye),g(se.$$.fragment,ye),ye.forEach(t),Kn=i(e),O=a(e,"H2",{class:!0});var ho=h(O);re=a(ho,"A",{id:!0,class:!0,href:!0});var Ps=h(re);fn=a(Ps,"SPAN",{});var qs=h(fn);g(Ye.$$.fragment,qs),qs.forEach(t),Ps.forEach(t),Po=i(ho),xt=a(ho,"SPAN",{"data-svelte-h":!0}),c(xt)!=="svelte-1hr2ekz"&&(xt.textContent=Ya),ho.forEach(t),eo=i(e),P=a(e,"DIV",{class:!0});var S=h(P);g(Qe.$$.fragment,S),qo=i(S),Ct=a(S,"P",{"data-svelte-h":!0}),c(Ct)!=="svelte-qfiu5a"&&(Ct.textContent=Qa),Ao=i(S),zt=a(S,"DIV",{class:!0});var As=h(zt);g(Ke.$$.fragment,As),As.forEach(t),Io=i(S),ie=a(S,"DIV",{class:!0});var uo=h(ie);g(et.$$.fragment,uo),Eo=i(uo),Ft=a(uo,"P",{"data-svelte-h":!0}),c(Ft)!=="svelte-1f4f5kp"&&(Ft.innerHTML=Ka),uo.forEach(t),Ho=i(S),H=a(S,"DIV",{class:!0});var we=h(H);g(tt.$$.fragment,we),jo=i(we),Pt=a(we,"P",{"data-svelte-h":!0}),c(Pt)!=="svelte-13bfd60"&&(Pt.textContent=es),So=i(we),g(le.$$.fragment,we),No=i(we),qt=a(we,"P",{"data-svelte-h":!0}),c(qt)!=="svelte-wtrslu"&&(qt.textContent=ts),we.forEach(t),Uo=i(S),de=a(S,"DIV",{class:!0});var fo=h(de);g(nt.$$.fragment,fo),Wo=i(fo),At=a(fo,"P",{"data-svelte-h":!0}),c(At)!=="svelte-1slb66l"&&(At.textContent=ns),fo.forEach(t),S.forEach(t),to=i(e),Z=a(e,"H2",{class:!0});var go=h(Z);ce=a(go,"A",{id:!0,class:!0,href:!0});var Is=h(ce);gn=a(Is,"SPAN",{});var Es=h(gn);g(ot.$$.fragment,Es),Es.forEach(t),Is.forEach(t),Do=i(go),It=a(go,"SPAN",{"data-svelte-h":!0}),c(It)!=="svelte-r8mzo5"&&(It.textContent=os),go.forEach(t),no=i(e),T=a(e,"DIV",{class:!0});var $=h(T);g(at.$$.fragment,$),Jo=i($),Et=a($,"P",{"data-svelte-h":!0}),c(Et)!=="svelte-15tdcz8"&&(Et.textContent=as),Ro=i($),Ht=a($,"P",{"data-svelte-h":!0}),c(Ht)!=="svelte-llhmpa"&&(Ht.textContent=ss),Bo=i($),g(me.$$.fragment,$),Vo=i($),jt=a($,"P",{"data-svelte-h":!0}),c(jt)!=="svelte-cnb6q1"&&(jt.innerHTML=rs),Go=i($),St=a($,"P",{"data-svelte-h":!0}),c(St)!=="svelte-10uwgx2"&&(St.innerHTML=is),Oo=i($),U=a($,"DIV",{class:!0});var rn=h(U);g(st.$$.fragment,rn),Zo=i(rn),Nt=a(rn,"P",{"data-svelte-h":!0}),c(Nt)!=="svelte-xip562"&&(Nt.textContent=ls),Xo=i(rn),Ut=a(rn,"P",{"data-svelte-h":!0}),c(Ut)!=="svelte-1yvfiyo"&&(Ut.textContent=ds),rn.forEach(t),Yo=i($),pe=a($,"DIV",{class:!0});var _o=h(pe);g(rt.$$.fragment,_o),Qo=i(_o),Wt=a(_o,"P",{"data-svelte-h":!0}),c(Wt)!=="svelte-1wmjg8a"&&(Wt.innerHTML=cs),_o.forEach(t),Ko=i($),W=a($,"DIV",{class:!0});var ln=h(W);g(it.$$.fragment,ln),ea=i(ln),Dt=a(ln,"P",{"data-svelte-h":!0}),c(Dt)!=="svelte-zj1vf1"&&(Dt.innerHTML=ms),ta=i(ln),Jt=a(ln,"P",{"data-svelte-h":!0}),c(Jt)!=="svelte-9vptpw"&&(Jt.textContent=ps),ln.forEach(t),na=i($),he=a($,"DIV",{class:!0});var vo=h(he);g(lt.$$.fragment,vo),oa=i(vo),Rt=a(vo,"P",{"data-svelte-h":!0}),c(Rt)!=="svelte-nfci2w"&&(Rt.innerHTML=hs),vo.forEach(t),aa=i($),Bt=a($,"DIV",{class:!0});var Hs=h(Bt);g(dt.$$.fragment,Hs),Hs.forEach(t),$.forEach(t),oo=i(e),X=a(e,"H2",{class:!0});var ko=h(X);ue=a(ko,"A",{id:!0,class:!0,href:!0});var js=h(ue);_n=a(js,"SPAN",{});var Ss=h(_n);g(ct.$$.fragment,Ss),Ss.forEach(t),js.forEach(t),sa=i(ko),Vt=a(ko,"SPAN",{"data-svelte-h":!0}),c(Vt)!=="svelte-1txfp0z"&&(Vt.textContent=us),ko.forEach(t),ao=i(e),q=a(e,"DIV",{class:!0});var R=h(q);g(mt.$$.fragment,R),ra=i(R),Gt=a(R,"P",{"data-svelte-h":!0}),c(Gt)!=="svelte-guh07b"&&(Gt.innerHTML=fs),ia=i(R),Ot=a(R,"P",{"data-svelte-h":!0}),c(Ot)!=="svelte-hswkmf"&&(Ot.innerHTML=gs),la=i(R),Zt=a(R,"P",{"data-svelte-h":!0}),c(Zt)!=="svelte-eom0yk"&&(Zt.innerHTML=_s),da=i(R),D=a(R,"DIV",{class:!0});var dn=h(D);g(pt.$$.fragment,dn),ca=i(dn),Xt=a(dn,"P",{"data-svelte-h":!0}),c(Xt)!=="svelte-y1pql0"&&(Xt.innerHTML=vs),ma=i(dn),g(fe.$$.fragment,dn),dn.forEach(t),R.forEach(t),so=i(e),Y=a(e,"H2",{class:!0});var bo=h(Y);ge=a(bo,"A",{id:!0,class:!0,href:!0});var Ns=h(ge);vn=a(Ns,"SPAN",{});var Us=h(vn);g(ht.$$.fragment,Us),Us.forEach(t),Ns.forEach(t),pa=i(bo),Yt=a(bo,"SPAN",{"data-svelte-h":!0}),c(Yt)!=="svelte-nvcter"&&(Yt.textContent=ks),bo.forEach(t),ro=i(e),Q=a(e,"DIV",{class:!0});var yo=h(Q);g(ut.$$.fragment,yo),ha=i(yo),j=a(yo,"DIV",{class:!0});var Te=h(j);g(ft.$$.fragment,Te),ua=i(Te),Qt=a(Te,"P",{"data-svelte-h":!0}),c(Qt)!=="svelte-11762k4"&&(Qt.innerHTML=bs),fa=i(Te),g(_e.$$.fragment,Te),ga=i(Te),g(ve.$$.fragment,Te),Te.forEach(t),yo.forEach(t),io=i(e),K=a(e,"H2",{class:!0});var wo=h(K);ke=a(wo,"A",{id:!0,class:!0,href:!0});var Ws=h(ke);kn=a(Ws,"SPAN",{});var Ds=h(kn);g(gt.$$.fragment,Ds),Ds.forEach(t),Ws.forEach(t),_a=i(wo),Kt=a(wo,"SPAN",{"data-svelte-h":!0}),c(Kt)!=="svelte-ftlzum"&&(Kt.textContent=ys),wo.forEach(t),lo=i(e),x=a(e,"DIV",{class:!0});var A=h(x);g(_t.$$.fragment,A),va=i(A),en=a(A,"P",{"data-svelte-h":!0}),c(en)!=="svelte-62must"&&(en.textContent=ws),ka=i(A),tn=a(A,"P",{"data-svelte-h":!0}),c(tn)!=="svelte-1xtlk4v"&&(tn.innerHTML=Ts),ba=i(A),nn=a(A,"P",{"data-svelte-h":!0}),c(nn)!=="svelte-10ugs3m"&&(nn.innerHTML=Ls),ya=i(A),on=a(A,"P",{"data-svelte-h":!0}),c(on)!=="svelte-ev63c"&&(on.innerHTML=$s),wa=i(A),an=a(A,"P",{"data-svelte-h":!0}),c(an)!=="svelte-hswkmf"&&(an.innerHTML=Ms),Ta=i(A),J=a(A,"DIV",{class:!0});var cn=h(J);g(vt.$$.fragment,cn),La=i(cn),sn=a(cn,"P",{"data-svelte-h":!0}),c(sn)!=="svelte-12wpkr6"&&(sn.innerHTML=xs),$a=i(cn),g(be.$$.fragment,cn),cn.forEach(t),A.forEach(t),co=i(e),bn=a(e,"P",{}),h(bn).forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(ar)),p(u,"id","llama2"),p(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(u,"href","#llama2"),p(L,"class","relative group"),p(te,"id","overview"),p(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(te,"href","#overview"),p(B,"class","relative group"),p(oe,"id","resources"),p(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(oe,"href","#resources"),p(V,"class","relative group"),p(ae,"id","transformers.LlamaConfig"),p(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ae,"href","#transformers.LlamaConfig"),p(G,"class","relative group"),p(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(re,"id","transformers.LlamaTokenizer"),p(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(re,"href","#transformers.LlamaTokenizer"),p(O,"class","relative group"),p(zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ce,"id","transformers.LlamaTokenizerFast"),p(ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ce,"href","#transformers.LlamaTokenizerFast"),p(Z,"class","relative group"),p(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ue,"id","transformers.LlamaModel"),p(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ue,"href","#transformers.LlamaModel"),p(X,"class","relative group"),p(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ge,"id","transformers.LlamaForCausalLM"),p(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ge,"href","#transformers.LlamaForCausalLM"),p(Y,"class","relative group"),p(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ke,"id","transformers.LlamaForSequenceClassification"),p(ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ke,"href","#transformers.LlamaForSequenceClassification"),p(K,"class","relative group"),p(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,s){n(document.head,d),l(e,w,s),l(e,m,s),l(e,y,s),l(e,L,s),n(L,u),n(u,M),_(N,M,null),n(L,F),n(L,E),l(e,Mn,s),l(e,B,s),n(B,te),n(te,pn),_($e,pn,null),n(B,$o),n(B,wt),l(e,xn,s),l(e,Me,s),l(e,Cn,s),l(e,xe,s),l(e,zn,s),l(e,Ce,s),l(e,Fn,s),l(e,ze,s),l(e,Pn,s),_(ne,e,s),l(e,qn,s),l(e,Fe,s),l(e,An,s),l(e,Pe,s),l(e,In,s),_(qe,e,s),l(e,En,s),l(e,Ae,s),l(e,Hn,s),_(Ie,e,s),l(e,jn,s),l(e,Ee,s),l(e,Sn,s),l(e,He,s),l(e,Nn,s),l(e,je,s),l(e,Un,s),l(e,V,s),n(V,oe),n(oe,hn),_(Se,hn,null),n(V,Mo),n(V,Tt),l(e,Wn,s),l(e,Ne,s),l(e,Dn,s),l(e,Ue,s),l(e,Jn,s),_(We,e,s),l(e,Rn,s),l(e,De,s),l(e,Bn,s),l(e,Je,s),l(e,Vn,s),l(e,Re,s),l(e,Gn,s),l(e,Be,s),l(e,On,s),l(e,Ve,s),l(e,Zn,s),l(e,Ge,s),l(e,Xn,s),l(e,Oe,s),l(e,Yn,s),l(e,G,s),n(G,ae),n(ae,un),_(Ze,un,null),n(G,xo),n(G,Lt),l(e,Qn,s),l(e,I,s),_(Xe,I,null),n(I,Co),n(I,$t),n(I,zo),n(I,Mt),n(I,Fo),_(se,I,null),l(e,Kn,s),l(e,O,s),n(O,re),n(re,fn),_(Ye,fn,null),n(O,Po),n(O,xt),l(e,eo,s),l(e,P,s),_(Qe,P,null),n(P,qo),n(P,Ct),n(P,Ao),n(P,zt),_(Ke,zt,null),n(P,Io),n(P,ie),_(et,ie,null),n(ie,Eo),n(ie,Ft),n(P,Ho),n(P,H),_(tt,H,null),n(H,jo),n(H,Pt),n(H,So),_(le,H,null),n(H,No),n(H,qt),n(P,Uo),n(P,de),_(nt,de,null),n(de,Wo),n(de,At),l(e,to,s),l(e,Z,s),n(Z,ce),n(ce,gn),_(ot,gn,null),n(Z,Do),n(Z,It),l(e,no,s),l(e,T,s),_(at,T,null),n(T,Jo),n(T,Et),n(T,Ro),n(T,Ht),n(T,Bo),_(me,T,null),n(T,Vo),n(T,jt),n(T,Go),n(T,St),n(T,Oo),n(T,U),_(st,U,null),n(U,Zo),n(U,Nt),n(U,Xo),n(U,Ut),n(T,Yo),n(T,pe),_(rt,pe,null),n(pe,Qo),n(pe,Wt),n(T,Ko),n(T,W),_(it,W,null),n(W,ea),n(W,Dt),n(W,ta),n(W,Jt),n(T,na),n(T,he),_(lt,he,null),n(he,oa),n(he,Rt),n(T,aa),n(T,Bt),_(dt,Bt,null),l(e,oo,s),l(e,X,s),n(X,ue),n(ue,_n),_(ct,_n,null),n(X,sa),n(X,Vt),l(e,ao,s),l(e,q,s),_(mt,q,null),n(q,ra),n(q,Gt),n(q,ia),n(q,Ot),n(q,la),n(q,Zt),n(q,da),n(q,D),_(pt,D,null),n(D,ca),n(D,Xt),n(D,ma),_(fe,D,null),l(e,so,s),l(e,Y,s),n(Y,ge),n(ge,vn),_(ht,vn,null),n(Y,pa),n(Y,Yt),l(e,ro,s),l(e,Q,s),_(ut,Q,null),n(Q,ha),n(Q,j),_(ft,j,null),n(j,ua),n(j,Qt),n(j,fa),_(_e,j,null),n(j,ga),_(ve,j,null),l(e,io,s),l(e,K,s),n(K,ke),n(ke,kn),_(gt,kn,null),n(K,_a),n(K,Kt),l(e,lo,s),l(e,x,s),_(_t,x,null),n(x,va),n(x,en),n(x,ka),n(x,tn),n(x,ba),n(x,nn),n(x,ya),n(x,on),n(x,wa),n(x,an),n(x,Ta),n(x,J),_(vt,J,null),n(J,La),n(J,sn),n(J,$a),_(be,J,null),l(e,co,s),l(e,bn,s),mo=!0},p(e,[s]){const kt={};s&2&&(kt.$$scope={dirty:s,ctx:e}),ne.$set(kt);const yn={};s&2&&(yn.$$scope={dirty:s,ctx:e}),se.$set(yn);const wn={};s&2&&(wn.$$scope={dirty:s,ctx:e}),le.$set(wn);const bt={};s&2&&(bt.$$scope={dirty:s,ctx:e}),me.$set(bt);const Tn={};s&2&&(Tn.$$scope={dirty:s,ctx:e}),fe.$set(Tn);const Ln={};s&2&&(Ln.$$scope={dirty:s,ctx:e}),_e.$set(Ln);const yt={};s&2&&(yt.$$scope={dirty:s,ctx:e}),ve.$set(yt);const $n={};s&2&&($n.$$scope={dirty:s,ctx:e}),be.$set($n)},i(e){mo||(v(N.$$.fragment,e),v($e.$$.fragment,e),v(ne.$$.fragment,e),v(qe.$$.fragment,e),v(Ie.$$.fragment,e),v(Se.$$.fragment,e),v(We.$$.fragment,e),v(Ze.$$.fragment,e),v(Xe.$$.fragment,e),v(se.$$.fragment,e),v(Ye.$$.fragment,e),v(Qe.$$.fragment,e),v(Ke.$$.fragment,e),v(et.$$.fragment,e),v(tt.$$.fragment,e),v(le.$$.fragment,e),v(nt.$$.fragment,e),v(ot.$$.fragment,e),v(at.$$.fragment,e),v(me.$$.fragment,e),v(st.$$.fragment,e),v(rt.$$.fragment,e),v(it.$$.fragment,e),v(lt.$$.fragment,e),v(dt.$$.fragment,e),v(ct.$$.fragment,e),v(mt.$$.fragment,e),v(pt.$$.fragment,e),v(fe.$$.fragment,e),v(ht.$$.fragment,e),v(ut.$$.fragment,e),v(ft.$$.fragment,e),v(_e.$$.fragment,e),v(ve.$$.fragment,e),v(gt.$$.fragment,e),v(_t.$$.fragment,e),v(vt.$$.fragment,e),v(be.$$.fragment,e),mo=!0)},o(e){k(N.$$.fragment,e),k($e.$$.fragment,e),k(ne.$$.fragment,e),k(qe.$$.fragment,e),k(Ie.$$.fragment,e),k(Se.$$.fragment,e),k(We.$$.fragment,e),k(Ze.$$.fragment,e),k(Xe.$$.fragment,e),k(se.$$.fragment,e),k(Ye.$$.fragment,e),k(Qe.$$.fragment,e),k(Ke.$$.fragment,e),k(et.$$.fragment,e),k(tt.$$.fragment,e),k(le.$$.fragment,e),k(nt.$$.fragment,e),k(ot.$$.fragment,e),k(at.$$.fragment,e),k(me.$$.fragment,e),k(st.$$.fragment,e),k(rt.$$.fragment,e),k(it.$$.fragment,e),k(lt.$$.fragment,e),k(dt.$$.fragment,e),k(ct.$$.fragment,e),k(mt.$$.fragment,e),k(pt.$$.fragment,e),k(fe.$$.fragment,e),k(ht.$$.fragment,e),k(ut.$$.fragment,e),k(ft.$$.fragment,e),k(_e.$$.fragment,e),k(ve.$$.fragment,e),k(gt.$$.fragment,e),k(_t.$$.fragment,e),k(vt.$$.fragment,e),k(be.$$.fragment,e),mo=!1},d(e){e&&(t(w),t(m),t(y),t(L),t(Mn),t(B),t(xn),t(Me),t(Cn),t(xe),t(zn),t(Ce),t(Fn),t(ze),t(Pn),t(qn),t(Fe),t(An),t(Pe),t(In),t(En),t(Ae),t(Hn),t(jn),t(Ee),t(Sn),t(He),t(Nn),t(je),t(Un),t(V),t(Wn),t(Ne),t(Dn),t(Ue),t(Jn),t(Rn),t(De),t(Bn),t(Je),t(Vn),t(Re),t(Gn),t(Be),t(On),t(Ve),t(Zn),t(Ge),t(Xn),t(Oe),t(Yn),t(G),t(Qn),t(I),t(Kn),t(O),t(eo),t(P),t(to),t(Z),t(no),t(T),t(oo),t(X),t(ao),t(q),t(so),t(Y),t(ro),t(Q),t(io),t(K),t(lo),t(x),t(co),t(bn)),t(d),b(N),b($e),b(ne,e),b(qe,e),b(Ie,e),b(Se),b(We,e),b(Ze),b(Xe),b(se),b(Ye),b(Qe),b(Ke),b(et),b(tt),b(le),b(nt),b(ot),b(at),b(me),b(st),b(rt),b(it),b(lt),b(dt),b(ct),b(mt),b(pt),b(fe),b(ht),b(ut),b(ft),b(_e),b(ve),b(gt),b(_t),b(vt),b(be)}}}const ar={local:"llama2",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.LlamaConfig",title:"LlamaConfig"},{local:"transformers.LlamaTokenizer",title:"LlamaTokenizer"},{local:"transformers.LlamaTokenizerFast",title:"LlamaTokenizerFast"},{local:"transformers.LlamaModel",title:"LlamaModel"},{local:"transformers.LlamaForCausalLM",title:"LlamaForCausalLM"},{local:"transformers.LlamaForSequenceClassification",title:"LlamaForSequenceClassification"}],title:"Llama2"};function sr(C){return Rs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ur extends Bs{constructor(d){super(),Vs(this,d,sr,or,Js,{})}}export{ur as component};
