import{s as ga,o as _a,n as tt}from"../chunks/scheduler.56730f09.js";import{S as ba,i as ka,g as i,s as n,r as p,A as va,h as l,f as o,c as a,j as T,u,x as m,k as $,y as s,a as r,v as h,d as f,t as g,w as _}from"../chunks/index.1f144517.js";import{T as vn}from"../chunks/Tip.41e845e5.js";import{D as w,E as Mo}from"../chunks/ExampleCodeBlock.e82611a0.js";import{C as Pt}from"../chunks/CodeBlock.738eeccb.js";import{P as fa}from"../chunks/PipelineTag.82d6c31e.js";import{H as Z,E as ya}from"../chunks/EditOnGithub.854793f1.js";function La(C){let d,v;return d=new Pt({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(){p(d.$$.fragment)},l(c){u(d.$$.fragment,c)},m(c,k){h(d,c,k),v=!0},p:tt,i(c){v||(f(d.$$.fragment,c),v=!0)},o(c){g(d.$$.fragment,c),v=!1},d(c){_(d,c)}}}function Ta(C){let d,v="sequence pair mask has the following format:",c,k,M;return k=new Pt({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=i("p"),d.textContent=v,c=n(),p(k.$$.fragment)},l(b){d=l(b,"P",{"data-svelte-h":!0}),m(d)!=="svelte-16klr56"&&(d.textContent=v),c=a(b),u(k.$$.fragment,b)},m(b,F){r(b,d,F),r(b,c,F),h(k,b,F),M=!0},p:tt,i(b){M||(f(k.$$.fragment,b),M=!0)},o(b){g(k.$$.fragment,b),M=!1},d(b){b&&(o(d),o(c)),_(k,b)}}}function $a(C){let d,v;return d=new Pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYW1hVG9rZW5pemVyRmFzdCUwQSUwQXRva2VuaXplciUyMCUzRCUyMExsYW1hVG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIyaGYtaW50ZXJuYWwtdGVzdGluZyUyRmxsYW1hLXRva2VuaXplciUyMiklMEF0b2tlbml6ZXIuZW5jb2RlKCUyMkhlbGxvJTIwdGhpcyUyMGlzJTIwYSUyMHRlc3QlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaTokenizerFast

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = LlamaTokenizerFast.from_pretrained(<span class="hljs-string">&quot;hf-internal-testing/llama-tokenizer&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.encode(<span class="hljs-string">&quot;Hello this is a test&quot;</span>)
[<span class="hljs-number">1</span>, <span class="hljs-number">15043</span>, <span class="hljs-number">445</span>, <span class="hljs-number">338</span>, <span class="hljs-number">263</span>, <span class="hljs-number">1243</span>]`,wrap:!1}}),{c(){p(d.$$.fragment)},l(c){u(d.$$.fragment,c)},m(c,k){h(d,c,k),v=!0},p:tt,i(c){v||(f(d.$$.fragment,c),v=!0)},o(c){g(d.$$.fragment,c),v=!1},d(c){_(d,c)}}}function xa(C){let d,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){d=i("p"),d.innerHTML=v},l(c){d=l(c,"P",{"data-svelte-h":!0}),m(d)!=="svelte-fincs2"&&(d.innerHTML=v)},m(c,k){r(c,d,k)},p:tt,d(c){c&&o(d)}}}function wa(C){let d,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){d=i("p"),d.innerHTML=v},l(c){d=l(c,"P",{"data-svelte-h":!0}),m(d)!=="svelte-fincs2"&&(d.innerHTML=v)},m(c,k){r(c,d,k)},p:tt,d(c){c&&o(d)}}}function Ma(C){let d,v="Example:",c,k,M;return k=new Pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMbGFtYUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBMbGFtYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJtZXRhLWxsYW1hJTJGTGxhbWEtMi03Yi1oZiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtZXRhLWxsYW1hJTJGTGxhbWEtMi03Yi1oZiUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LlamaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LlamaForCausalLM.from_pretrained(<span class="hljs-string">&quot;meta-llama/Llama-2-7b-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;meta-llama/Llama-2-7b-hf&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you conscious? Can you talk to me?\\nI&#x27;m not conscious, but I can talk to you.&quot;</span>`,wrap:!1}}),{c(){d=i("p"),d.textContent=v,c=n(),p(k.$$.fragment)},l(b){d=l(b,"P",{"data-svelte-h":!0}),m(d)!=="svelte-11lpom8"&&(d.textContent=v),c=a(b),u(k.$$.fragment,b)},m(b,F){r(b,d,F),r(b,c,F),h(k,b,F),M=!0},p:tt,i(b){M||(f(k.$$.fragment,b),M=!0)},o(b){g(k.$$.fragment,b),M=!1},d(b){b&&(o(d),o(c)),_(k,b)}}}function za(C){let d,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){d=i("p"),d.innerHTML=v},l(c){d=l(c,"P",{"data-svelte-h":!0}),m(d)!=="svelte-fincs2"&&(d.innerHTML=v)},m(c,k){r(c,d,k)},p:tt,d(c){c&&o(d)}}}function Ca(C){let d,v,c,k,M,b,F,Ht,ne,yn='LLaMA 모델은 Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, Guillaume Lample에 의해 제안된 <a href="https://arxiv.org/abs/2302.13971" rel="nofollow">LLaMA: Open and Efficient Foundation Language Models</a>에서 소개되었습니다. 이 모델은 7B에서 65B개의 파라미터까지 다양한 크기의 기초 언어 모델을 모아놓은 것입니다.',At,ae,Ln="논문의 초록은 다음과 같습니다:",Et,se,Tn="<em>“LLaMA는 7B에서 65B개의 파라미터 수를 가진 기초 언어 모델의 모음입니다. 우리는 수조 개의 토큰으로 모델을 훈련시켰고, 공개적으로 이용 가능한 데이터셋만을 사용하여 최고 수준의 모델을 훈련시킬 수 있음을 보여줍니다. 특히, LLaMA-13B 모델은 대부분의 벤치마크에서 GPT-3 (175B)를 능가하며, LLaMA-65B는 최고 수준의 모델인 Chinchilla-70B와 PaLM-540B에 버금가는 성능을 보입니다. 우리는 모든 모델을 연구 커뮤니티에 공개합니다.”</em>",St,re,$n="팁:",Nt,ie,xn='<li>LLaMA 모델의 가중치는 <a href="https://docs.google.com/forms/d/e/1FAIpQLSfqNECQnMkycAp2jP4Z9TFX0cGR4uf7b_fBxjY_OjhJILlKGA/viewform?usp=send_form" rel="nofollow">이 양식</a>을 작성하여 얻을 수 있습니다.</li> <li>가중치를 다운로드한 후에는 이를 <a href="https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/convert_llama_weights_to_hf.py" rel="nofollow">변환 스크립트</a>를 사용하여 Hugging Face Transformers 형식으로 변환해야합니다. 변환 스크립트를 실행하려면 아래의 예시 명령어를 참고하세요:</li>',Jt,le,Gt,de,wn="<li>변환을 하였다면 모델과 토크나이저는 다음과 같이 로드할 수 있습니다:</li>",Zt,ce,Dt,me,Mn="스크립트를 실행하기 위해서는 모델을 float16 정밀도로 전부 로드할 수 있을 만큼의 충분한 CPU RAM이 필요합니다. (가장 큰 버전의 모델이 여러 체크포인트로 나뉘어 있더라도, 각 체크포인트는 모델의 각 가중치의 일부를 포함하고 있기 때문에 모든 체크포인트를 RAM에 로드해야 합니다) 65B 모델의 경우, 총 130GB의 RAM이 필요합니다.",Bt,pe,zn='<li>LLaMA 토크나이저는 <a href="https://github.com/google/sentencepiece" rel="nofollow">sentencepiece</a>를 기반으로 하는 BPE 모델입니다. sentencepiece의 특징 중 하나는 시퀀스를 디코딩할 때 첫 토큰이 단어의 시작이라면 (예를 들어 “Banana”), 토크나이저는 문자열 앞에 공백을 추가하지 않는다는 것입니다.</li>',Rt,ue,Cn='이 모델은 <a href="https://huggingface.co/BlackSamorez" rel="nofollow">BlackSamorez</a>의 기여와 함께, <a href="https://huggingface.co/zphang" rel="nofollow">zphang</a>에 의해 제공되었습니다. Hugging Face에서의 구현 코드는 GPT-NeoX를 기반으로 하며 <a href="https://github.com/EleutherAI/gpt-neox" rel="nofollow">여기</a>에서 찾을 수 있고, 저자의 코드 원본은 <a href="https://github.com/facebookresearch/llama" rel="nofollow">여기</a>에서 확인할 수 있습니다.',Vt,he,Fn="원래 LLaMA 모델을 기반으로 Meta AI에서 몇 가지 후속 작업을 발표했습니다:",Xt,fe,qn='<li><strong>Llama2</strong>: Llama2는 구조적인 몇 가지 수정(Grouped Query Attention)을 통해 개선된 버전이며, 2조 개의 토큰으로 사전 훈련이 되어 있습니다. Llama2에 대한 자세한 내용은 <a href="llama2">이 문서</a>를 참고하세요.</li>',Ot,ge,Yt,_e,jn="LLaMA를 시작하는 데 도움이 될 Hugging Face 및 커뮤니티(🌎로 표시)의 공식 자료 목록입니다. 여기에 자료를 제출하고 싶다면 Pull Request를 올려주세요! 추가할 자료는 기존의 자료와 중복되지 않고 새로운 내용을 보여주는 것이 좋습니다.",Qt,be,Kt,ke,In='<li>LLaMA 모델을 텍스트 분류 작업에 적용하기 위한 프롬프트 튜닝 방법에 대한 <a href="https://colab.research.google.com/github/bigscience-workshop/petals/blob/main/examples/prompt-tuning-sst2.ipynb#scrollTo=f04ba4d2" rel="nofollow">노트북</a> 🌎</li>',eo,ve,to,ye,Pn='<li><a href="https://stackexchange.com/" rel="nofollow">Stack Exchange</a>에서 질문에 답하는 LLaMA를 훈련하는 방법을 위한 <a href="https://huggingface.co/blog/stackllama#stackllama-a-hands-on-guide-to-train-llama-with-rlhf" rel="nofollow">StackLLaMA: RLHF로 LLaMA를 훈련하는 실전 가이드</a> 🌎</li>',oo,Le,Wn="⚗️ 최적화",no,Te,Un='<li>제한된 메모리를 가진 GPU에서 xturing 라이브러리를 사용하여 LLaMA 모델을 미세 조정하는 방법에 대한 <a href="https://colab.research.google.com/drive/1SQUXq1AMZPSLD4mk3A3swUIc6Y2dclme?usp=sharing" rel="nofollow">노트북</a> 🌎</li>',ao,$e,Hn="⚡️ 추론",so,xe,An='<li>🤗 PEFT 라이브러리의 PeftModel을 사용하여 LLaMA 모델을 실행하는 방법에 대한 <a href="https://colab.research.google.com/github/DominguesM/alpaca-lora-ptbr-7b/blob/main/notebooks/02%20-%20Evaluate.ipynb" rel="nofollow">노트북</a> 🌎</li> <li>LangChain을 사용하여 PEFT 어댑터 LLaMA 모델을 로드하는 방법에 대한 <a href="https://colab.research.google.com/drive/1l2GiSSPbajVyp2Nk3CFT4t3uH6-5TiBe?usp=sharing" rel="nofollow">노트북</a> 🌎</li>',ro,we,En="🚀 배포",io,Me,Sn='<li>🤗 PEFT 라이브러리와 사용자 친화적인 UI로 LLaMA 모델을 미세 조정하는 방법에 대한 <a href="https://colab.research.google.com/github/lxe/simple-llama-finetuner/blob/master/Simple_LLaMA_FineTuner.ipynb#scrollTo=3PM_DilAZD8T" rel="nofollow">노트북</a> 🌎</li> <li>Amazon SageMaker에서 텍스트 생성을 위해 Open-LLaMA 모델을 배포하는 방법에 대한 <a href="https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/jumpstart-foundation-models/text-generation-open-llama.ipynb" rel="nofollow">노트북</a> 🌎</li>',lo,ze,co,P,Ce,zo,ot,Nn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/pr_30530/ko/model_doc/llama#transformers.LlamaModel">LlamaModel</a>. It is used to instantiate an LLaMA
model according to the specified arguments, defining the model architecture. Instantiating a configuration with the
defaults will yield a similar configuration to that of the LLaMA-7B.`,Co,nt,Jn=`Configuration objects inherit from <code>PretrainedConfig</code> and can be used to control the model outputs. Read the
documentation from <code>PretrainedConfig</code> for more information.`,Fo,D,mo,Fe,po,z,qe,qo,at,Gn=`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.`,jo,st,je,Io,B,Ie,Po,rt,Zn=`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.`,Wo,W,Pe,Uo,it,Dn="Creates a mask from the two sequences passed to be used in a sequence-pair classification task. An ALBERT",Ho,R,Ao,lt,Bn="if token_ids_1 is None, only returns the first portion of the mask (0s).",Eo,V,We,So,dt,Rn="Save the vocabulary and special tokens file to a directory.",uo,Ue,ho,y,He,No,ct,Vn="Construct a Llama tokenizer. Based on byte-level Byte-Pair-Encoding.",Jo,mt,Xn="This uses notably ByteFallback and no normalization.",Go,X,Zo,pt,On=`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.`,Do,ut,Yn=`This tokenizer inherits from <code>PreTrainedTokenizerFast</code> which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`,Bo,ht,Ae,Ro,O,Ee,Vo,ft,Qn=`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.`,Xo,E,Se,Oo,gt,Kn=`Create the token type IDs corresponding to the sequences passed. <a href="../glossary#token-type-ids">What are token type
IDs?</a>`,Yo,_t,ea="Should be overridden in a subclass if the model has a special way of building those.",Qo,Y,Ne,Ko,bt,ta="Updates the underlying post processor with the current <code>bos_token</code> and <code>eos_token</code>.",en,kt,Je,fo,Ge,go,q,Ze,tn,vt,oa=`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from <code>PreTrainedModel</code>. 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.)`,on,yt,na=`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.`,nn,Lt,aa="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>LlamaDecoderLayer</code>",an,S,De,sn,Tt,sa='The <a href="/docs/transformers/pr_30530/ko/model_doc/llama#transformers.LlamaModel">LlamaModel</a> forward method, overrides the <code>__call__</code> special method.',rn,Q,_o,Be,bo,G,Re,ln,U,Ve,dn,$t,ra='The <a href="/docs/transformers/pr_30530/ko/model_doc/llama#transformers.LlamaForCausalLM">LlamaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',cn,K,mn,ee,ko,Xe,vo,x,Oe,pn,xt,ia="The LLaMa Model transformer with a sequence classification head on top (linear layer).",un,wt,la=`<a href="/docs/transformers/pr_30530/ko/model_doc/llama#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> uses the last token in order to do the classification, as other causal models
(e.g. GPT-2) do.`,hn,Mt,da=`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).`,fn,zt,ca=`This model inherits from <code>PreTrainedModel</code>. 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.)`,gn,Ct,ma=`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.`,_n,N,Ye,bn,Ft,pa='The <a href="/docs/transformers/pr_30530/ko/model_doc/llama#transformers.LlamaForSequenceClassification">LlamaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',kn,te,yo,Qe,Lo,Wt,To;return M=new Z({props:{title:"LLaMA",local:"llama",headingTag:"h1"}}),F=new Z({props:{title:"개요",local:"overview",headingTag:"h2"}}),le=new Pt({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}}),ce=new Pt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExsYW1hRm9yQ2F1c2FsTE0lMkMlMjBMbGFtYVRva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMExsYW1hVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjIlMkZvdXRwdXQlMkZwYXRoJTIyKSUwQW1vZGVsJTIwJTNEJTIwTGxhbWFGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyJTJGb3V0cHV0JTJGcGF0aCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LlamaForCausalLM, LlamaTokenizer

tokenizer = LlamaTokenizer.from_pretrained(<span class="hljs-string">&quot;/output/path&quot;</span>)
model = LlamaForCausalLM.from_pretrained(<span class="hljs-string">&quot;/output/path&quot;</span>)`,wrap:!1}}),ge=new Z({props:{title:"리소스",local:"resources",headingTag:"h2"}}),be=new fa({props:{pipeline:"text-classification"}}),ve=new fa({props:{pipeline:"question-answering"}}),ze=new Z({props:{title:"LlamaConfig",local:"llamaconfig ][ transformers.LlamaConfig",headingTag:"h2"}}),Ce=new w({props:{name:"class transformers.LlamaConfig",anchor:"transformers.LlamaConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 11008"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"num_key_value_heads",val:" = None"},{name:"hidden_act",val:" = 'silu'"},{name:"max_position_embeddings",val:" = 2048"},{name:"initializer_range",val:" = 0.02"},{name:"rms_norm_eps",val:" = 1e-06"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = None"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"pretraining_tp",val:" = 1"},{name:"tie_word_embeddings",val:" = False"},{name:"rope_theta",val:" = 10000.0"},{name:"rope_scaling",val:" = None"},{name:"attention_bias",val:" = False"},{name:"attention_dropout",val:" = 0.0"},{name:"mlp_bias",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the LLaMA model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/pr_30530/ko/model_doc/llama#transformers.LlamaModel">LlamaModel</a>`,name:"vocab_size"},{anchor:"transformers.LlamaConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.LlamaConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 11008) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.LlamaConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer decoder.`,name:"num_hidden_layers"},{anchor:"transformers.LlamaConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer decoder.`,name:"num_attention_heads"},{anchor:"transformers.LlamaConfig.num_key_value_heads",description:`<strong>num_key_value_heads</strong> (<code>int</code>, <em>optional</em>) &#x2014;
This is the number of key_value heads that should be used to implement Grouped Query Attention. If
<code>num_key_value_heads=num_attention_heads</code>, the model will use Multi Head Attention (MHA), if
<code>num_key_value_heads=1</code> 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 <a href="https://arxiv.org/pdf/2305.13245.pdf" rel="nofollow">this
paper</a>. If it is not specified, will default to
<code>num_attention_heads</code>.`,name:"num_key_value_heads"},{anchor:"transformers.LlamaConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.LlamaConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length that this model might ever be used with. Llama 1 supports up to 2048 tokens,
Llama 2 up to 4096, CodeLlama up to 16384.`,name:"max_position_embeddings"},{anchor:"transformers.LlamaConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.LlamaConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.LlamaConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.LlamaConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.LlamaConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.LlamaConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.LlamaConfig.pretraining_tp",description:`<strong>pretraining_tp</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Experimental feature. Tensor parallelism rank used during pretraining. Please refer to <a href="https://huggingface.co/docs/transformers/main/perf_train_gpu_many#tensor-parallelism" rel="nofollow">this
document</a> to understand more about it. This value is
necessary to ensure exact reproducibility of the pretraining results. Please refer to <a href="https://github.com/pytorch/pytorch/issues/76232" rel="nofollow">this
issue</a>.`,name:"pretraining_tp"},{anchor:"transformers.LlamaConfig.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings"},{anchor:"transformers.LlamaConfig.rope_theta",description:`<strong>rope_theta</strong> (<code>float</code>, <em>optional</em>, defaults to 10000.0) &#x2014;
The base period of the RoPE embeddings.`,name:"rope_theta"},{anchor:"transformers.LlamaConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Dictionary containing the scaling configuration for the RoPE embeddings. IMPORTANT: RoPE scaling expects
<code>max_position_embeddings</code> to remain unchanged &#x2014; some methods, like &#x2018;longrope&#x2019;, require the original value
to determine which scaling to apply.
Expected contents:
<code>rope_type</code> (<code>str</code>):
The sub-variant of RoPE to use. Can be one of [&#x2018;default&#x2019;, &#x2018;linear&#x2019;, &#x2018;dynamic&#x2019;, &#x2018;yarn&#x2019;, &#x2018;longrope&#x2019;],
with &#x2018;default&#x2019; being the original RoPE implementation.
<code>factor</code> (<code>float</code>, <em>optional</em>):
Used with all rope types except &#x2018;default&#x2019;. The scaling factor to apply to the RoPE embeddings. In
most scaling types, a <code>factor</code> of x will enable the model to handle sequences of length x <em>
<code>max_position_embeddings</code>.
<code>attention_factor</code> (<code>float</code>, </em>optional<em>):
Used with &#x2018;yarn&#x2019; and &#x2018;longrope&#x2019;. The scaling factor to be applied on the attention
computation. If unspecified, it defaults to value recommended by the implementation, using the
<code>factor</code> field to infer the suggested value.
<code>beta_fast</code> (<code>float</code>, </em>optional<em>):
Only used with &#x2018;yarn&#x2019;. Parameter to set the boundary for extrapolation (only) in the linear
ramp function. If unspecified, it defaults to 32.
<code>beta_slow</code> (<code>float</code>, </em>optional<em>):
Only used with &#x2018;yarn&#x2019;. Parameter to set the boundary for interpolation (only) in the linear
ramp function. If unspecified, it defaults to 1.
<code>short_factor</code> (<code>List[float]</code>, </em>optional<em>):
Only used with &#x2018;longrope&#x2019;. The scaling factor to be applied to short contexts (&lt;
<code>max_position_embeddings</code> </em> <code>factor</code>). Must be a list of numbers with the same length as the hidden
size divided by the number of attention heads divided by 2
<code>long_factor</code> (<code>List[float]</code>, <em>optional</em>):
Only used with &#x2018;longrope&#x2019;. The scaling factor to be applied to short contexts (&lt;
<code>max_position_embeddings</code> * <code>factor</code>). Must be a list of numbers with the same length as the hidden
size divided by the number of attention heads divided by 2`,name:"rope_scaling"},{anchor:"transformers.LlamaConfig.attention_bias",description:`<strong>attention_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in the query, key, value and output projection layers during self-attention.`,name:"attention_bias"},{anchor:"transformers.LlamaConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.LlamaConfig.mlp_bias",description:`<strong>mlp_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use a bias in up_proj, down_proj and gate_proj layers in the MLP layers.`,name:"mlp_bias"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/configuration_llama.py#L26"}}),D=new Mo({props:{anchor:"transformers.LlamaConfig.example",$$slots:{default:[La]},$$scope:{ctx:C}}}),Fe=new Z({props:{title:"LlamaTokenizer",local:"llamatokenizer ][ transformers.LlamaTokenizer",headingTag:"h2"}}),qe=new w({props:{name:"class transformers.LlamaTokenizer",anchor:"transformers.LlamaTokenizer",parameters:[{name:"vocab_file",val:""},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"pad_token",val:" = None"},{name:"sp_model_kwargs",val:": Optional = None"},{name:"add_bos_token",val:" = True"},{name:"add_eos_token",val:" = False"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"use_default_system_prompt",val:" = False"},{name:"spaces_between_special_tokens",val:" = False"},{name:"legacy",val:" = None"},{name:"add_prefix_space",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.LlamaTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LlamaTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.`,name:"bos_token"},{anchor:"transformers.LlamaTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.LlamaTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation.`,name:"pad_token"},{anchor:"transformers.LlamaTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>Dict[str, Any]</code>, <code>Optional</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.LlamaTokenizer.add_bos_token",description:`<strong>add_bos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add an <code>bos_token</code> at the start of sequences.`,name:"add_bos_token"},{anchor:"transformers.LlamaTokenizer.add_eos_token",description:`<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an <code>eos_token</code> at the end of sequences.`,name:"add_eos_token"},{anchor:"transformers.LlamaTokenizer.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to cleanup spaces after decoding, cleanup consists in removing potential artifacts like
extra spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.LlamaTokenizer.use_default_system_prompt",description:`<strong>use_default_system_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the default system prompt for Llama should be used.`,name:"use_default_system_prompt"},{anchor:"transformers.LlamaTokenizer.spaces_between_special_tokens",description:`<strong>spaces_between_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add spaces between special tokens.`,name:"spaces_between_special_tokens"},{anchor:"transformers.LlamaTokenizer.legacy",description:`<strong>legacy</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the <code>legacy</code> behavior of the tokenizer should be used. Legacy is before the merge of #24622
and #25224 which includes fixes to properly handle tokens that appear after special tokens.
Make sure to also set <code>from_slow</code> to <code>True</code>.
A simple example:</p>
<ul>
<li><code>legacy=True</code>:</li>
</ul>`,name:"legacy"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/tokenization_llama.py#L56"}}),je=new w({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/vr_30530/src/transformers/models/llama/tokenization_llama.py#L334"}}),Ie=new w({props:{name:"get_special_tokens_mask",anchor:"transformers.LlamaTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.LlamaTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/tokenization_llama.py#L345",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><code>List[int]</code></p>
`}}),Pe=new w({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/tokenization_llama.py#L382",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><code>List[int]</code></p>
`}}),R=new Mo({props:{anchor:"transformers.LlamaTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Ta]},$$scope:{ctx:C}}}),We=new w({props:{name:"save_vocabulary",anchor:"transformers.LlamaTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:""},{name:"filename_prefix",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizer.save_vocabulary.save_directory",description:`<strong>save_directory</strong> (<code>str</code>) &#x2014;
The directory in which to save the vocabulary.`,name:"save_directory"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/tokenization_llama.py#L307",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><code>Tuple(str)</code></p>
`}}),Ue=new Z({props:{title:"LlamaTokenizerFast",local:"llamatokenizerfast ][ transformers.LlamaTokenizerFast",headingTag:"h2"}}),He=new w({props:{name:"class transformers.LlamaTokenizerFast",anchor:"transformers.LlamaTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"clean_up_tokenization_spaces",val:" = False"},{name:"unk_token",val:" = '<unk>'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"add_bos_token",val:" = True"},{name:"add_eos_token",val:" = False"},{name:"use_default_system_prompt",val:" = False"},{name:"legacy",val:" = None"},{name:"add_prefix_space",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .model extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.LlamaTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>, <em>optional</em>) &#x2014;
<a href="https://github.com/huggingface/tokenizers" rel="nofollow">tokenizers</a> file (generally has a .json extension) that
contains everything needed to load the tokenizer.`,name:"tokenizer_file"},{anchor:"transformers.LlamaTokenizerFast.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to cleanup spaces after decoding, cleanup consists in removing potential artifacts like
extra spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.LlamaTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LlamaTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.`,name:"bos_token"},{anchor:"transformers.LlamaTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.LlamaTokenizerFast.add_bos_token",description:`<strong>add_bos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add an <code>bos_token</code> at the start of sequences.`,name:"add_bos_token"},{anchor:"transformers.LlamaTokenizerFast.add_eos_token",description:`<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an <code>eos_token</code> at the end of sequences.`,name:"add_eos_token"},{anchor:"transformers.LlamaTokenizerFast.use_default_system_prompt",description:`<strong>use_default_system_prompt</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the default system prompt for Llama should be used`,name:"use_default_system_prompt"},{anchor:"transformers.LlamaTokenizerFast.legacy",description:`<strong>legacy</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the <code>legacy</code> behavior of the tokenizer should be used. Legacy is before the merge of #24622
and #25224 which includes fixes to properly handle tokens that appear after special tokens.
Make sure to also set <code>from_slow</code> to <code>True</code>.
A simple example:</p>
<ul>
<li><code>legacy=True</code>:</li>
</ul>`,name:"legacy"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/tokenization_llama_fast.py#L49"}}),X=new Mo({props:{anchor:"transformers.LlamaTokenizerFast.example",$$slots:{default:[$a]},$$scope:{ctx:C}}}),Ae=new w({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/vr_30530/src/transformers/models/llama/tokenization_llama_fast.py#L301"}}),Ee=new w({props:{name:"get_special_tokens_mask",anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids of the first sequence.`,name:"token_ids_0"},{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
List of ids of the second sequence.`,name:"token_ids_1"},{anchor:"transformers.LlamaTokenizerFast.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/tokenization_utils_base.py#L4050",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>A list of integers in the range [0, 1]</p>
`}}),Se=new w({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": List"},{name:"token_ids_1",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.LlamaTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/tokenization_utils_base.py#L3580",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><code>List[int]</code></p>
`}}),Ne=new w({props:{name:"update_post_processor",anchor:"transformers.LlamaTokenizerFast.update_post_processor",parameters:[],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/tokenization_llama_fast.py#L181"}}),Je=new w({props:{name:"save_vocabulary",anchor:"transformers.LlamaTokenizerFast.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/tokenization_llama_fast.py#L225"}}),Ge=new Z({props:{title:"LlamaModel",local:"llamamodel ][ transformers.LlamaModel",headingTag:"h2"}}),Ze=new w({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/pr_30530/ko/model_doc/llama#transformers.LlamaConfig">LlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<code>from_pretrained()</code> method to load the model weights.
config &#x2014; LlamaConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/modeling_llama.py#L826"}}),De=new w({props:{name:"forward",anchor:"transformers.LlamaModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LlamaModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <code>AutoTokenizer</code>. See <code>PreTrainedTokenizer.encode()</code> and
<code>PreTrainedTokenizer.__call__()</code> 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 <code>AutoTokenizer</code>. See <code>PreTrainedTokenizer.encode()</code> and
<code>PreTrainedTokenizer.__call__()</code> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <code>Cache</code> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>ModelOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaModel.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/modeling_llama.py#L860"}}),Q=new vn({props:{$$slots:{default:[xa]},$$scope:{ctx:C}}}),Be=new Z({props:{title:"LlamaForCausalLM",local:"llamaforcausallm ][ transformers.LlamaForCausalLM",headingTag:"h2"}}),Re=new w({props:{name:"class transformers.LlamaForCausalLM",anchor:"transformers.LlamaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/modeling_llama.py#L1061"}}),Ve=new w({props:{name:"forward",anchor:"transformers.LlamaForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LlamaForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <code>AutoTokenizer</code>. See <code>PreTrainedTokenizer.encode()</code> and
<code>PreTrainedTokenizer.__call__()</code> 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 <code>AutoTokenizer</code>. See <code>PreTrainedTokenizer.encode()</code> and
<code>PreTrainedTokenizer.__call__()</code> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <code>Cache</code> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>ModelOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaForCausalLM.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/modeling_llama.py#L1091",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><code>transformers.modeling_outputs.CausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),K=new vn({props:{$$slots:{default:[wa]},$$scope:{ctx:C}}}),ee=new Mo({props:{anchor:"transformers.LlamaForCausalLM.forward.example",$$slots:{default:[Ma]},$$scope:{ctx:C}}}),Xe=new Z({props:{title:"LlamaForSequenceClassification",local:"llamaforsequenceclassification ][ transformers.LlamaForSequenceClassification",headingTag:"h2"}}),Oe=new w({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/pr_30530/ko/model_doc/llama#transformers.LlamaConfig">LlamaConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<code>from_pretrained()</code> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/modeling_llama.py#L1231"}}),Ye=new w({props:{name:"forward",anchor:"transformers.LlamaForSequenceClassification.forward",parameters:[{name:"input_ids",val:": Optional = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.LlamaForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <code>AutoTokenizer</code>. See <code>PreTrainedTokenizer.encode()</code> and
<code>PreTrainedTokenizer.__call__()</code> 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 <code>AutoTokenizer</code>. See <code>PreTrainedTokenizer.encode()</code> and
<code>PreTrainedTokenizer.__call__()</code> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.LlamaForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LlamaForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <code>Cache</code> instance;</li>
<li>Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of
shape <code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>input_ids</code> (those that don&#x2019;t
have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all <code>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.LlamaForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LlamaForSequenceClassification.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"},{anchor:"transformers.LlamaForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LlamaForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LlamaForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <code>ModelOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LlamaForSequenceClassification.forward.cache_position",description:`<strong>cache_position</strong> (<code>torch.LongTensor</code> of shape <code>(sequence_length)</code>, <em>optional</em>) &#x2014;
Indices depicting the position of the input sequence tokens in the sequence. Contrarily to <code>position_ids</code>,
this tensor is not affected by padding. It is used to update the cache in the correct position and to infer
the complete sequence length.`,name:"cache_position"},{anchor:"transformers.LlamaForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/llama/modeling_llama.py#L1262"}}),te=new vn({props:{$$slots:{default:[za]},$$scope:{ctx:C}}}),Qe=new ya({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/model_doc/llama.md"}}),{c(){d=i("meta"),v=n(),c=i("p"),k=n(),p(M.$$.fragment),b=n(),p(F.$$.fragment),Ht=n(),ne=i("p"),ne.innerHTML=yn,At=n(),ae=i("p"),ae.textContent=Ln,Et=n(),se=i("p"),se.innerHTML=Tn,St=n(),re=i("p"),re.textContent=$n,Nt=n(),ie=i("ul"),ie.innerHTML=xn,Jt=n(),p(le.$$.fragment),Gt=n(),de=i("ul"),de.innerHTML=wn,Zt=n(),p(ce.$$.fragment),Dt=n(),me=i("p"),me.textContent=Mn,Bt=n(),pe=i("ul"),pe.innerHTML=zn,Rt=n(),ue=i("p"),ue.innerHTML=Cn,Vt=n(),he=i("p"),he.textContent=Fn,Xt=n(),fe=i("ul"),fe.innerHTML=qn,Ot=n(),p(ge.$$.fragment),Yt=n(),_e=i("p"),_e.textContent=jn,Qt=n(),p(be.$$.fragment),Kt=n(),ke=i("ul"),ke.innerHTML=In,eo=n(),p(ve.$$.fragment),to=n(),ye=i("ul"),ye.innerHTML=Pn,oo=n(),Le=i("p"),Le.textContent=Wn,no=n(),Te=i("ul"),Te.innerHTML=Un,ao=n(),$e=i("p"),$e.textContent=Hn,so=n(),xe=i("ul"),xe.innerHTML=An,ro=n(),we=i("p"),we.textContent=En,io=n(),Me=i("ul"),Me.innerHTML=Sn,lo=n(),p(ze.$$.fragment),co=n(),P=i("div"),p(Ce.$$.fragment),zo=n(),ot=i("p"),ot.innerHTML=Nn,Co=n(),nt=i("p"),nt.innerHTML=Jn,Fo=n(),p(D.$$.fragment),mo=n(),p(Fe.$$.fragment),po=n(),z=i("div"),p(qe.$$.fragment),qo=n(),at=i("p"),at.textContent=Gn,jo=n(),st=i("div"),p(je.$$.fragment),Io=n(),B=i("div"),p(Ie.$$.fragment),Po=n(),rt=i("p"),rt.innerHTML=Zn,Wo=n(),W=i("div"),p(Pe.$$.fragment),Uo=n(),it=i("p"),it.textContent=Dn,Ho=n(),p(R.$$.fragment),Ao=n(),lt=i("p"),lt.textContent=Bn,Eo=n(),V=i("div"),p(We.$$.fragment),So=n(),dt=i("p"),dt.textContent=Rn,uo=n(),p(Ue.$$.fragment),ho=n(),y=i("div"),p(He.$$.fragment),No=n(),ct=i("p"),ct.textContent=Vn,Jo=n(),mt=i("p"),mt.textContent=Xn,Go=n(),p(X.$$.fragment),Zo=n(),pt=i("p"),pt.innerHTML=On,Do=n(),ut=i("p"),ut.innerHTML=Yn,Bo=n(),ht=i("div"),p(Ae.$$.fragment),Ro=n(),O=i("div"),p(Ee.$$.fragment),Vo=n(),ft=i("p"),ft.innerHTML=Qn,Xo=n(),E=i("div"),p(Se.$$.fragment),Oo=n(),gt=i("p"),gt.innerHTML=Kn,Yo=n(),_t=i("p"),_t.textContent=ea,Qo=n(),Y=i("div"),p(Ne.$$.fragment),Ko=n(),bt=i("p"),bt.innerHTML=ta,en=n(),kt=i("div"),p(Je.$$.fragment),fo=n(),p(Ge.$$.fragment),go=n(),q=i("div"),p(Ze.$$.fragment),tn=n(),vt=i("p"),vt.innerHTML=oa,on=n(),yt=i("p"),yt.innerHTML=na,nn=n(),Lt=i("p"),Lt.innerHTML=aa,an=n(),S=i("div"),p(De.$$.fragment),sn=n(),Tt=i("p"),Tt.innerHTML=sa,rn=n(),p(Q.$$.fragment),_o=n(),p(Be.$$.fragment),bo=n(),G=i("div"),p(Re.$$.fragment),ln=n(),U=i("div"),p(Ve.$$.fragment),dn=n(),$t=i("p"),$t.innerHTML=ra,cn=n(),p(K.$$.fragment),mn=n(),p(ee.$$.fragment),ko=n(),p(Xe.$$.fragment),vo=n(),x=i("div"),p(Oe.$$.fragment),pn=n(),xt=i("p"),xt.textContent=ia,un=n(),wt=i("p"),wt.innerHTML=la,hn=n(),Mt=i("p"),Mt.innerHTML=da,fn=n(),zt=i("p"),zt.innerHTML=ca,gn=n(),Ct=i("p"),Ct.innerHTML=ma,_n=n(),N=i("div"),p(Ye.$$.fragment),bn=n(),Ft=i("p"),Ft.innerHTML=pa,kn=n(),p(te.$$.fragment),yo=n(),p(Qe.$$.fragment),Lo=n(),Wt=i("p"),this.h()},l(e){const t=va("svelte-u9bgzb",document.head);d=l(t,"META",{name:!0,content:!0}),t.forEach(o),v=a(e),c=l(e,"P",{}),T(c).forEach(o),k=a(e),u(M.$$.fragment,e),b=a(e),u(F.$$.fragment,e),Ht=a(e),ne=l(e,"P",{"data-svelte-h":!0}),m(ne)!=="svelte-a353de"&&(ne.innerHTML=yn),At=a(e),ae=l(e,"P",{"data-svelte-h":!0}),m(ae)!=="svelte-e5r8wp"&&(ae.textContent=Ln),Et=a(e),se=l(e,"P",{"data-svelte-h":!0}),m(se)!=="svelte-1w8ji9d"&&(se.innerHTML=Tn),St=a(e),re=l(e,"P",{"data-svelte-h":!0}),m(re)!=="svelte-k6v9m1"&&(re.textContent=$n),Nt=a(e),ie=l(e,"UL",{"data-svelte-h":!0}),m(ie)!=="svelte-qgv262"&&(ie.innerHTML=xn),Jt=a(e),u(le.$$.fragment,e),Gt=a(e),de=l(e,"UL",{"data-svelte-h":!0}),m(de)!=="svelte-1m2lh35"&&(de.innerHTML=wn),Zt=a(e),u(ce.$$.fragment,e),Dt=a(e),me=l(e,"P",{"data-svelte-h":!0}),m(me)!=="svelte-uib2dz"&&(me.textContent=Mn),Bt=a(e),pe=l(e,"UL",{"data-svelte-h":!0}),m(pe)!=="svelte-9ksrjp"&&(pe.innerHTML=zn),Rt=a(e),ue=l(e,"P",{"data-svelte-h":!0}),m(ue)!=="svelte-wjmudq"&&(ue.innerHTML=Cn),Vt=a(e),he=l(e,"P",{"data-svelte-h":!0}),m(he)!=="svelte-f24v5"&&(he.textContent=Fn),Xt=a(e),fe=l(e,"UL",{"data-svelte-h":!0}),m(fe)!=="svelte-1u3qfca"&&(fe.innerHTML=qn),Ot=a(e),u(ge.$$.fragment,e),Yt=a(e),_e=l(e,"P",{"data-svelte-h":!0}),m(_e)!=="svelte-12agt6k"&&(_e.textContent=jn),Qt=a(e),u(be.$$.fragment,e),Kt=a(e),ke=l(e,"UL",{"data-svelte-h":!0}),m(ke)!=="svelte-1hrgzzb"&&(ke.innerHTML=In),eo=a(e),u(ve.$$.fragment,e),to=a(e),ye=l(e,"UL",{"data-svelte-h":!0}),m(ye)!=="svelte-1nqtlhx"&&(ye.innerHTML=Pn),oo=a(e),Le=l(e,"P",{"data-svelte-h":!0}),m(Le)!=="svelte-14a1znp"&&(Le.textContent=Wn),no=a(e),Te=l(e,"UL",{"data-svelte-h":!0}),m(Te)!=="svelte-8brual"&&(Te.innerHTML=Un),ao=a(e),$e=l(e,"P",{"data-svelte-h":!0}),m($e)!=="svelte-1x58uo"&&($e.textContent=Hn),so=a(e),xe=l(e,"UL",{"data-svelte-h":!0}),m(xe)!=="svelte-1dxsod4"&&(xe.innerHTML=An),ro=a(e),we=l(e,"P",{"data-svelte-h":!0}),m(we)!=="svelte-3z2x4b"&&(we.textContent=En),io=a(e),Me=l(e,"UL",{"data-svelte-h":!0}),m(Me)!=="svelte-fjx670"&&(Me.innerHTML=Sn),lo=a(e),u(ze.$$.fragment,e),co=a(e),P=l(e,"DIV",{class:!0});var H=T(P);u(Ce.$$.fragment,H),zo=a(H),ot=l(H,"P",{"data-svelte-h":!0}),m(ot)!=="svelte-1rwusxu"&&(ot.innerHTML=Nn),Co=a(H),nt=l(H,"P",{"data-svelte-h":!0}),m(nt)!=="svelte-huu8ef"&&(nt.innerHTML=Jn),Fo=a(H),u(D.$$.fragment,H),H.forEach(o),mo=a(e),u(Fe.$$.fragment,e),po=a(e),z=l(e,"DIV",{class:!0});var j=T(z);u(qe.$$.fragment,j),qo=a(j),at=l(j,"P",{"data-svelte-h":!0}),m(at)!=="svelte-qfiu5a"&&(at.textContent=Gn),jo=a(j),st=l(j,"DIV",{class:!0});var Ut=T(st);u(je.$$.fragment,Ut),Ut.forEach(o),Io=a(j),B=l(j,"DIV",{class:!0});var Ke=T(B);u(Ie.$$.fragment,Ke),Po=a(Ke),rt=l(Ke,"P",{"data-svelte-h":!0}),m(rt)!=="svelte-1f4f5kp"&&(rt.innerHTML=Zn),Ke.forEach(o),Wo=a(j),W=l(j,"DIV",{class:!0});var A=T(W);u(Pe.$$.fragment,A),Uo=a(A),it=l(A,"P",{"data-svelte-h":!0}),m(it)!=="svelte-13bfd60"&&(it.textContent=Dn),Ho=a(A),u(R.$$.fragment,A),Ao=a(A),lt=l(A,"P",{"data-svelte-h":!0}),m(lt)!=="svelte-wtrslu"&&(lt.textContent=Bn),A.forEach(o),Eo=a(j),V=l(j,"DIV",{class:!0});var et=T(V);u(We.$$.fragment,et),So=a(et),dt=l(et,"P",{"data-svelte-h":!0}),m(dt)!=="svelte-1slb66l"&&(dt.textContent=Rn),et.forEach(o),j.forEach(o),uo=a(e),u(Ue.$$.fragment,e),ho=a(e),y=l(e,"DIV",{class:!0});var L=T(y);u(He.$$.fragment,L),No=a(L),ct=l(L,"P",{"data-svelte-h":!0}),m(ct)!=="svelte-15tdcz8"&&(ct.textContent=Vn),Jo=a(L),mt=l(L,"P",{"data-svelte-h":!0}),m(mt)!=="svelte-llhmpa"&&(mt.textContent=Xn),Go=a(L),u(X.$$.fragment,L),Zo=a(L),pt=l(L,"P",{"data-svelte-h":!0}),m(pt)!=="svelte-cnb6q1"&&(pt.innerHTML=On),Do=a(L),ut=l(L,"P",{"data-svelte-h":!0}),m(ut)!=="svelte-1ndfe3e"&&(ut.innerHTML=Yn),Bo=a(L),ht=l(L,"DIV",{class:!0});var ua=T(ht);u(Ae.$$.fragment,ua),ua.forEach(o),Ro=a(L),O=l(L,"DIV",{class:!0});var $o=T(O);u(Ee.$$.fragment,$o),Vo=a($o),ft=l($o,"P",{"data-svelte-h":!0}),m(ft)!=="svelte-1wmjg8a"&&(ft.innerHTML=Qn),$o.forEach(o),Xo=a(L),E=l(L,"DIV",{class:!0});var qt=T(E);u(Se.$$.fragment,qt),Oo=a(qt),gt=l(qt,"P",{"data-svelte-h":!0}),m(gt)!=="svelte-zj1vf1"&&(gt.innerHTML=Kn),Yo=a(qt),_t=l(qt,"P",{"data-svelte-h":!0}),m(_t)!=="svelte-9vptpw"&&(_t.textContent=ea),qt.forEach(o),Qo=a(L),Y=l(L,"DIV",{class:!0});var xo=T(Y);u(Ne.$$.fragment,xo),Ko=a(xo),bt=l(xo,"P",{"data-svelte-h":!0}),m(bt)!=="svelte-nfci2w"&&(bt.innerHTML=ta),xo.forEach(o),en=a(L),kt=l(L,"DIV",{class:!0});var ha=T(kt);u(Je.$$.fragment,ha),ha.forEach(o),L.forEach(o),fo=a(e),u(Ge.$$.fragment,e),go=a(e),q=l(e,"DIV",{class:!0});var J=T(q);u(Ze.$$.fragment,J),tn=a(J),vt=l(J,"P",{"data-svelte-h":!0}),m(vt)!=="svelte-16gi54p"&&(vt.innerHTML=oa),on=a(J),yt=l(J,"P",{"data-svelte-h":!0}),m(yt)!=="svelte-hswkmf"&&(yt.innerHTML=na),nn=a(J),Lt=l(J,"P",{"data-svelte-h":!0}),m(Lt)!=="svelte-eom0yk"&&(Lt.innerHTML=aa),an=a(J),S=l(J,"DIV",{class:!0});var jt=T(S);u(De.$$.fragment,jt),sn=a(jt),Tt=l(jt,"P",{"data-svelte-h":!0}),m(Tt)!=="svelte-4jwx7w"&&(Tt.innerHTML=sa),rn=a(jt),u(Q.$$.fragment,jt),jt.forEach(o),J.forEach(o),_o=a(e),u(Be.$$.fragment,e),bo=a(e),G=l(e,"DIV",{class:!0});var wo=T(G);u(Re.$$.fragment,wo),ln=a(wo),U=l(wo,"DIV",{class:!0});var oe=T(U);u(Ve.$$.fragment,oe),dn=a(oe),$t=l(oe,"P",{"data-svelte-h":!0}),m($t)!=="svelte-yz0t58"&&($t.innerHTML=ra),cn=a(oe),u(K.$$.fragment,oe),mn=a(oe),u(ee.$$.fragment,oe),oe.forEach(o),wo.forEach(o),ko=a(e),u(Xe.$$.fragment,e),vo=a(e),x=l(e,"DIV",{class:!0});var I=T(x);u(Oe.$$.fragment,I),pn=a(I),xt=l(I,"P",{"data-svelte-h":!0}),m(xt)!=="svelte-62must"&&(xt.textContent=ia),un=a(I),wt=l(I,"P",{"data-svelte-h":!0}),m(wt)!=="svelte-cqgb93"&&(wt.innerHTML=la),hn=a(I),Mt=l(I,"P",{"data-svelte-h":!0}),m(Mt)!=="svelte-10ugs3m"&&(Mt.innerHTML=da),fn=a(I),zt=l(I,"P",{"data-svelte-h":!0}),m(zt)!=="svelte-ehy44e"&&(zt.innerHTML=ca),gn=a(I),Ct=l(I,"P",{"data-svelte-h":!0}),m(Ct)!=="svelte-hswkmf"&&(Ct.innerHTML=ma),_n=a(I),N=l(I,"DIV",{class:!0});var It=T(N);u(Ye.$$.fragment,It),bn=a(It),Ft=l(It,"P",{"data-svelte-h":!0}),m(Ft)!=="svelte-1e06ajm"&&(Ft.innerHTML=pa),kn=a(It),u(te.$$.fragment,It),It.forEach(o),I.forEach(o),yo=a(e),u(Qe.$$.fragment,e),Lo=a(e),Wt=l(e,"P",{}),T(Wt).forEach(o),this.h()},h(){$(d,"name","hf:doc:metadata"),$(d,"content",Fa),$(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(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,t){s(document.head,d),r(e,v,t),r(e,c,t),r(e,k,t),h(M,e,t),r(e,b,t),h(F,e,t),r(e,Ht,t),r(e,ne,t),r(e,At,t),r(e,ae,t),r(e,Et,t),r(e,se,t),r(e,St,t),r(e,re,t),r(e,Nt,t),r(e,ie,t),r(e,Jt,t),h(le,e,t),r(e,Gt,t),r(e,de,t),r(e,Zt,t),h(ce,e,t),r(e,Dt,t),r(e,me,t),r(e,Bt,t),r(e,pe,t),r(e,Rt,t),r(e,ue,t),r(e,Vt,t),r(e,he,t),r(e,Xt,t),r(e,fe,t),r(e,Ot,t),h(ge,e,t),r(e,Yt,t),r(e,_e,t),r(e,Qt,t),h(be,e,t),r(e,Kt,t),r(e,ke,t),r(e,eo,t),h(ve,e,t),r(e,to,t),r(e,ye,t),r(e,oo,t),r(e,Le,t),r(e,no,t),r(e,Te,t),r(e,ao,t),r(e,$e,t),r(e,so,t),r(e,xe,t),r(e,ro,t),r(e,we,t),r(e,io,t),r(e,Me,t),r(e,lo,t),h(ze,e,t),r(e,co,t),r(e,P,t),h(Ce,P,null),s(P,zo),s(P,ot),s(P,Co),s(P,nt),s(P,Fo),h(D,P,null),r(e,mo,t),h(Fe,e,t),r(e,po,t),r(e,z,t),h(qe,z,null),s(z,qo),s(z,at),s(z,jo),s(z,st),h(je,st,null),s(z,Io),s(z,B),h(Ie,B,null),s(B,Po),s(B,rt),s(z,Wo),s(z,W),h(Pe,W,null),s(W,Uo),s(W,it),s(W,Ho),h(R,W,null),s(W,Ao),s(W,lt),s(z,Eo),s(z,V),h(We,V,null),s(V,So),s(V,dt),r(e,uo,t),h(Ue,e,t),r(e,ho,t),r(e,y,t),h(He,y,null),s(y,No),s(y,ct),s(y,Jo),s(y,mt),s(y,Go),h(X,y,null),s(y,Zo),s(y,pt),s(y,Do),s(y,ut),s(y,Bo),s(y,ht),h(Ae,ht,null),s(y,Ro),s(y,O),h(Ee,O,null),s(O,Vo),s(O,ft),s(y,Xo),s(y,E),h(Se,E,null),s(E,Oo),s(E,gt),s(E,Yo),s(E,_t),s(y,Qo),s(y,Y),h(Ne,Y,null),s(Y,Ko),s(Y,bt),s(y,en),s(y,kt),h(Je,kt,null),r(e,fo,t),h(Ge,e,t),r(e,go,t),r(e,q,t),h(Ze,q,null),s(q,tn),s(q,vt),s(q,on),s(q,yt),s(q,nn),s(q,Lt),s(q,an),s(q,S),h(De,S,null),s(S,sn),s(S,Tt),s(S,rn),h(Q,S,null),r(e,_o,t),h(Be,e,t),r(e,bo,t),r(e,G,t),h(Re,G,null),s(G,ln),s(G,U),h(Ve,U,null),s(U,dn),s(U,$t),s(U,cn),h(K,U,null),s(U,mn),h(ee,U,null),r(e,ko,t),h(Xe,e,t),r(e,vo,t),r(e,x,t),h(Oe,x,null),s(x,pn),s(x,xt),s(x,un),s(x,wt),s(x,hn),s(x,Mt),s(x,fn),s(x,zt),s(x,gn),s(x,Ct),s(x,_n),s(x,N),h(Ye,N,null),s(N,bn),s(N,Ft),s(N,kn),h(te,N,null),r(e,yo,t),h(Qe,e,t),r(e,Lo,t),r(e,Wt,t),To=!0},p(e,[t]){const H={};t&2&&(H.$$scope={dirty:t,ctx:e}),D.$set(H);const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),R.$set(j);const Ut={};t&2&&(Ut.$$scope={dirty:t,ctx:e}),X.$set(Ut);const Ke={};t&2&&(Ke.$$scope={dirty:t,ctx:e}),Q.$set(Ke);const A={};t&2&&(A.$$scope={dirty:t,ctx:e}),K.$set(A);const et={};t&2&&(et.$$scope={dirty:t,ctx:e}),ee.$set(et);const L={};t&2&&(L.$$scope={dirty:t,ctx:e}),te.$set(L)},i(e){To||(f(M.$$.fragment,e),f(F.$$.fragment,e),f(le.$$.fragment,e),f(ce.$$.fragment,e),f(ge.$$.fragment,e),f(be.$$.fragment,e),f(ve.$$.fragment,e),f(ze.$$.fragment,e),f(Ce.$$.fragment,e),f(D.$$.fragment,e),f(Fe.$$.fragment,e),f(qe.$$.fragment,e),f(je.$$.fragment,e),f(Ie.$$.fragment,e),f(Pe.$$.fragment,e),f(R.$$.fragment,e),f(We.$$.fragment,e),f(Ue.$$.fragment,e),f(He.$$.fragment,e),f(X.$$.fragment,e),f(Ae.$$.fragment,e),f(Ee.$$.fragment,e),f(Se.$$.fragment,e),f(Ne.$$.fragment,e),f(Je.$$.fragment,e),f(Ge.$$.fragment,e),f(Ze.$$.fragment,e),f(De.$$.fragment,e),f(Q.$$.fragment,e),f(Be.$$.fragment,e),f(Re.$$.fragment,e),f(Ve.$$.fragment,e),f(K.$$.fragment,e),f(ee.$$.fragment,e),f(Xe.$$.fragment,e),f(Oe.$$.fragment,e),f(Ye.$$.fragment,e),f(te.$$.fragment,e),f(Qe.$$.fragment,e),To=!0)},o(e){g(M.$$.fragment,e),g(F.$$.fragment,e),g(le.$$.fragment,e),g(ce.$$.fragment,e),g(ge.$$.fragment,e),g(be.$$.fragment,e),g(ve.$$.fragment,e),g(ze.$$.fragment,e),g(Ce.$$.fragment,e),g(D.$$.fragment,e),g(Fe.$$.fragment,e),g(qe.$$.fragment,e),g(je.$$.fragment,e),g(Ie.$$.fragment,e),g(Pe.$$.fragment,e),g(R.$$.fragment,e),g(We.$$.fragment,e),g(Ue.$$.fragment,e),g(He.$$.fragment,e),g(X.$$.fragment,e),g(Ae.$$.fragment,e),g(Ee.$$.fragment,e),g(Se.$$.fragment,e),g(Ne.$$.fragment,e),g(Je.$$.fragment,e),g(Ge.$$.fragment,e),g(Ze.$$.fragment,e),g(De.$$.fragment,e),g(Q.$$.fragment,e),g(Be.$$.fragment,e),g(Re.$$.fragment,e),g(Ve.$$.fragment,e),g(K.$$.fragment,e),g(ee.$$.fragment,e),g(Xe.$$.fragment,e),g(Oe.$$.fragment,e),g(Ye.$$.fragment,e),g(te.$$.fragment,e),g(Qe.$$.fragment,e),To=!1},d(e){e&&(o(v),o(c),o(k),o(b),o(Ht),o(ne),o(At),o(ae),o(Et),o(se),o(St),o(re),o(Nt),o(ie),o(Jt),o(Gt),o(de),o(Zt),o(Dt),o(me),o(Bt),o(pe),o(Rt),o(ue),o(Vt),o(he),o(Xt),o(fe),o(Ot),o(Yt),o(_e),o(Qt),o(Kt),o(ke),o(eo),o(to),o(ye),o(oo),o(Le),o(no),o(Te),o(ao),o($e),o(so),o(xe),o(ro),o(we),o(io),o(Me),o(lo),o(co),o(P),o(mo),o(po),o(z),o(uo),o(ho),o(y),o(fo),o(go),o(q),o(_o),o(bo),o(G),o(ko),o(vo),o(x),o(yo),o(Lo),o(Wt)),o(d),_(M,e),_(F,e),_(le,e),_(ce,e),_(ge,e),_(be,e),_(ve,e),_(ze,e),_(Ce),_(D),_(Fe,e),_(qe),_(je),_(Ie),_(Pe),_(R),_(We),_(Ue,e),_(He),_(X),_(Ae),_(Ee),_(Se),_(Ne),_(Je),_(Ge,e),_(Ze),_(De),_(Q),_(Be,e),_(Re),_(Ve),_(K),_(ee),_(Xe,e),_(Oe),_(Ye),_(te),_(Qe,e)}}}const Fa='{"title":"LLaMA","local":"llama","sections":[{"title":"개요","local":"overview","sections":[],"depth":2},{"title":"리소스","local":"resources","sections":[],"depth":2},{"title":"LlamaConfig","local":"llamaconfig ][ transformers.LlamaConfig","sections":[],"depth":2},{"title":"LlamaTokenizer","local":"llamatokenizer ][ transformers.LlamaTokenizer","sections":[],"depth":2},{"title":"LlamaTokenizerFast","local":"llamatokenizerfast ][ transformers.LlamaTokenizerFast","sections":[],"depth":2},{"title":"LlamaModel","local":"llamamodel ][ transformers.LlamaModel","sections":[],"depth":2},{"title":"LlamaForCausalLM","local":"llamaforcausallm ][ transformers.LlamaForCausalLM","sections":[],"depth":2},{"title":"LlamaForSequenceClassification","local":"llamaforsequenceclassification ][ transformers.LlamaForSequenceClassification","sections":[],"depth":2}],"depth":1}';function qa(C){return _a(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ea extends ba{constructor(d){super(),ka(this,d,qa,Ca,ga,{})}}export{Ea as component};
