import{s as Fn,o as Pn,n as ce}from"../chunks/scheduler.18a86fab.js";import{S as In,i as qn,g as d,s,r as f,A as Wn,h as c,f as a,c as r,j as J,u as g,x as h,k as q,y as i,a as l,v as _,d as b,t as y,w as v}from"../chunks/index.98837b22.js";import{T as Me}from"../chunks/Tip.77304350.js";import{D as de}from"../chunks/Docstring.6758ea23.js";import{C as xn}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as zn}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H as we}from"../chunks/Heading.7e7e0c5b.js";import{E as Sn}from"../chunks/index.499f366c.js";function jn(L){let n,u="This model is in maintenance mode only, we don’t accept any new PRs changing its code.",o,m,k=`If you run into any issues running this model, please reinstall the last version that supported this model: v4.31.0.
You can do so by running the following command: <code>pip install -U transformers==4.31.0</code>.`;return{c(){n=d("p"),n.textContent=u,o=s(),m=d("p"),m.innerHTML=k},l(p){n=c(p,"P",{"data-svelte-h":!0}),h(n)!=="svelte-1dwyvn5"&&(n.textContent=u),o=r(p),m=c(p,"P",{"data-svelte-h":!0}),h(m)!=="svelte-1o63f7c"&&(m.innerHTML=k)},m(p,w){l(p,n,w),l(p,o,w),l(p,m,w)},p:ce,d(p){p&&(a(n),a(o),a(m))}}}function Jn(L){let n,u='This model differs from the <a href="https://huggingface.co/models?search=openllama" rel="nofollow">OpenLLaMA models</a> on the Hugging Face Hub, which primarily use the <a href="llama">LLaMA</a> architecture.';return{c(){n=d("p"),n.innerHTML=u},l(o){n=c(o,"P",{"data-svelte-h":!0}),h(n)!=="svelte-1kc01gl"&&(n.innerHTML=u)},m(o,m){l(o,n,m)},p:ce,d(o){o&&a(n)}}}function Un(L){let n,u;return n=new xn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME9wZW5MbGFtYU1vZGVsJTJDJTIwT3BlbkxsYW1hQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME9wZW4tTGxhbWElMjBvcGVuX2xsYW1hLTdiJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyME9wZW5MbGFtYUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMG9wZW5fbGxhbWEtN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyME9wZW5MbGFtYU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OpenLlamaModel, OpenLlamaConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Open-Llama open_llama-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = OpenLlamaConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the open_llama-7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = OpenLlamaModel(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(n.$$.fragment)},l(o){g(n.$$.fragment,o)},m(o,m){_(n,o,m),u=!0},p:ce,i(o){u||(b(n.$$.fragment,o),u=!0)},o(o){y(n.$$.fragment,o),u=!1},d(o){v(n,o)}}}function Bn(L){let n,u=`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(){n=d("p"),n.innerHTML=u},l(o){n=c(o,"P",{"data-svelte-h":!0}),h(n)!=="svelte-fincs2"&&(n.innerHTML=u)},m(o,m){l(o,n,m)},p:ce,d(o){o&&a(n)}}}function Hn(L){let n,u=`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(){n=d("p"),n.innerHTML=u},l(o){n=c(o,"P",{"data-svelte-h":!0}),h(n)!=="svelte-fincs2"&&(n.innerHTML=u)},m(o,m){l(o,n,m)},p:ce,d(o){o&&a(n)}}}function Zn(L){let n,u="Example:",o,m,k;return m=new xn({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBPcGVuTGxhbWFGb3JDYXVzYWxMTSUwQSUwQW1vZGVsJTIwJTNEJTIwT3BlbkxsYW1hRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5sbS1yZXNlYXJjaCUyRm9wZW5fbGxhbWFfN2IlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmxtLXJlc2VhcmNoJTJGb3Blbl9sbGFtYV83YiUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, OpenLlamaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = OpenLlamaForCausalLM.from_pretrained(<span class="hljs-string">&quot;openlm-research/open_llama_7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openlm-research/open_llama_7b&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(){n=d("p"),n.textContent=u,o=s(),f(m.$$.fragment)},l(p){n=c(p,"P",{"data-svelte-h":!0}),h(n)!=="svelte-11lpom8"&&(n.textContent=u),o=r(p),g(m.$$.fragment,p)},m(p,w){l(p,n,w),l(p,o,w),_(m,p,w),k=!0},p:ce,i(p){k||(b(m.$$.fragment,p),k=!0)},o(p){y(m.$$.fragment,p),k=!1},d(p){p&&(a(n),a(o)),v(m,p)}}}function Nn(L){let n,u=`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(){n=d("p"),n.innerHTML=u},l(o){n=c(o,"P",{"data-svelte-h":!0}),h(n)!=="svelte-fincs2"&&(n.innerHTML=u)},m(o,m){l(o,n,m)},p:ce,d(o){o&&a(n)}}}function Gn(L){let n,u,o,m,k,p,w,pn='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',Oe,U,Ce,B,ze,V,xe,D,un="The Open-Llama model was proposed in the open source Open-Llama project by community developer s-JoL.",Fe,Y,hn=`The model is mainly based on LLaMA with some modifications, incorporating memory-efficient attention from Xformers, stable embedding from Bloom, and shared input-output embedding from PaLM.
And the model is pre-trained on both Chinese and English, which gives it better performance on Chinese language tasks.`,Pe,A,fn=`This model was contributed by <a href="https://huggingface.co/s-JoL" rel="nofollow">s-JoL</a>.
The original code was released on GitHub by <a href="https://github.com/s-JoL" rel="nofollow">s-JoL</a>, but is now removed.`,Ie,R,qe,O,X,Ge,me,gn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/open-llama#transformers.OpenLlamaModel">OpenLlamaModel</a>. It is used to instantiate an
Open-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
<a href="https://huggingface.co/s-JoL/Open-Llama-V1" rel="nofollow">s-JoL/Open-Llama-V1</a>.`,Ee,pe,_n=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Ve,H,We,Q,Se,M,K,De,ue,bn=`The bare Open-Llama Model outputting raw hidden-states without any specific head on top.
This model inherits from <a href="/docs/transformers/main/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.)`,Ye,he,yn=`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.`,Ae,fe,vn="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>OpenLlamaDecoderLayer</code>",Re,P,ee,Xe,ge,Tn='The <a href="/docs/transformers/main/en/model_doc/open-llama#transformers.OpenLlamaModel">OpenLlamaModel</a> forward method, overrides the <code>__call__</code> special method.',Qe,Z,je,ne,Je,W,te,Ke,z,oe,en,_e,$n='The <a href="/docs/transformers/main/en/model_doc/open-llama#transformers.OpenLlamaForCausalLM">OpenLlamaForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',nn,N,tn,G,Ue,ae,Be,T,se,on,be,Ln="The LLaMa Model transformer with a sequence classification head on top (linear layer).",an,ye,wn=`<a href="/docs/transformers/main/en/model_doc/open-llama#transformers.OpenLlamaForSequenceClassification">OpenLlamaForSequenceClassification</a> uses the last token in order to do the classification, as other causal
models (e.g. GPT-2) do.`,sn,ve,kn=`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).`,rn,Te,Mn=`This model inherits from <a href="/docs/transformers/main/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.)`,ln,$e,On=`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.`,dn,I,re,cn,Le,Cn='The <a href="/docs/transformers/main/en/model_doc/open-llama#transformers.OpenLlamaForSequenceClassification">OpenLlamaForSequenceClassification</a> forward method, overrides the <code>__call__</code> special method.',mn,E,He,ie,Ze,ke,Ne;return k=new we({props:{title:"Open-Llama",local:"open-llama",headingTag:"h1"}}),U=new Me({props:{warning:!0,$$slots:{default:[jn]},$$scope:{ctx:L}}}),B=new Me({props:{warning:!0,$$slots:{default:[Jn]},$$scope:{ctx:L}}}),V=new we({props:{title:"Overview",local:"overview",headingTag:"h2"}}),R=new we({props:{title:"OpenLlamaConfig",local:"transformers.OpenLlamaConfig",headingTag:"h2"}}),X=new de({props:{name:"class transformers.OpenLlamaConfig",anchor:"transformers.OpenLlamaConfig",parameters:[{name:"vocab_size",val:" = 100000"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 11008"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{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:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"use_memory_efficient_attention",val:" = True"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_dropout_prob",val:" = 0.1"},{name:"use_stable_embedding",val:" = True"},{name:"shared_input_output_embedding",val:" = True"},{name:"rope_theta",val:" = 10000.0"},{name:"rope_scaling",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.OpenLlamaConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the Open-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/main/en/model_doc/open-llama#transformers.OpenLlamaModel">OpenLlamaModel</a>`,name:"vocab_size"},{anchor:"transformers.OpenLlamaConfig.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.OpenLlamaConfig.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.OpenLlamaConfig.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.OpenLlamaConfig.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.OpenLlamaConfig.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.OpenLlamaConfig.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. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.OpenLlamaConfig.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.OpenLlamaConfig.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.OpenLlamaConfig.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.OpenLlamaConfig.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.OpenLlamaConfig.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.OpenLlamaConfig.rope_scaling",description:`<strong>rope_scaling</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
Dictionary containing the scaling configuration for the RoPE embeddings. Currently supports two scaling
strategies: linear and dynamic. Their scaling factor must be a float greater than 1. The expected format is
<code>{&quot;type&quot;: strategy name, &quot;factor&quot;: scaling factor}</code>. When using this flag, don&#x2019;t update
<code>max_position_embeddings</code> to the expected new maximum. See the following thread for more information on how
these scaling strategies behave:
<a href="https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/" rel="nofollow">https://www.reddit.com/r/LocalLLaMA/comments/14mrgpr/dynamically_scaled_rope_further_increases/</a>. This is an
experimental feature, subject to breaking API changes in future versions.`,name:"rope_scaling"},{anchor:"transformers.OpenLlamaConfig.Example",description:"<strong>Example</strong> &#x2014;",name:"Example"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/open_llama/configuration_open_llama.py#L29"}}),H=new zn({props:{anchor:"transformers.OpenLlamaConfig.example",$$slots:{default:[Un]},$$scope:{ctx:L}}}),Q=new we({props:{title:"OpenLlamaModel",local:"transformers.OpenLlamaModel",headingTag:"h2"}}),K=new de({props:{name:"class transformers.OpenLlamaModel",anchor:"transformers.OpenLlamaModel",parameters:[{name:"config",val:": OpenLlamaConfig"}],parametersDescription:[{anchor:"transformers.OpenLlamaModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/open-llama#transformers.OpenLlamaConfig">OpenLlamaConfig</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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.OpenLlamaModel.config",description:"<strong>config</strong> &#x2014; OpenLlamaConfig",name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/open_llama/modeling_open_llama.py#L517"}}),ee=new de({props:{name:"forward",anchor:"transformers.OpenLlamaModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.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.OpenLlamaModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OpenLlamaModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OpenLlamaModel.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.OpenLlamaModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OpenLlamaModel.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.OpenLlamaModel.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.OpenLlamaModel.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.OpenLlamaModel.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.OpenLlamaModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/open_llama/modeling_open_llama.py#L552"}}),Z=new Me({props:{$$slots:{default:[Bn]},$$scope:{ctx:L}}}),ne=new we({props:{title:"OpenLlamaForCausalLM",local:"transformers.OpenLlamaForCausalLM",headingTag:"h2"}}),te=new de({props:{name:"class transformers.OpenLlamaForCausalLM",anchor:"transformers.OpenLlamaForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/open_llama/modeling_open_llama.py#L679"}}),oe=new de({props:{name:"forward",anchor:"transformers.OpenLlamaForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.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.OpenLlamaForCausalLM.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OpenLlamaForCausalLM.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OpenLlamaForCausalLM.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.OpenLlamaForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OpenLlamaForCausalLM.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.OpenLlamaForCausalLM.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.OpenLlamaForCausalLM.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.OpenLlamaForCausalLM.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.OpenLlamaForCausalLM.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OpenLlamaForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
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:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/deprecated/open_llama/modeling_open_llama.py#L709",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),N=new Me({props:{$$slots:{default:[Hn]},$$scope:{ctx:L}}}),G=new zn({props:{anchor:"transformers.OpenLlamaForCausalLM.forward.example",$$slots:{default:[Zn]},$$scope:{ctx:L}}}),ae=new we({props:{title:"OpenLlamaForSequenceClassification",local:"transformers.OpenLlamaForSequenceClassification",headingTag:"h2"}}),se=new de({props:{name:"class transformers.OpenLlamaForSequenceClassification",anchor:"transformers.OpenLlamaForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.OpenLlamaForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/open-llama#transformers.OpenLlamaConfig">OpenLlamaConfig</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/main/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/main/src/transformers/models/deprecated/open_llama/modeling_open_llama.py#L852"}}),re=new de({props:{name:"forward",anchor:"transformers.OpenLlamaForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.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.OpenLlamaForSequenceClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.OpenLlamaForSequenceClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.OpenLlamaForSequenceClassification.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.OpenLlamaForSequenceClassification.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.OpenLlamaForSequenceClassification.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.OpenLlamaForSequenceClassification.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.OpenLlamaForSequenceClassification.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.OpenLlamaForSequenceClassification.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.OpenLlamaForSequenceClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.OpenLlamaForSequenceClassification.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/main/src/transformers/models/deprecated/open_llama/modeling_open_llama.py#L883"}}),E=new Me({props:{$$slots:{default:[Nn]},$$scope:{ctx:L}}}),ie=new Sn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/open-llama.md"}}),{c(){n=d("meta"),u=s(),o=d("p"),m=s(),f(k.$$.fragment),p=s(),w=d("div"),w.innerHTML=pn,Oe=s(),f(U.$$.fragment),Ce=s(),f(B.$$.fragment),ze=s(),f(V.$$.fragment),xe=s(),D=d("p"),D.textContent=un,Fe=s(),Y=d("p"),Y.textContent=hn,Pe=s(),A=d("p"),A.innerHTML=fn,Ie=s(),f(R.$$.fragment),qe=s(),O=d("div"),f(X.$$.fragment),Ge=s(),me=d("p"),me.innerHTML=gn,Ee=s(),pe=d("p"),pe.innerHTML=_n,Ve=s(),f(H.$$.fragment),We=s(),f(Q.$$.fragment),Se=s(),M=d("div"),f(K.$$.fragment),De=s(),ue=d("p"),ue.innerHTML=bn,Ye=s(),he=d("p"),he.innerHTML=yn,Ae=s(),fe=d("p"),fe.innerHTML=vn,Re=s(),P=d("div"),f(ee.$$.fragment),Xe=s(),ge=d("p"),ge.innerHTML=Tn,Qe=s(),f(Z.$$.fragment),je=s(),f(ne.$$.fragment),Je=s(),W=d("div"),f(te.$$.fragment),Ke=s(),z=d("div"),f(oe.$$.fragment),en=s(),_e=d("p"),_e.innerHTML=$n,nn=s(),f(N.$$.fragment),tn=s(),f(G.$$.fragment),Ue=s(),f(ae.$$.fragment),Be=s(),T=d("div"),f(se.$$.fragment),on=s(),be=d("p"),be.textContent=Ln,an=s(),ye=d("p"),ye.innerHTML=wn,sn=s(),ve=d("p"),ve.innerHTML=kn,rn=s(),Te=d("p"),Te.innerHTML=Mn,ln=s(),$e=d("p"),$e.innerHTML=On,dn=s(),I=d("div"),f(re.$$.fragment),cn=s(),Le=d("p"),Le.innerHTML=Cn,mn=s(),f(E.$$.fragment),He=s(),f(ie.$$.fragment),Ze=s(),ke=d("p"),this.h()},l(e){const t=Wn("svelte-u9bgzb",document.head);n=c(t,"META",{name:!0,content:!0}),t.forEach(a),u=r(e),o=c(e,"P",{}),J(o).forEach(a),m=r(e),g(k.$$.fragment,e),p=r(e),w=c(e,"DIV",{class:!0,"data-svelte-h":!0}),h(w)!=="svelte-13t8s2t"&&(w.innerHTML=pn),Oe=r(e),g(U.$$.fragment,e),Ce=r(e),g(B.$$.fragment,e),ze=r(e),g(V.$$.fragment,e),xe=r(e),D=c(e,"P",{"data-svelte-h":!0}),h(D)!=="svelte-ycxpq0"&&(D.textContent=un),Fe=r(e),Y=c(e,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-1snb5sc"&&(Y.textContent=hn),Pe=r(e),A=c(e,"P",{"data-svelte-h":!0}),h(A)!=="svelte-glizh3"&&(A.innerHTML=fn),Ie=r(e),g(R.$$.fragment,e),qe=r(e),O=c(e,"DIV",{class:!0});var x=J(O);g(X.$$.fragment,x),Ge=r(x),me=c(x,"P",{"data-svelte-h":!0}),h(me)!=="svelte-1e6w5uw"&&(me.innerHTML=gn),Ee=r(x),pe=c(x,"P",{"data-svelte-h":!0}),h(pe)!=="svelte-o55m63"&&(pe.innerHTML=_n),Ve=r(x),g(H.$$.fragment,x),x.forEach(a),We=r(e),g(Q.$$.fragment,e),Se=r(e),M=c(e,"DIV",{class:!0});var C=J(M);g(K.$$.fragment,C),De=r(C),ue=c(C,"P",{"data-svelte-h":!0}),h(ue)!=="svelte-1ap6vay"&&(ue.innerHTML=bn),Ye=r(C),he=c(C,"P",{"data-svelte-h":!0}),h(he)!=="svelte-hswkmf"&&(he.innerHTML=yn),Ae=r(C),fe=c(C,"P",{"data-svelte-h":!0}),h(fe)!=="svelte-aj729g"&&(fe.innerHTML=vn),Re=r(C),P=c(C,"DIV",{class:!0});var S=J(P);g(ee.$$.fragment,S),Xe=r(S),ge=c(S,"P",{"data-svelte-h":!0}),h(ge)!=="svelte-ijxxc7"&&(ge.innerHTML=Tn),Qe=r(S),g(Z.$$.fragment,S),S.forEach(a),C.forEach(a),je=r(e),g(ne.$$.fragment,e),Je=r(e),W=c(e,"DIV",{class:!0});var le=J(W);g(te.$$.fragment,le),Ke=r(le),z=c(le,"DIV",{class:!0});var F=J(z);g(oe.$$.fragment,F),en=r(F),_e=c(F,"P",{"data-svelte-h":!0}),h(_e)!=="svelte-1azw5v3"&&(_e.innerHTML=$n),nn=r(F),g(N.$$.fragment,F),tn=r(F),g(G.$$.fragment,F),F.forEach(a),le.forEach(a),Ue=r(e),g(ae.$$.fragment,e),Be=r(e),T=c(e,"DIV",{class:!0});var $=J(T);g(se.$$.fragment,$),on=r($),be=c($,"P",{"data-svelte-h":!0}),h(be)!=="svelte-62must"&&(be.textContent=Ln),an=r($),ye=c($,"P",{"data-svelte-h":!0}),h(ye)!=="svelte-1v4v25c"&&(ye.innerHTML=wn),sn=r($),ve=c($,"P",{"data-svelte-h":!0}),h(ve)!=="svelte-10ugs3m"&&(ve.innerHTML=kn),rn=r($),Te=c($,"P",{"data-svelte-h":!0}),h(Te)!=="svelte-6pahdo"&&(Te.innerHTML=Mn),ln=r($),$e=c($,"P",{"data-svelte-h":!0}),h($e)!=="svelte-hswkmf"&&($e.innerHTML=On),dn=r($),I=c($,"DIV",{class:!0});var j=J(I);g(re.$$.fragment,j),cn=r(j),Le=c(j,"P",{"data-svelte-h":!0}),h(Le)!=="svelte-ma5ip1"&&(Le.innerHTML=Cn),mn=r(j),g(E.$$.fragment,j),j.forEach(a),$.forEach(a),He=r(e),g(ie.$$.fragment,e),Ze=r(e),ke=c(e,"P",{}),J(ke).forEach(a),this.h()},h(){q(n,"name","hf:doc:metadata"),q(n,"content",En),q(w,"class","flex flex-wrap space-x-1"),q(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),q(T,"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){i(document.head,n),l(e,u,t),l(e,o,t),l(e,m,t),_(k,e,t),l(e,p,t),l(e,w,t),l(e,Oe,t),_(U,e,t),l(e,Ce,t),_(B,e,t),l(e,ze,t),_(V,e,t),l(e,xe,t),l(e,D,t),l(e,Fe,t),l(e,Y,t),l(e,Pe,t),l(e,A,t),l(e,Ie,t),_(R,e,t),l(e,qe,t),l(e,O,t),_(X,O,null),i(O,Ge),i(O,me),i(O,Ee),i(O,pe),i(O,Ve),_(H,O,null),l(e,We,t),_(Q,e,t),l(e,Se,t),l(e,M,t),_(K,M,null),i(M,De),i(M,ue),i(M,Ye),i(M,he),i(M,Ae),i(M,fe),i(M,Re),i(M,P),_(ee,P,null),i(P,Xe),i(P,ge),i(P,Qe),_(Z,P,null),l(e,je,t),_(ne,e,t),l(e,Je,t),l(e,W,t),_(te,W,null),i(W,Ke),i(W,z),_(oe,z,null),i(z,en),i(z,_e),i(z,nn),_(N,z,null),i(z,tn),_(G,z,null),l(e,Ue,t),_(ae,e,t),l(e,Be,t),l(e,T,t),_(se,T,null),i(T,on),i(T,be),i(T,an),i(T,ye),i(T,sn),i(T,ve),i(T,rn),i(T,Te),i(T,ln),i(T,$e),i(T,dn),i(T,I),_(re,I,null),i(I,cn),i(I,Le),i(I,mn),_(E,I,null),l(e,He,t),_(ie,e,t),l(e,Ze,t),l(e,ke,t),Ne=!0},p(e,[t]){const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),U.$set(x);const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),B.$set(C);const S={};t&2&&(S.$$scope={dirty:t,ctx:e}),H.$set(S);const le={};t&2&&(le.$$scope={dirty:t,ctx:e}),Z.$set(le);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),N.$set(F);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),G.$set($);const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),E.$set(j)},i(e){Ne||(b(k.$$.fragment,e),b(U.$$.fragment,e),b(B.$$.fragment,e),b(V.$$.fragment,e),b(R.$$.fragment,e),b(X.$$.fragment,e),b(H.$$.fragment,e),b(Q.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(Z.$$.fragment,e),b(ne.$$.fragment,e),b(te.$$.fragment,e),b(oe.$$.fragment,e),b(N.$$.fragment,e),b(G.$$.fragment,e),b(ae.$$.fragment,e),b(se.$$.fragment,e),b(re.$$.fragment,e),b(E.$$.fragment,e),b(ie.$$.fragment,e),Ne=!0)},o(e){y(k.$$.fragment,e),y(U.$$.fragment,e),y(B.$$.fragment,e),y(V.$$.fragment,e),y(R.$$.fragment,e),y(X.$$.fragment,e),y(H.$$.fragment,e),y(Q.$$.fragment,e),y(K.$$.fragment,e),y(ee.$$.fragment,e),y(Z.$$.fragment,e),y(ne.$$.fragment,e),y(te.$$.fragment,e),y(oe.$$.fragment,e),y(N.$$.fragment,e),y(G.$$.fragment,e),y(ae.$$.fragment,e),y(se.$$.fragment,e),y(re.$$.fragment,e),y(E.$$.fragment,e),y(ie.$$.fragment,e),Ne=!1},d(e){e&&(a(u),a(o),a(m),a(p),a(w),a(Oe),a(Ce),a(ze),a(xe),a(D),a(Fe),a(Y),a(Pe),a(A),a(Ie),a(qe),a(O),a(We),a(Se),a(M),a(je),a(Je),a(W),a(Ue),a(Be),a(T),a(He),a(Ze),a(ke)),a(n),v(k,e),v(U,e),v(B,e),v(V,e),v(R,e),v(X),v(H),v(Q,e),v(K),v(ee),v(Z),v(ne,e),v(te),v(oe),v(N),v(G),v(ae,e),v(se),v(re),v(E),v(ie,e)}}}const En='{"title":"Open-Llama","local":"open-llama","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"OpenLlamaConfig","local":"transformers.OpenLlamaConfig","sections":[],"depth":2},{"title":"OpenLlamaModel","local":"transformers.OpenLlamaModel","sections":[],"depth":2},{"title":"OpenLlamaForCausalLM","local":"transformers.OpenLlamaForCausalLM","sections":[],"depth":2},{"title":"OpenLlamaForSequenceClassification","local":"transformers.OpenLlamaForSequenceClassification","sections":[],"depth":2}],"depth":1}';function Vn(L){return Pn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class nt extends In{constructor(n){super(),qn(this,n,Vn,Gn,Fn,{})}}export{nt as component};
