import{s as at,o as st,n as ze}from"../chunks/scheduler.25b97de1.js";import{S as rt,i as it,g as l,s as r,r as u,A as lt,h as d,f as n,c as i,j as ee,u as f,x as w,k as te,y as c,a,v as g,d as _,t as b,w as y}from"../chunks/index.d9030fc9.js";import{T as nt}from"../chunks/Tip.baa67368.js";import{D as ce}from"../chunks/Docstring.ffac8efa.js";import{C as Se}from"../chunks/CodeBlock.e6cd0d95.js";import{E as ot}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as me,E as dt}from"../chunks/EditOnGithub.91d95064.js";function ct(z){let o,p;return o=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdyYW5pdGVNb2RlbCUyQyUyMEdyYW5pdGVDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwR3Jhbml0ZSUyMGdyYW5pdGUtM2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwR3Jhbml0ZUNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMGdyYW5pdGUtN2IlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEdyYW5pdGVNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GraniteModel, GraniteConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Granite granite-3b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GraniteConfig()

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){u(o.$$.fragment)},l(s){f(o.$$.fragment,s)},m(s,h){g(o,s,h),p=!0},p:ze,i(s){p||(_(o.$$.fragment,s),p=!0)},o(s){b(o.$$.fragment,s),p=!1},d(s){y(o,s)}}}function mt(z){let o,p=`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(){o=l("p"),o.innerHTML=p},l(s){o=d(s,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=p)},m(s,h){a(s,o,h)},p:ze,d(s){s&&n(o)}}}function pt(z){let o,p=`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(){o=l("p"),o.innerHTML=p},l(s){o=d(s,"P",{"data-svelte-h":!0}),w(o)!=="svelte-fincs2"&&(o.innerHTML=p)},m(s,h){a(s,o,h)},p:ze,d(s){s&&n(o)}}}function ht(z){let o,p="Example:",s,h,k;return h=new Se({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHcmFuaXRlRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyMEdyYW5pdGVGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIybWV0YS1ncmFuaXRlJTJGR3Jhbml0ZS0yLTdiLWhmJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1ldGEtZ3Jhbml0ZSUyRkdyYW5pdGUtMi03Yi1oZiUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXMlM0YlMjBDYW4lMjB5b3UlMjB0YWxrJTIwdG8lMjBtZSUzRiUyMiUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplcihwcm9tcHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoaW5wdXRzLmlucHV0X2lkcyUyQyUyMG1heF9sZW5ndGglM0QzMCklMEF0b2tlbml6ZXIuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GraniteForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GraniteForCausalLM.from_pretrained(<span class="hljs-string">&quot;meta-granite/Granite-2-7b-hf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;meta-granite/Granite-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(){o=l("p"),o.textContent=p,s=r(),u(h.$$.fragment)},l(m){o=d(m,"P",{"data-svelte-h":!0}),w(o)!=="svelte-11lpom8"&&(o.textContent=p),s=i(m),f(h.$$.fragment,m)},m(m,$){a(m,o,$),a(m,s,$),g(h,m,$),k=!0},p:ze,i(m){k||(_(h.$$.fragment,m),k=!0)},o(m){b(h.$$.fragment,m),k=!1},d(m){m&&(n(o),n(s)),y(h,m)}}}function ut(z){let o,p,s,h,k,m,$,pe,W,Xe='The Granite model was proposed in <a href="https://arxiv.org/abs/2408.13359" rel="nofollow">Power Scheduler: A Batch Size and Token Number Agnostic Learning Rate Scheduler</a> by Yikang Shen, Matthew Stallone, Mayank Mishra, Gaoyuan Zhang, Shawn Tan, Aditya Prasad, Adriana Meza Soria, David D. Cox and Rameswar Panda.',he,Z,qe="PowerLM-3B is a 3B state-of-the-art small language model trained with the Power learning rate scheduler. It is trained on a wide range of open-source and synthetic datasets with permissive licenses. PowerLM-3B has shown promising results compared to other models in the size categories across various benchmarks, including natural language multi-choices, code generation, and math reasoning.",ue,P,Ee="The abstract from the paper is the following:",fe,R,Ve=`<em>Finding the optimal learning rate for language model pretraining is a challenging task.
This is not only because there is a complicated correlation between learning rate, batch size, number of training tokens, model size, and other hyperparameters but also because it is prohibitively expensive to perform a hyperparameter search for large language models with Billions or Trillions of parameters. Recent studies propose using small proxy models and small corpus to perform hyperparameter searches and transposing the optimal parameters to large models and large corpus. While the zero-shot transferability is theoretically and empirically proven for model size related hyperparameters, like depth and width, the zero-shot transfer from small corpus to large corpus is underexplored.
In this paper, we study the correlation between optimal learning rate, batch size, and number of training tokens for the recently proposed WSD scheduler. After thousands of small experiments, we found a power-law relationship between variables and demonstrated its transferability across model sizes. Based on the observation, we propose a new learning rate scheduler, Power scheduler, that is agnostic about the number of training tokens and batch size. The experiment shows that combining the Power scheduler with Maximum Update Parameterization (\\mup) can consistently achieve impressive performance with one set of hyperparameters regardless of the number of training tokens, batch size, model size, and even model architecture. Our 3B dense and MoE models trained with the Power scheduler achieve comparable performance as state-of-the-art small language models.
We <a href="https://huggingface.co/collections/ibm/power-lm-66be64ae647ddf11b9808000" rel="nofollow">open source</a> these pretrained models.</em>`,ge,H,Ne="Tips:",_e,S,be,X,Ae='This model was contributed by <a href="https://huggingface.co/mayank-mishra" rel="nofollow">mayank-mishra</a>.',ye,q,we,T,E,xe,ne,Ye=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteModel">GraniteModel</a>. It is used to instantiate an Granite
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 Granite-3B.`,Je,oe,Qe=`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.`,je,U,Me,V,Te,M,N,Ue,ae,Oe=`The bare Granite 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.)`,Ie,se,De=`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.`,Be,re,Ke="Transformer decoder consisting of <em>config.num_hidden_layers</em> layers. Each layer is a <code>GraniteDecoderLayer</code>",Le,x,A,Fe,ie,et='The <a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteModel">GraniteModel</a> forward method, overrides the <code>__call__</code> special method.',We,I,ve,Y,ke,J,Q,Ze,G,O,Pe,le,tt='The <a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteForCausalLM">GraniteForCausalLM</a> forward method, overrides the <code>__call__</code> special method.',Re,B,He,L,Ge,D,$e,de,Ce;return k=new me({props:{title:"Granite",local:"granite",headingTag:"h1"}}),$=new me({props:{title:"Overview",local:"overview",headingTag:"h2"}}),S=new Se({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTBBJTBBbW9kZWxfcGF0aCUyMCUzRCUyMCUyMmlibSUyRlBvd2VyTE0tM2IlMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChtb2RlbF9wYXRoKSUwQSUwQSUyMyUyMGRyb3AlMjBkZXZpY2VfbWFwJTIwaWYlMjBydW5uaW5nJTIwb24lMjBDUFUlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZChtb2RlbF9wYXRoJTJDJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIpJTBBbW9kZWwuZXZhbCgpJTBBJTBBJTIzJTIwY2hhbmdlJTIwaW5wdXQlMjB0ZXh0JTIwYXMlMjBkZXNpcmVkJTBBcHJvbXB0JTIwJTNEJTIwJTIyV3JpdGUlMjBhJTIwY29kZSUyMHRvJTIwZmluZCUyMHRoZSUyMG1heGltdW0lMjB2YWx1ZSUyMGluJTIwYSUyMGxpc3QlMjBvZiUyMG51bWJlcnMuJTIyJTBBJTBBJTIzJTIwdG9rZW5pemUlMjB0aGUlMjB0ZXh0JTBBaW5wdXRfdG9rZW5zJTIwJTNEJTIwdG9rZW5pemVyKHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTIzJTIwZ2VuZXJhdGUlMjBvdXRwdXQlMjB0b2tlbnMlMEFvdXRwdXQlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZSgqKmlucHV0X3Rva2VucyUyQyUyMG1heF9uZXdfdG9rZW5zJTNEMTAwKSUwQSUyMyUyMGRlY29kZSUyMG91dHB1dCUyMHRva2VucyUyMGludG8lMjB0ZXh0JTBBb3V0cHV0JTIwJTNEJTIwdG9rZW5pemVyLmJhdGNoX2RlY29kZShvdXRwdXQpJTBBJTIzJTIwbG9vcCUyMG92ZXIlMjB0aGUlMjBiYXRjaCUyMHRvJTIwcHJpbnQlMkMlMjBpbiUyMHRoaXMlMjBleGFtcGxlJTIwdGhlJTIwYmF0Y2glMjBzaXplJTIwaXMlMjAxJTBBZm9yJTIwaSUyMGluJTIwb3V0cHV0JTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoaSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer

model_path = <span class="hljs-string">&quot;ibm/PowerLM-3b&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(model_path)

<span class="hljs-comment"># drop device_map if running on CPU</span>
model = AutoModelForCausalLM.from_pretrained(model_path, device_map=<span class="hljs-string">&quot;auto&quot;</span>)
model.<span class="hljs-built_in">eval</span>()

<span class="hljs-comment"># change input text as desired</span>
prompt = <span class="hljs-string">&quot;Write a code to find the maximum value in a list of numbers.&quot;</span>

<span class="hljs-comment"># tokenize the text</span>
input_tokens = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-comment"># generate output tokens</span>
output = model.generate(**input_tokens, max_new_tokens=<span class="hljs-number">100</span>)
<span class="hljs-comment"># decode output tokens into text</span>
output = tokenizer.batch_decode(output)
<span class="hljs-comment"># loop over the batch to print, in this example the batch size is 1</span>
<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> output:
    <span class="hljs-built_in">print</span>(i)`,wrap:!1}}),q=new me({props:{title:"GraniteConfig",local:"transformers.GraniteConfig",headingTag:"h2"}}),E=new ce({props:{name:"class transformers.GraniteConfig",anchor:"transformers.GraniteConfig",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:"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:"embedding_multiplier",val:" = 1.0"},{name:"logits_scaling",val:" = 1.0"},{name:"residual_multiplier",val:" = 1.0"},{name:"attention_multiplier",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GraniteConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the Granite 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/granite#transformers.GraniteModel">GraniteModel</a>`,name:"vocab_size"},{anchor:"transformers.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.`,name:"max_position_embeddings"},{anchor:"transformers.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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.GraniteConfig.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"},{anchor:"transformers.GraniteConfig.embedding_multiplier",description:"<strong>embedding_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014; embedding multiplier",name:"embedding_multiplier"},{anchor:"transformers.GraniteConfig.logits_scaling",description:"<strong>logits_scaling</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014; divisor for output logits",name:"logits_scaling"},{anchor:"transformers.GraniteConfig.residual_multiplier",description:"<strong>residual_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014; residual multiplier",name:"residual_multiplier"},{anchor:"transformers.GraniteConfig.attention_multiplier",description:"<strong>attention_multiplier</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014; attention multiplier",name:"attention_multiplier"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/configuration_granite.py#L30"}}),U=new ot({props:{anchor:"transformers.GraniteConfig.example",$$slots:{default:[ct]},$$scope:{ctx:z}}}),V=new me({props:{title:"GraniteModel",local:"transformers.GraniteModel",headingTag:"h2"}}),N=new ce({props:{name:"class transformers.GraniteModel",anchor:"transformers.GraniteModel",parameters:[{name:"config",val:": GraniteConfig"}],parametersDescription:[{anchor:"transformers.GraniteModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/granite#transformers.GraniteConfig">GraniteConfig</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.GraniteModel.config",description:"<strong>config</strong> &#x2014; GraniteConfig",name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/modeling_granite.py#L493"}}),A=new ce({props:{name:"forward",anchor:"transformers.GraniteModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[transformers.cache_utils.Cache] = 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"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"**flash_attn_kwargs",val:": typing_extensions.Unpack[transformers.modeling_flash_attention_utils.FlashAttentionKwargs]"}],parametersDescription:[{anchor:"transformers.GraniteModel.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.GraniteModel.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>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.GraniteModel.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.GraniteModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our
<a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</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.GraniteModel.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.GraniteModel.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.GraniteModel.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.GraniteModel.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.GraniteModel.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.GraniteModel.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/main/src/transformers/models/granite/modeling_granite.py#L528"}}),I=new nt({props:{$$slots:{default:[mt]},$$scope:{ctx:z}}}),Y=new me({props:{title:"GraniteForCausalLM",local:"transformers.GraniteForCausalLM",headingTag:"h2"}}),Q=new ce({props:{name:"class transformers.GraniteForCausalLM",anchor:"transformers.GraniteForCausalLM",parameters:[{name:"config",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/modeling_granite.py#L762"}}),O=new ce({props:{name:"forward",anchor:"transformers.GraniteForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Union[transformers.cache_utils.Cache, typing.List[torch.FloatTensor], NoneType] = 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"},{name:"cache_position",val:": typing.Optional[torch.LongTensor] = None"},{name:"num_logits_to_keep",val:": int = 0"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.granite.modeling_granite.KwargsForCausalLM]"}],parametersDescription:[{anchor:"transformers.GraniteForCausalLM.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.GraniteForCausalLM.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>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.GraniteForCausalLM.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.GraniteForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>Cache</code> or <code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our
<a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</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.GraniteForCausalLM.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.GraniteForCausalLM.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.GraniteForCausalLM.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.GraniteForCausalLM.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.GraniteForCausalLM.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.GraniteForCausalLM.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.GraniteForCausalLM.forward.Args",description:`<strong>Args</strong> &#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>.</p>
<p>num_logits_to_keep (<code>int</code>, <em>optional</em>):
Calculate logits for the last <code>num_logits_to_keep</code> tokens. If <code>0</code>, calculate logits for all
<code>input_ids</code> (special case). Only last token logits are needed for generation, and calculating them only for that
token can save memory, which becomes pretty significant for long sequences or large vocabulary size.`,name:"Args"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/modeling_granite.py#L793",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/granite#transformers.GraniteConfig"
>GraniteConfig</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>
`}}),B=new nt({props:{$$slots:{default:[pt]},$$scope:{ctx:z}}}),L=new ot({props:{anchor:"transformers.GraniteForCausalLM.forward.example",$$slots:{default:[ht]},$$scope:{ctx:z}}}),D=new dt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/granite.md"}}),{c(){o=l("meta"),p=r(),s=l("p"),h=r(),u(k.$$.fragment),m=r(),u($.$$.fragment),pe=r(),W=l("p"),W.innerHTML=Xe,he=r(),Z=l("p"),Z.textContent=qe,ue=r(),P=l("p"),P.textContent=Ee,fe=r(),R=l("p"),R.innerHTML=Ve,ge=r(),H=l("p"),H.textContent=Ne,_e=r(),u(S.$$.fragment),be=r(),X=l("p"),X.innerHTML=Ae,ye=r(),u(q.$$.fragment),we=r(),T=l("div"),u(E.$$.fragment),xe=r(),ne=l("p"),ne.innerHTML=Ye,Je=r(),oe=l("p"),oe.innerHTML=Qe,je=r(),u(U.$$.fragment),Me=r(),u(V.$$.fragment),Te=r(),M=l("div"),u(N.$$.fragment),Ue=r(),ae=l("p"),ae.innerHTML=Oe,Ie=r(),se=l("p"),se.innerHTML=De,Be=r(),re=l("p"),re.innerHTML=Ke,Le=r(),x=l("div"),u(A.$$.fragment),Fe=r(),ie=l("p"),ie.innerHTML=et,We=r(),u(I.$$.fragment),ve=r(),u(Y.$$.fragment),ke=r(),J=l("div"),u(Q.$$.fragment),Ze=r(),G=l("div"),u(O.$$.fragment),Pe=r(),le=l("p"),le.innerHTML=tt,Re=r(),u(B.$$.fragment),He=r(),u(L.$$.fragment),Ge=r(),u(D.$$.fragment),$e=r(),de=l("p"),this.h()},l(e){const t=lt("svelte-u9bgzb",document.head);o=d(t,"META",{name:!0,content:!0}),t.forEach(n),p=i(e),s=d(e,"P",{}),ee(s).forEach(n),h=i(e),f(k.$$.fragment,e),m=i(e),f($.$$.fragment,e),pe=i(e),W=d(e,"P",{"data-svelte-h":!0}),w(W)!=="svelte-1jwf5c3"&&(W.innerHTML=Xe),he=i(e),Z=d(e,"P",{"data-svelte-h":!0}),w(Z)!=="svelte-1hugs36"&&(Z.textContent=qe),ue=i(e),P=d(e,"P",{"data-svelte-h":!0}),w(P)!=="svelte-vfdo9a"&&(P.textContent=Ee),fe=i(e),R=d(e,"P",{"data-svelte-h":!0}),w(R)!=="svelte-16cvzw6"&&(R.innerHTML=Ve),ge=i(e),H=d(e,"P",{"data-svelte-h":!0}),w(H)!=="svelte-axv494"&&(H.textContent=Ne),_e=i(e),f(S.$$.fragment,e),be=i(e),X=d(e,"P",{"data-svelte-h":!0}),w(X)!=="svelte-xzc2lh"&&(X.innerHTML=Ae),ye=i(e),f(q.$$.fragment,e),we=i(e),T=d(e,"DIV",{class:!0});var C=ee(T);f(E.$$.fragment,C),xe=i(C),ne=d(C,"P",{"data-svelte-h":!0}),w(ne)!=="svelte-1lacj8j"&&(ne.innerHTML=Ye),Je=i(C),oe=d(C,"P",{"data-svelte-h":!0}),w(oe)!=="svelte-o55m63"&&(oe.innerHTML=Qe),je=i(C),f(U.$$.fragment,C),C.forEach(n),Me=i(e),f(V.$$.fragment,e),Te=i(e),M=d(e,"DIV",{class:!0});var v=ee(M);f(N.$$.fragment,v),Ue=i(v),ae=d(v,"P",{"data-svelte-h":!0}),w(ae)!=="svelte-u6vuei"&&(ae.innerHTML=Oe),Ie=i(v),se=d(v,"P",{"data-svelte-h":!0}),w(se)!=="svelte-hswkmf"&&(se.innerHTML=De),Be=i(v),re=d(v,"P",{"data-svelte-h":!0}),w(re)!=="svelte-v5sw3z"&&(re.innerHTML=Ke),Le=i(v),x=d(v,"DIV",{class:!0});var j=ee(x);f(A.$$.fragment,j),Fe=i(j),ie=d(j,"P",{"data-svelte-h":!0}),w(ie)!=="svelte-m4rpo3"&&(ie.innerHTML=et),We=i(j),f(I.$$.fragment,j),j.forEach(n),v.forEach(n),ve=i(e),f(Y.$$.fragment,e),ke=i(e),J=d(e,"DIV",{class:!0});var K=ee(J);f(Q.$$.fragment,K),Ze=i(K),G=d(K,"DIV",{class:!0});var F=ee(G);f(O.$$.fragment,F),Pe=i(F),le=d(F,"P",{"data-svelte-h":!0}),w(le)!=="svelte-1iuckjj"&&(le.innerHTML=tt),Re=i(F),f(B.$$.fragment,F),He=i(F),f(L.$$.fragment,F),F.forEach(n),K.forEach(n),Ge=i(e),f(D.$$.fragment,e),$e=i(e),de=d(e,"P",{}),ee(de).forEach(n),this.h()},h(){te(o,"name","hf:doc:metadata"),te(o,"content",ft),te(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),te(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),te(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),te(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),te(J,"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){c(document.head,o),a(e,p,t),a(e,s,t),a(e,h,t),g(k,e,t),a(e,m,t),g($,e,t),a(e,pe,t),a(e,W,t),a(e,he,t),a(e,Z,t),a(e,ue,t),a(e,P,t),a(e,fe,t),a(e,R,t),a(e,ge,t),a(e,H,t),a(e,_e,t),g(S,e,t),a(e,be,t),a(e,X,t),a(e,ye,t),g(q,e,t),a(e,we,t),a(e,T,t),g(E,T,null),c(T,xe),c(T,ne),c(T,Je),c(T,oe),c(T,je),g(U,T,null),a(e,Me,t),g(V,e,t),a(e,Te,t),a(e,M,t),g(N,M,null),c(M,Ue),c(M,ae),c(M,Ie),c(M,se),c(M,Be),c(M,re),c(M,Le),c(M,x),g(A,x,null),c(x,Fe),c(x,ie),c(x,We),g(I,x,null),a(e,ve,t),g(Y,e,t),a(e,ke,t),a(e,J,t),g(Q,J,null),c(J,Ze),c(J,G),g(O,G,null),c(G,Pe),c(G,le),c(G,Re),g(B,G,null),c(G,He),g(L,G,null),a(e,Ge,t),g(D,e,t),a(e,$e,t),a(e,de,t),Ce=!0},p(e,[t]){const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),U.$set(C);const v={};t&2&&(v.$$scope={dirty:t,ctx:e}),I.$set(v);const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),B.$set(j);const K={};t&2&&(K.$$scope={dirty:t,ctx:e}),L.$set(K)},i(e){Ce||(_(k.$$.fragment,e),_($.$$.fragment,e),_(S.$$.fragment,e),_(q.$$.fragment,e),_(E.$$.fragment,e),_(U.$$.fragment,e),_(V.$$.fragment,e),_(N.$$.fragment,e),_(A.$$.fragment,e),_(I.$$.fragment,e),_(Y.$$.fragment,e),_(Q.$$.fragment,e),_(O.$$.fragment,e),_(B.$$.fragment,e),_(L.$$.fragment,e),_(D.$$.fragment,e),Ce=!0)},o(e){b(k.$$.fragment,e),b($.$$.fragment,e),b(S.$$.fragment,e),b(q.$$.fragment,e),b(E.$$.fragment,e),b(U.$$.fragment,e),b(V.$$.fragment,e),b(N.$$.fragment,e),b(A.$$.fragment,e),b(I.$$.fragment,e),b(Y.$$.fragment,e),b(Q.$$.fragment,e),b(O.$$.fragment,e),b(B.$$.fragment,e),b(L.$$.fragment,e),b(D.$$.fragment,e),Ce=!1},d(e){e&&(n(p),n(s),n(h),n(m),n(pe),n(W),n(he),n(Z),n(ue),n(P),n(fe),n(R),n(ge),n(H),n(_e),n(be),n(X),n(ye),n(we),n(T),n(Me),n(Te),n(M),n(ve),n(ke),n(J),n(Ge),n($e),n(de)),n(o),y(k,e),y($,e),y(S,e),y(q,e),y(E),y(U),y(V,e),y(N),y(A),y(I),y(Y,e),y(Q),y(O),y(B),y(L),y(D,e)}}}const ft='{"title":"Granite","local":"granite","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"GraniteConfig","local":"transformers.GraniteConfig","sections":[],"depth":2},{"title":"GraniteModel","local":"transformers.GraniteModel","sections":[],"depth":2},{"title":"GraniteForCausalLM","local":"transformers.GraniteForCausalLM","sections":[],"depth":2}],"depth":1}';function gt(z){return st(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class kt extends rt{constructor(o){super(),it(this,o,gt,ut,at,{})}}export{kt as component};
