import{s as Ds,o as Rs,n as Te}from"../chunks/scheduler.9bc65507.js";import{S as Vs,i as Bs,g as n,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,a as l,w as _,d as v,t as b,x as k}from"../chunks/index.78c82d43.js";import{T as Ln}from"../chunks/Tip.87d55b76.js";import{D as z}from"../chunks/Docstring.4e7352e2.js";import{C as co}from"../chunks/CodeBlock.73e038be.js";import{I as K}from"../chunks/IconCopyLink.bedaa44d.js";import{E as $n}from"../chunks/ExampleCodeBlock.872b014d.js";import{P as Js}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=n("p"),d.innerHTML=w,m=r(),y=n("p"),y.innerHTML=L,u=r(),M=n("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:Te,d(F){F&&(t(d),t(m),t(y),t(u),t(M))}}}function Os(C){let d,w;return d=new co({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYW1hTW9kZWwlMkMlMjBMbGFtYUNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBMTGFNQSUyMGxsYW1hLTdiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMExsYW1hQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjBmcm9tJTIwdGhlJTIwbGxhbWEtN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMExsYW1hTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaModel, LlamaConfig

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){f(d.$$.fragment)},l(m){g(d.$$.fragment,m)},m(m,y){_(d,m,y),w=!0},p:Te,i(m){w||(v(d.$$.fragment,m),w=!0)},o(m){b(d.$$.fragment,m),w=!1},d(m){k(d,m)}}}function Xs(C){let d,w="sequence pair mask has the following format:",m,y,L;return y=new co({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`,wrap:!1}}),{c(){d=n("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:Te,i(u){L||(v(y.$$.fragment,u),L=!0)},o(u){b(y.$$.fragment,u),L=!1},d(u){u&&(t(d),t(m)),k(y,u)}}}function Qs(C){let d,w;return d=new co({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>]`,wrap:!1}}),{c(){f(d.$$.fragment)},l(m){g(d.$$.fragment,m)},m(m,y){_(d,m,y),w=!0},p:Te,i(m){w||(v(d.$$.fragment,m),w=!0)},o(m){b(d.$$.fragment,m),w=!1},d(m){k(d,m)}}}function Ys(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=n("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:Te,d(m){m&&t(d)}}}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=n("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:Te,d(m){m&&t(d)}}}function er(C){let d,w="Example:",m,y,L;return y=new co({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>`,wrap:!1}}),{c(){d=n("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:Te,i(u){L||(v(y.$$.fragment,u),L=!0)},o(u){b(y.$$.fragment,u),L=!1},d(u){u&&(t(d),t(m)),k(y,u)}}}function tr(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=n("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:Te,d(m){m&&t(d)}}}function or(C){let d,w,m,y,L,u,M,N,F,E,$a="Llama2",$o,R,ee,mo,Le,Mn,Tt,Ma="Overview",Mo,$e,xa='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!',xo,Me,Ca="The abstract from the paper is the following:",Co,xe,za="<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>",zo,Ce,Fa='Checkout all Llama2 models <a href="https://huggingface.co/models?search=llama2" rel="nofollow">here</a>',Fo,te,qo,ze,qa="Tips:",Po,Fe,Pa='<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>',Ao,qe,Io,Pe,Aa="<li>After conversion, the model and tokenizer can be loaded via:</li>",Eo,Ae,Ho,Ie,Ia=`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.`,jo,Ee,Ea='<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>',So,He,Ha='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>.',No,V,oe,po,je,xn,Lt,ja="Resources",Uo,Se,Sa="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.",Wo,Ne,Na='<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>',Jo,Ue,Do,We,Ua='<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>',Ro,Je,Vo,De,Wa='<li>A <a href="https://colab.research.google.com/drive/1ggaa2oRFphdBmqIjSEbnb_HGkcIRC2ZB?usp=sharing" rel="nofollow">notebook</a> on how to fine-tune the Llama 2 model with QLoRa, TRL, and Korean text classification dataset. 🌎🇰🇷</li>',Bo,Re,Ja="⚗️ Optimization",Go,Ve,Da='<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>',Zo,Be,Ra="⚡️ Inference",Oo,Ge,Va='<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>',Xo,Ze,Ba="🚀 Deploy",Qo,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>',Yo,B,ne,ho,Xe,Cn,$t,Za="LlamaConfig",Ko,I,Qe,zn,Mt,Oa=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/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.`,Fn,xt,Xa=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,qn,ae,en,G,se,uo,Ye,Pn,Ct,Qa="LlamaTokenizer",tn,q,Ke,An,zt,Ya=`Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding. The default padding token is unset as there is
no padding token in the original model.`,In,Ft,et,En,re,tt,Hn,qt,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.`,jn,H,ot,Sn,Pt,es="Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT",Nn,ie,Un,At,ts="if token_ids_1 is None, only returns the first portion of the mask (0s).",Wn,le,nt,Jn,It,os="Save the vocabulary and special tokens file to a directory.",on,Z,de,fo,at,Dn,Et,ns="LlamaTokenizerFast",nn,T,st,Rn,Ht,as="Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding.",Vn,jt,ss="This uses notably ByteFallback and no normalization.",Bn,ce,Gn,St,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.`,Zn,Nt,is=`This tokenizer inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,On,Ut,rt,Xn,me,it,Qn,Wt,ls=`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.`,Yn,U,lt,Kn,Jt,ds=`Create the token type IDs corresponding to the sequences passed. <a href="../glossary#token-type-ids">What are token type
IDs?</a>`,ea,Dt,cs="Should be overridden in a subclass if the model has a special way of building those.",ta,pe,dt,oa,Rt,ms="Updates the underlying post processor with the current <code>bos_token</code> and <code>eos_token</code>.",na,Vt,ct,an,O,he,go,mt,aa,Bt,ps="LlamaModel",sn,P,pt,sa,Gt,hs=`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ra,Zt,us=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,ia,Ot,fs="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>LlamaDecoderLayer</code>",la,W,ht,da,Xt,gs='The <a href="/docs/transformers/v4.34.0/en/model_doc/llama2#transformers.LlamaModel">LlamaModel</a> forward method, overrides the <code>__call__</code> special method.',ca,ue,rn,X,fe,_o,ut,ma,Qt,_s="LlamaForCausalLM",ln,Q,ft,pa,j,gt,ha,Yt,vs='The <a href="/docs/transformers/v4.34.0/en/model_doc/llama2#transformers.LlamaForCausalLM">LlamaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',ua,ge,fa,_e,dn,Y,ve,vo,_t,ga,Kt,bs="LlamaForSequenceClassification",cn,x,vt,_a,eo,ks="The LLaMa Model transformer with a sequence classification head on top (linear layer).",va,to,ys=`<a href="/docs/transformers/v4.34.0/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,oo,ws=`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).`,ka,no,Ts=`This model inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,ya,ao,Ls=`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.`,wa,J,bt,Ta,so,$s='The <a href="/docs/transformers/v4.34.0/en/model_doc/llama2#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',La,be,mn,bo,pn;return N=new K({}),Le=new K({}),te=new Ln({props:{warning:!0,$$slots:{default:[Zs]},$$scope:{ctx:C}}}),qe=new co({props:{code:"cHl0aG9uJTIwc3JjJTJGdHJhbnNmb3JtZXJzJTJGbW9kZWxzJTJGbGxhbWElMkZjb252ZXJ0X2xsYW1hX3dlaWdodHNfdG9faGYucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLWlucHV0X2RpciUyMCUyRnBhdGglMkZ0byUyRmRvd25sb2FkZWQlMkZsbGFtYSUyRndlaWdodHMlMjAtLW1vZGVsX3NpemUlMjA3QiUyMC0tb3V0cHV0X2RpciUyMCUyRm91dHB1dCUyRnBhdGg=",highlighted:`python src/transformers/models/llama/convert_llama_weights_to_hf.py \\
    --input_dir /path/to/downloaded/llama/weights --model_size 7B --output_dir /output/path`,wrap:!1}}),Ae=new co({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYW1hRm9yQ2F1c2FsTE0lMkMlMjBMbGFtYVRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMExsYW1hVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjIlMkZvdXRwdXQlMkZwYXRoJTIyKSUwQW1vZGVsJTIwJTNEJTIwTGxhbWFGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyJTJGb3V0cHV0JTJGcGF0aCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaForCausalLM, LlamaTokenizer

tokenizer = LlamaTokenizer.from_pretrained(<span class="hljs-string">&quot;/output/path&quot;</span>)
model = LlamaForCausalLM.from_pretrained(<span class="hljs-string">&quot;/output/path&quot;</span>)`,wrap:!1}}),je=new K({}),Ue=new Js({props:{pipeline:"text-generation"}}),Je=new Js({props:{pipeline:"text-classification"}}),Xe=new K({}),Qe=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:"attention_bias",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the LLaMA model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.34.0/en/model_doc/llama2#transformers.LlamaModel">LlamaModel</a>`,name:"vocab_size"},{anchor:"transformers.LlamaConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.LlamaConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 11008) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.LlamaConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.LlamaConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.LlamaConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1 the model will use Multi Query Attention (MQA) otherwise GQA is used. When converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed by meanpooling all the original heads within that group. For more details checkout [this paper](https://arxiv.org/pdf/2305.13245.pdf). If it is not specified, will default to </code>num_attention_heads\`.`,name:"num_key_value_heads"},{anchor:"transformers.LlamaConfig.pretraining_tp",description:`<strong>pretraining_tp</strong> (<code>int</code>, <em>optional</em>, defaults to <code>1</code>) &#x2014;
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to <a href="https://huggingface.co/docs/transformers/parallelism" rel="nofollow">this
document</a> to understand more about it. This value is
necessary to ensure exact reproducibility of the pretraining results. Please refer to <a href="https://github.com/pytorch/pytorch/issues/76232" rel="nofollow">this
issue</a>.`,name:"pretraining_tp"},{anchor:"transformers.LlamaConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.LlamaConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length that this model might ever be used with. 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.`,name:"rope_scaling"},{anchor:"transformers.LlamaConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in the query, key, value and output projection layers during self-attention.</p>
<p>Example &#x2014;`,name:"attention_bias"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/configuration_llama.py#L31"}}),ae=new $n({props:{anchor:"transformers.LlamaConfig.example",$$slots:{default:[Os]},$$scope:{ctx:C}}}),Ye=new K({}),Ke=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.34.0/src/transformers/models/llama/tokenization_llama.py#L66"}}),et=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.34.0/src/transformers/models/llama/tokenization_llama.py#L296"}}),tt=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.34.0/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>
`}}),ot=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.34.0/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>
`}}),ie=new $n({props:{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Xs]},$$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.34.0/src/transformers/models/llama/tokenization_llama.py#L269",returnDescription:`
<p>Paths to the files saved.</p>
`,returnType:`
<p><code>Tuple(str)</code></p>
`}}),at=new K({}),st=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.34.0/src/transformers/models/llama/tokenization_llama_fast.py#L57"}}),ce=new $n({props:{anchor:"transformers.LlamaTokenizerFast.example",$$slots:{default:[Qs]},$$scope:{ctx:C}}}),rt=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LlamaTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:""},{name:"token_ids_1",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/tokenization_llama_fast.py#L255"}}),it=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.34.0/src/transformers/tokenization_utils_base.py#L3770",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>
`}}),lt=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.34.0/src/transformers/tokenization_utils_base.py#L3305",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),dt=new z({props:{name:"update_post_processor",anchor:"transformers.LlamaTokenizerFast.update_post_processor",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/tokenization_llama_fast.py#L142"}}),ct=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.34.0/src/transformers/models/llama/tokenization_llama_fast.py#L182"}}),mt=new K({}),pt=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.34.0/en/model_doc/llama2#transformers.LlamaConfig">LlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; LlamaConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/modeling_llama.py#L776"}}),ht=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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>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>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/modeling_llama.py#L827"}}),ue=new Ln({props:{$$slots:{default:[Ys]},$$scope:{ctx:C}}}),ut=new K({}),ft=new z({props:{name:"class transformers.LlamaForCausalLM",anchor:"transformers.LlamaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/modeling_llama.py#L960"}}),gt=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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>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>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/modeling_llama.py#L990",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.34.0/en/model_doc/llama2#transformers.LlamaConfig"
>LlamaConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — 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.34.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ge=new Ln({props:{$$slots:{default:[Ks]},$$scope:{ctx:C}}}),_e=new $n({props:{anchor:"transformers.LlamaForCausalLM.forward.example",$$slots:{default:[er]},$$scope:{ctx:C}}}),_t=new K({}),vt=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.34.0/en/model_doc/llama2#transformers.LlamaConfig">LlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/modeling_llama.py#L1139"}}),bt=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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>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>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/llama/modeling_llama.py#L1155"}}),be=new Ln({props:{$$slots:{default:[tr]},$$scope:{ctx:C}}}),{c(){d=n("meta"),w=r(),m=n("p"),y=r(),L=n("h1"),u=n("a"),M=n("span"),f(N.$$.fragment),F=r(),E=n("span"),E.textContent=$a,$o=r(),R=n("h2"),ee=n("a"),mo=n("span"),f(Le.$$.fragment),Mn=r(),Tt=n("span"),Tt.textContent=Ma,Mo=r(),$e=n("p"),$e.innerHTML=xa,xo=r(),Me=n("p"),Me.textContent=Ca,Co=r(),xe=n("p"),xe.innerHTML=za,zo=r(),Ce=n("p"),Ce.innerHTML=Fa,Fo=r(),f(te.$$.fragment),qo=r(),ze=n("p"),ze.textContent=qa,Po=r(),Fe=n("ul"),Fe.innerHTML=Pa,Ao=r(),f(qe.$$.fragment),Io=r(),Pe=n("ul"),Pe.innerHTML=Aa,Eo=r(),f(Ae.$$.fragment),Ho=r(),Ie=n("p"),Ie.textContent=Ia,jo=r(),Ee=n("ul"),Ee.innerHTML=Ea,So=r(),He=n("p"),He.innerHTML=Ha,No=r(),V=n("h2"),oe=n("a"),po=n("span"),f(je.$$.fragment),xn=r(),Lt=n("span"),Lt.textContent=ja,Uo=r(),Se=n("p"),Se.textContent=Sa,Wo=r(),Ne=n("ul"),Ne.innerHTML=Na,Jo=r(),f(Ue.$$.fragment),Do=r(),We=n("ul"),We.innerHTML=Ua,Ro=r(),f(Je.$$.fragment),Vo=r(),De=n("ul"),De.innerHTML=Wa,Bo=r(),Re=n("p"),Re.textContent=Ja,Go=r(),Ve=n("ul"),Ve.innerHTML=Da,Zo=r(),Be=n("p"),Be.textContent=Ra,Oo=r(),Ge=n("ul"),Ge.innerHTML=Va,Xo=r(),Ze=n("p"),Ze.textContent=Ba,Qo=r(),Oe=n("ul"),Oe.innerHTML=Ga,Yo=r(),B=n("h2"),ne=n("a"),ho=n("span"),f(Xe.$$.fragment),Cn=r(),$t=n("span"),$t.textContent=Za,Ko=r(),I=n("div"),f(Qe.$$.fragment),zn=r(),Mt=n("p"),Mt.innerHTML=Oa,Fn=r(),xt=n("p"),xt.innerHTML=Xa,qn=r(),f(ae.$$.fragment),en=r(),G=n("h2"),se=n("a"),uo=n("span"),f(Ye.$$.fragment),Pn=r(),Ct=n("span"),Ct.textContent=Qa,tn=r(),q=n("div"),f(Ke.$$.fragment),An=r(),zt=n("p"),zt.textContent=Ya,In=r(),Ft=n("div"),f(et.$$.fragment),En=r(),re=n("div"),f(tt.$$.fragment),Hn=r(),qt=n("p"),qt.innerHTML=Ka,jn=r(),H=n("div"),f(ot.$$.fragment),Sn=r(),Pt=n("p"),Pt.textContent=es,Nn=r(),f(ie.$$.fragment),Un=r(),At=n("p"),At.textContent=ts,Wn=r(),le=n("div"),f(nt.$$.fragment),Jn=r(),It=n("p"),It.textContent=os,on=r(),Z=n("h2"),de=n("a"),fo=n("span"),f(at.$$.fragment),Dn=r(),Et=n("span"),Et.textContent=ns,nn=r(),T=n("div"),f(st.$$.fragment),Rn=r(),Ht=n("p"),Ht.textContent=as,Vn=r(),jt=n("p"),jt.textContent=ss,Bn=r(),f(ce.$$.fragment),Gn=r(),St=n("p"),St.innerHTML=rs,Zn=r(),Nt=n("p"),Nt.innerHTML=is,On=r(),Ut=n("div"),f(rt.$$.fragment),Xn=r(),me=n("div"),f(it.$$.fragment),Qn=r(),Wt=n("p"),Wt.innerHTML=ls,Yn=r(),U=n("div"),f(lt.$$.fragment),Kn=r(),Jt=n("p"),Jt.innerHTML=ds,ea=r(),Dt=n("p"),Dt.textContent=cs,ta=r(),pe=n("div"),f(dt.$$.fragment),oa=r(),Rt=n("p"),Rt.innerHTML=ms,na=r(),Vt=n("div"),f(ct.$$.fragment),an=r(),O=n("h2"),he=n("a"),go=n("span"),f(mt.$$.fragment),aa=r(),Bt=n("span"),Bt.textContent=ps,sn=r(),P=n("div"),f(pt.$$.fragment),sa=r(),Gt=n("p"),Gt.innerHTML=hs,ra=r(),Zt=n("p"),Zt.innerHTML=us,ia=r(),Ot=n("p"),Ot.innerHTML=fs,la=r(),W=n("div"),f(ht.$$.fragment),da=r(),Xt=n("p"),Xt.innerHTML=gs,ca=r(),f(ue.$$.fragment),rn=r(),X=n("h2"),fe=n("a"),_o=n("span"),f(ut.$$.fragment),ma=r(),Qt=n("span"),Qt.textContent=_s,ln=r(),Q=n("div"),f(ft.$$.fragment),pa=r(),j=n("div"),f(gt.$$.fragment),ha=r(),Yt=n("p"),Yt.innerHTML=vs,ua=r(),f(ge.$$.fragment),fa=r(),f(_e.$$.fragment),dn=r(),Y=n("h2"),ve=n("a"),vo=n("span"),f(_t.$$.fragment),ga=r(),Kt=n("span"),Kt.textContent=bs,cn=r(),x=n("div"),f(vt.$$.fragment),_a=r(),eo=n("p"),eo.textContent=ks,va=r(),to=n("p"),to.innerHTML=ys,ba=r(),oo=n("p"),oo.innerHTML=ws,ka=r(),no=n("p"),no.innerHTML=Ts,ya=r(),ao=n("p"),ao.innerHTML=Ls,wa=r(),J=n("div"),f(bt.$$.fragment),Ta=r(),so=n("p"),so.innerHTML=$s,La=r(),f(be.$$.fragment),mn=r(),bo=n("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 ko=h(u);M=a(ko,"SPAN",{});var yo=h(M);g(N.$$.fragment,yo),yo.forEach(t),ko.forEach(t),F=i(kt),E=a(kt,"SPAN",{"data-svelte-h":!0}),c(E)!=="svelte-17w68hu"&&(E.textContent=$a),kt.forEach(t),$o=i(e),R=a(e,"H2",{class:!0});var yt=h(R);ee=a(yt,"A",{id:!0,class:!0,href:!0});var wo=h(ee);mo=a(wo,"SPAN",{});var To=h(mo);g(Le.$$.fragment,To),To.forEach(t),wo.forEach(t),Mn=i(yt),Tt=a(yt,"SPAN",{"data-svelte-h":!0}),c(Tt)!=="svelte-1jsw1pg"&&(Tt.textContent=Ma),yt.forEach(t),Mo=i(e),$e=a(e,"P",{"data-svelte-h":!0}),c($e)!=="svelte-xm2zag"&&($e.innerHTML=xa),xo=i(e),Me=a(e,"P",{"data-svelte-h":!0}),c(Me)!=="svelte-vfdo9a"&&(Me.textContent=Ca),Co=i(e),xe=a(e,"P",{"data-svelte-h":!0}),c(xe)!=="svelte-1wo3ztj"&&(xe.innerHTML=za),zo=i(e),Ce=a(e,"P",{"data-svelte-h":!0}),c(Ce)!=="svelte-forh14"&&(Ce.innerHTML=Fa),Fo=i(e),g(te.$$.fragment,e),qo=i(e),ze=a(e,"P",{"data-svelte-h":!0}),c(ze)!=="svelte-axv494"&&(ze.textContent=qa),Po=i(e),Fe=a(e,"UL",{"data-svelte-h":!0}),c(Fe)!=="svelte-tepalw"&&(Fe.innerHTML=Pa),Ao=i(e),g(qe.$$.fragment,e),Io=i(e),Pe=a(e,"UL",{"data-svelte-h":!0}),c(Pe)!=="svelte-yjbkch"&&(Pe.innerHTML=Aa),Eo=i(e),g(Ae.$$.fragment,e),Ho=i(e),Ie=a(e,"P",{"data-svelte-h":!0}),c(Ie)!=="svelte-199e5ee"&&(Ie.textContent=Ia),jo=i(e),Ee=a(e,"UL",{"data-svelte-h":!0}),c(Ee)!=="svelte-1xmggxn"&&(Ee.innerHTML=Ea),So=i(e),He=a(e,"P",{"data-svelte-h":!0}),c(He)!=="svelte-x3p6lc"&&(He.innerHTML=Ha),No=i(e),V=a(e,"H2",{class:!0});var wt=h(V);oe=a(wt,"A",{id:!0,class:!0,href:!0});var Lo=h(oe);po=a(Lo,"SPAN",{});var Ms=h(po);g(je.$$.fragment,Ms),Ms.forEach(t),Lo.forEach(t),xn=i(wt),Lt=a(wt,"SPAN",{"data-svelte-h":!0}),c(Lt)!=="svelte-w4zzv6"&&(Lt.textContent=ja),wt.forEach(t),Uo=i(e),Se=a(e,"P",{"data-svelte-h":!0}),c(Se)!=="svelte-1l10g8k"&&(Se.textContent=Sa),Wo=i(e),Ne=a(e,"UL",{"data-svelte-h":!0}),c(Ne)!=="svelte-189jef5"&&(Ne.innerHTML=Na),Jo=i(e),g(Ue.$$.fragment,e),Do=i(e),We=a(e,"UL",{"data-svelte-h":!0}),c(We)!=="svelte-1txpvb1"&&(We.innerHTML=Ua),Ro=i(e),g(Je.$$.fragment,e),Vo=i(e),De=a(e,"UL",{"data-svelte-h":!0}),c(De)!=="svelte-13c8j1g"&&(De.innerHTML=Wa),Bo=i(e),Re=a(e,"P",{"data-svelte-h":!0}),c(Re)!=="svelte-liq2q7"&&(Re.textContent=Ja),Go=i(e),Ve=a(e,"UL",{"data-svelte-h":!0}),c(Ve)!=="svelte-1xuj4g0"&&(Ve.innerHTML=Da),Zo=i(e),Be=a(e,"P",{"data-svelte-h":!0}),c(Be)!=="svelte-1wntqpp"&&(Be.textContent=Ra),Oo=i(e),Ge=a(e,"UL",{"data-svelte-h":!0}),c(Ge)!=="svelte-gxsehz"&&(Ge.innerHTML=Va),Xo=i(e),Ze=a(e,"P",{"data-svelte-h":!0}),c(Ze)!=="svelte-lk14e4"&&(Ze.textContent=Ba),Qo=i(e),Oe=a(e,"UL",{"data-svelte-h":!0}),c(Oe)!=="svelte-1f88qgk"&&(Oe.innerHTML=Ga),Yo=i(e),B=a(e,"H2",{class:!0});var hn=h(B);ne=a(hn,"A",{id:!0,class:!0,href:!0});var xs=h(ne);ho=a(xs,"SPAN",{});var Cs=h(ho);g(Xe.$$.fragment,Cs),Cs.forEach(t),xs.forEach(t),Cn=i(hn),$t=a(hn,"SPAN",{"data-svelte-h":!0}),c($t)!=="svelte-7iuhrk"&&($t.textContent=Za),hn.forEach(t),Ko=i(e),I=a(e,"DIV",{class:!0});var ke=h(I);g(Qe.$$.fragment,ke),zn=i(ke),Mt=a(ke,"P",{"data-svelte-h":!0}),c(Mt)!=="svelte-x8ltem"&&(Mt.innerHTML=Oa),Fn=i(ke),xt=a(ke,"P",{"data-svelte-h":!0}),c(xt)!=="svelte-10kqkkl"&&(xt.innerHTML=Xa),qn=i(ke),g(ae.$$.fragment,ke),ke.forEach(t),en=i(e),G=a(e,"H2",{class:!0});var un=h(G);se=a(un,"A",{id:!0,class:!0,href:!0});var zs=h(se);uo=a(zs,"SPAN",{});var Fs=h(uo);g(Ye.$$.fragment,Fs),Fs.forEach(t),zs.forEach(t),Pn=i(un),Ct=a(un,"SPAN",{"data-svelte-h":!0}),c(Ct)!=="svelte-1hr2ekz"&&(Ct.textContent=Qa),un.forEach(t),tn=i(e),q=a(e,"DIV",{class:!0});var S=h(q);g(Ke.$$.fragment,S),An=i(S),zt=a(S,"P",{"data-svelte-h":!0}),c(zt)!=="svelte-qfiu5a"&&(zt.textContent=Ya),In=i(S),Ft=a(S,"DIV",{class:!0});var qs=h(Ft);g(et.$$.fragment,qs),qs.forEach(t),En=i(S),re=a(S,"DIV",{class:!0});var fn=h(re);g(tt.$$.fragment,fn),Hn=i(fn),qt=a(fn,"P",{"data-svelte-h":!0}),c(qt)!=="svelte-1f4f5kp"&&(qt.innerHTML=Ka),fn.forEach(t),jn=i(S),H=a(S,"DIV",{class:!0});var ye=h(H);g(ot.$$.fragment,ye),Sn=i(ye),Pt=a(ye,"P",{"data-svelte-h":!0}),c(Pt)!=="svelte-13bfd60"&&(Pt.textContent=es),Nn=i(ye),g(ie.$$.fragment,ye),Un=i(ye),At=a(ye,"P",{"data-svelte-h":!0}),c(At)!=="svelte-wtrslu"&&(At.textContent=ts),ye.forEach(t),Wn=i(S),le=a(S,"DIV",{class:!0});var gn=h(le);g(nt.$$.fragment,gn),Jn=i(gn),It=a(gn,"P",{"data-svelte-h":!0}),c(It)!=="svelte-1slb66l"&&(It.textContent=os),gn.forEach(t),S.forEach(t),on=i(e),Z=a(e,"H2",{class:!0});var _n=h(Z);de=a(_n,"A",{id:!0,class:!0,href:!0});var Ps=h(de);fo=a(Ps,"SPAN",{});var As=h(fo);g(at.$$.fragment,As),As.forEach(t),Ps.forEach(t),Dn=i(_n),Et=a(_n,"SPAN",{"data-svelte-h":!0}),c(Et)!=="svelte-r8mzo5"&&(Et.textContent=ns),_n.forEach(t),nn=i(e),T=a(e,"DIV",{class:!0});var $=h(T);g(st.$$.fragment,$),Rn=i($),Ht=a($,"P",{"data-svelte-h":!0}),c(Ht)!=="svelte-15tdcz8"&&(Ht.textContent=as),Vn=i($),jt=a($,"P",{"data-svelte-h":!0}),c(jt)!=="svelte-llhmpa"&&(jt.textContent=ss),Bn=i($),g(ce.$$.fragment,$),Gn=i($),St=a($,"P",{"data-svelte-h":!0}),c(St)!=="svelte-cnb6q1"&&(St.innerHTML=rs),Zn=i($),Nt=a($,"P",{"data-svelte-h":!0}),c(Nt)!=="svelte-ttxvs6"&&(Nt.innerHTML=is),On=i($),Ut=a($,"DIV",{class:!0});var Is=h(Ut);g(rt.$$.fragment,Is),Is.forEach(t),Xn=i($),me=a($,"DIV",{class:!0});var vn=h(me);g(it.$$.fragment,vn),Qn=i(vn),Wt=a(vn,"P",{"data-svelte-h":!0}),c(Wt)!=="svelte-1wmjg8a"&&(Wt.innerHTML=ls),vn.forEach(t),Yn=i($),U=a($,"DIV",{class:!0});var ro=h(U);g(lt.$$.fragment,ro),Kn=i(ro),Jt=a(ro,"P",{"data-svelte-h":!0}),c(Jt)!=="svelte-zj1vf1"&&(Jt.innerHTML=ds),ea=i(ro),Dt=a(ro,"P",{"data-svelte-h":!0}),c(Dt)!=="svelte-9vptpw"&&(Dt.textContent=cs),ro.forEach(t),ta=i($),pe=a($,"DIV",{class:!0});var bn=h(pe);g(dt.$$.fragment,bn),oa=i(bn),Rt=a(bn,"P",{"data-svelte-h":!0}),c(Rt)!=="svelte-nfci2w"&&(Rt.innerHTML=ms),bn.forEach(t),na=i($),Vt=a($,"DIV",{class:!0});var Es=h(Vt);g(ct.$$.fragment,Es),Es.forEach(t),$.forEach(t),an=i(e),O=a(e,"H2",{class:!0});var kn=h(O);he=a(kn,"A",{id:!0,class:!0,href:!0});var Hs=h(he);go=a(Hs,"SPAN",{});var js=h(go);g(mt.$$.fragment,js),js.forEach(t),Hs.forEach(t),aa=i(kn),Bt=a(kn,"SPAN",{"data-svelte-h":!0}),c(Bt)!=="svelte-1txfp0z"&&(Bt.textContent=ps),kn.forEach(t),sn=i(e),P=a(e,"DIV",{class:!0});var D=h(P);g(pt.$$.fragment,D),sa=i(D),Gt=a(D,"P",{"data-svelte-h":!0}),c(Gt)!=="svelte-vmn8lj"&&(Gt.innerHTML=hs),ra=i(D),Zt=a(D,"P",{"data-svelte-h":!0}),c(Zt)!=="svelte-hswkmf"&&(Zt.innerHTML=us),ia=i(D),Ot=a(D,"P",{"data-svelte-h":!0}),c(Ot)!=="svelte-eom0yk"&&(Ot.innerHTML=fs),la=i(D),W=a(D,"DIV",{class:!0});var io=h(W);g(ht.$$.fragment,io),da=i(io),Xt=a(io,"P",{"data-svelte-h":!0}),c(Xt)!=="svelte-rfhgb8"&&(Xt.innerHTML=gs),ca=i(io),g(ue.$$.fragment,io),io.forEach(t),D.forEach(t),rn=i(e),X=a(e,"H2",{class:!0});var yn=h(X);fe=a(yn,"A",{id:!0,class:!0,href:!0});var Ss=h(fe);_o=a(Ss,"SPAN",{});var Ns=h(_o);g(ut.$$.fragment,Ns),Ns.forEach(t),Ss.forEach(t),ma=i(yn),Qt=a(yn,"SPAN",{"data-svelte-h":!0}),c(Qt)!=="svelte-nvcter"&&(Qt.textContent=_s),yn.forEach(t),ln=i(e),Q=a(e,"DIV",{class:!0});var wn=h(Q);g(ft.$$.fragment,wn),pa=i(wn),j=a(wn,"DIV",{class:!0});var we=h(j);g(gt.$$.fragment,we),ha=i(we),Yt=a(we,"P",{"data-svelte-h":!0}),c(Yt)!=="svelte-1l0p81g"&&(Yt.innerHTML=vs),ua=i(we),g(ge.$$.fragment,we),fa=i(we),g(_e.$$.fragment,we),we.forEach(t),wn.forEach(t),dn=i(e),Y=a(e,"H2",{class:!0});var Tn=h(Y);ve=a(Tn,"A",{id:!0,class:!0,href:!0});var Us=h(ve);vo=a(Us,"SPAN",{});var Ws=h(vo);g(_t.$$.fragment,Ws),Ws.forEach(t),Us.forEach(t),ga=i(Tn),Kt=a(Tn,"SPAN",{"data-svelte-h":!0}),c(Kt)!=="svelte-ftlzum"&&(Kt.textContent=bs),Tn.forEach(t),cn=i(e),x=a(e,"DIV",{class:!0});var A=h(x);g(vt.$$.fragment,A),_a=i(A),eo=a(A,"P",{"data-svelte-h":!0}),c(eo)!=="svelte-62must"&&(eo.textContent=ks),va=i(A),to=a(A,"P",{"data-svelte-h":!0}),c(to)!=="svelte-1uf9ne7"&&(to.innerHTML=ys),ba=i(A),oo=a(A,"P",{"data-svelte-h":!0}),c(oo)!=="svelte-10ugs3m"&&(oo.innerHTML=ws),ka=i(A),no=a(A,"P",{"data-svelte-h":!0}),c(no)!=="svelte-hmtw9k"&&(no.innerHTML=Ts),ya=i(A),ao=a(A,"P",{"data-svelte-h":!0}),c(ao)!=="svelte-hswkmf"&&(ao.innerHTML=Ls),wa=i(A),J=a(A,"DIV",{class:!0});var lo=h(J);g(bt.$$.fragment,lo),Ta=i(lo),so=a(lo,"P",{"data-svelte-h":!0}),c(so)!=="svelte-967wb6"&&(so.innerHTML=$s),La=i(lo),g(be.$$.fragment,lo),lo.forEach(t),A.forEach(t),mn=i(e),bo=a(e,"P",{}),h(bo).forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(nr)),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(ee,"id","overview"),p(ee,"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(ee,"href","#overview"),p(R,"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(ne,"id","transformers.LlamaConfig"),p(ne,"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(ne,"href","#transformers.LlamaConfig"),p(B,"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(se,"id","transformers.LlamaTokenizer"),p(se,"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(se,"href","#transformers.LlamaTokenizer"),p(G,"class","relative group"),p(Ft,"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,"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(le,"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(de,"id","transformers.LlamaTokenizerFast"),p(de,"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(de,"href","#transformers.LlamaTokenizerFast"),p(Z,"class","relative group"),p(Ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(Vt,"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(he,"id","transformers.LlamaModel"),p(he,"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(he,"href","#transformers.LlamaModel"),p(O,"class","relative group"),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(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(fe,"id","transformers.LlamaForCausalLM"),p(fe,"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(fe,"href","#transformers.LlamaForCausalLM"),p(X,"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(ve,"id","transformers.LlamaForSequenceClassification"),p(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ve,"href","#transformers.LlamaForSequenceClassification"),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(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){o(document.head,d),l(e,w,s),l(e,m,s),l(e,y,s),l(e,L,s),o(L,u),o(u,M),_(N,M,null),o(L,F),o(L,E),l(e,$o,s),l(e,R,s),o(R,ee),o(ee,mo),_(Le,mo,null),o(R,Mn),o(R,Tt),l(e,Mo,s),l(e,$e,s),l(e,xo,s),l(e,Me,s),l(e,Co,s),l(e,xe,s),l(e,zo,s),l(e,Ce,s),l(e,Fo,s),_(te,e,s),l(e,qo,s),l(e,ze,s),l(e,Po,s),l(e,Fe,s),l(e,Ao,s),_(qe,e,s),l(e,Io,s),l(e,Pe,s),l(e,Eo,s),_(Ae,e,s),l(e,Ho,s),l(e,Ie,s),l(e,jo,s),l(e,Ee,s),l(e,So,s),l(e,He,s),l(e,No,s),l(e,V,s),o(V,oe),o(oe,po),_(je,po,null),o(V,xn),o(V,Lt),l(e,Uo,s),l(e,Se,s),l(e,Wo,s),l(e,Ne,s),l(e,Jo,s),_(Ue,e,s),l(e,Do,s),l(e,We,s),l(e,Ro,s),_(Je,e,s),l(e,Vo,s),l(e,De,s),l(e,Bo,s),l(e,Re,s),l(e,Go,s),l(e,Ve,s),l(e,Zo,s),l(e,Be,s),l(e,Oo,s),l(e,Ge,s),l(e,Xo,s),l(e,Ze,s),l(e,Qo,s),l(e,Oe,s),l(e,Yo,s),l(e,B,s),o(B,ne),o(ne,ho),_(Xe,ho,null),o(B,Cn),o(B,$t),l(e,Ko,s),l(e,I,s),_(Qe,I,null),o(I,zn),o(I,Mt),o(I,Fn),o(I,xt),o(I,qn),_(ae,I,null),l(e,en,s),l(e,G,s),o(G,se),o(se,uo),_(Ye,uo,null),o(G,Pn),o(G,Ct),l(e,tn,s),l(e,q,s),_(Ke,q,null),o(q,An),o(q,zt),o(q,In),o(q,Ft),_(et,Ft,null),o(q,En),o(q,re),_(tt,re,null),o(re,Hn),o(re,qt),o(q,jn),o(q,H),_(ot,H,null),o(H,Sn),o(H,Pt),o(H,Nn),_(ie,H,null),o(H,Un),o(H,At),o(q,Wn),o(q,le),_(nt,le,null),o(le,Jn),o(le,It),l(e,on,s),l(e,Z,s),o(Z,de),o(de,fo),_(at,fo,null),o(Z,Dn),o(Z,Et),l(e,nn,s),l(e,T,s),_(st,T,null),o(T,Rn),o(T,Ht),o(T,Vn),o(T,jt),o(T,Bn),_(ce,T,null),o(T,Gn),o(T,St),o(T,Zn),o(T,Nt),o(T,On),o(T,Ut),_(rt,Ut,null),o(T,Xn),o(T,me),_(it,me,null),o(me,Qn),o(me,Wt),o(T,Yn),o(T,U),_(lt,U,null),o(U,Kn),o(U,Jt),o(U,ea),o(U,Dt),o(T,ta),o(T,pe),_(dt,pe,null),o(pe,oa),o(pe,Rt),o(T,na),o(T,Vt),_(ct,Vt,null),l(e,an,s),l(e,O,s),o(O,he),o(he,go),_(mt,go,null),o(O,aa),o(O,Bt),l(e,sn,s),l(e,P,s),_(pt,P,null),o(P,sa),o(P,Gt),o(P,ra),o(P,Zt),o(P,ia),o(P,Ot),o(P,la),o(P,W),_(ht,W,null),o(W,da),o(W,Xt),o(W,ca),_(ue,W,null),l(e,rn,s),l(e,X,s),o(X,fe),o(fe,_o),_(ut,_o,null),o(X,ma),o(X,Qt),l(e,ln,s),l(e,Q,s),_(ft,Q,null),o(Q,pa),o(Q,j),_(gt,j,null),o(j,ha),o(j,Yt),o(j,ua),_(ge,j,null),o(j,fa),_(_e,j,null),l(e,dn,s),l(e,Y,s),o(Y,ve),o(ve,vo),_(_t,vo,null),o(Y,ga),o(Y,Kt),l(e,cn,s),l(e,x,s),_(vt,x,null),o(x,_a),o(x,eo),o(x,va),o(x,to),o(x,ba),o(x,oo),o(x,ka),o(x,no),o(x,ya),o(x,ao),o(x,wa),o(x,J),_(bt,J,null),o(J,Ta),o(J,so),o(J,La),_(be,J,null),l(e,mn,s),l(e,bo,s),pn=!0},p(e,[s]){const kt={};s&2&&(kt.$$scope={dirty:s,ctx:e}),te.$set(kt);const ko={};s&2&&(ko.$$scope={dirty:s,ctx:e}),ae.$set(ko);const yo={};s&2&&(yo.$$scope={dirty:s,ctx:e}),ie.$set(yo);const yt={};s&2&&(yt.$$scope={dirty:s,ctx:e}),ce.$set(yt);const wo={};s&2&&(wo.$$scope={dirty:s,ctx:e}),ue.$set(wo);const To={};s&2&&(To.$$scope={dirty:s,ctx:e}),ge.$set(To);const wt={};s&2&&(wt.$$scope={dirty:s,ctx:e}),_e.$set(wt);const Lo={};s&2&&(Lo.$$scope={dirty:s,ctx:e}),be.$set(Lo)},i(e){pn||(v(N.$$.fragment,e),v(Le.$$.fragment,e),v(te.$$.fragment,e),v(qe.$$.fragment,e),v(Ae.$$.fragment,e),v(je.$$.fragment,e),v(Ue.$$.fragment,e),v(Je.$$.fragment,e),v(Xe.$$.fragment,e),v(Qe.$$.fragment,e),v(ae.$$.fragment,e),v(Ye.$$.fragment,e),v(Ke.$$.fragment,e),v(et.$$.fragment,e),v(tt.$$.fragment,e),v(ot.$$.fragment,e),v(ie.$$.fragment,e),v(nt.$$.fragment,e),v(at.$$.fragment,e),v(st.$$.fragment,e),v(ce.$$.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(ht.$$.fragment,e),v(ue.$$.fragment,e),v(ut.$$.fragment,e),v(ft.$$.fragment,e),v(gt.$$.fragment,e),v(ge.$$.fragment,e),v(_e.$$.fragment,e),v(_t.$$.fragment,e),v(vt.$$.fragment,e),v(bt.$$.fragment,e),v(be.$$.fragment,e),pn=!0)},o(e){b(N.$$.fragment,e),b(Le.$$.fragment,e),b(te.$$.fragment,e),b(qe.$$.fragment,e),b(Ae.$$.fragment,e),b(je.$$.fragment,e),b(Ue.$$.fragment,e),b(Je.$$.fragment,e),b(Xe.$$.fragment,e),b(Qe.$$.fragment,e),b(ae.$$.fragment,e),b(Ye.$$.fragment,e),b(Ke.$$.fragment,e),b(et.$$.fragment,e),b(tt.$$.fragment,e),b(ot.$$.fragment,e),b(ie.$$.fragment,e),b(nt.$$.fragment,e),b(at.$$.fragment,e),b(st.$$.fragment,e),b(ce.$$.fragment,e),b(rt.$$.fragment,e),b(it.$$.fragment,e),b(lt.$$.fragment,e),b(dt.$$.fragment,e),b(ct.$$.fragment,e),b(mt.$$.fragment,e),b(pt.$$.fragment,e),b(ht.$$.fragment,e),b(ue.$$.fragment,e),b(ut.$$.fragment,e),b(ft.$$.fragment,e),b(gt.$$.fragment,e),b(ge.$$.fragment,e),b(_e.$$.fragment,e),b(_t.$$.fragment,e),b(vt.$$.fragment,e),b(bt.$$.fragment,e),b(be.$$.fragment,e),pn=!1},d(e){e&&(t(w),t(m),t(y),t(L),t($o),t(R),t(Mo),t($e),t(xo),t(Me),t(Co),t(xe),t(zo),t(Ce),t(Fo),t(qo),t(ze),t(Po),t(Fe),t(Ao),t(Io),t(Pe),t(Eo),t(Ho),t(Ie),t(jo),t(Ee),t(So),t(He),t(No),t(V),t(Uo),t(Se),t(Wo),t(Ne),t(Jo),t(Do),t(We),t(Ro),t(Vo),t(De),t(Bo),t(Re),t(Go),t(Ve),t(Zo),t(Be),t(Oo),t(Ge),t(Xo),t(Ze),t(Qo),t(Oe),t(Yo),t(B),t(Ko),t(I),t(en),t(G),t(tn),t(q),t(on),t(Z),t(nn),t(T),t(an),t(O),t(sn),t(P),t(rn),t(X),t(ln),t(Q),t(dn),t(Y),t(cn),t(x),t(mn),t(bo)),t(d),k(N),k(Le),k(te,e),k(qe,e),k(Ae,e),k(je),k(Ue,e),k(Je,e),k(Xe),k(Qe),k(ae),k(Ye),k(Ke),k(et),k(tt),k(ot),k(ie),k(nt),k(at),k(st),k(ce),k(rt),k(it),k(lt),k(dt),k(ct),k(mt),k(pt),k(ht),k(ue),k(ut),k(ft),k(gt),k(ge),k(_e),k(_t),k(vt),k(bt),k(be)}}}const nr={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 ar(C){return Rs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hr extends Vs{constructor(d){super(),Bs(this,d,ar,or,Ds,{})}}export{hr as component};
