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 T,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}),T(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}),T(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:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBHcmFuaXRlRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyMEdyYW5pdGVGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyaWJtJTJGUG93ZXJMTS0zYiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJpYm0lMkZQb3dlckxNLTNiJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkhleSUyQyUyMGFyZSUyMHlvdSUyMGNvbnNjaW91cyUzRiUyMENhbiUyMHlvdSUyMHRhbGslMjB0byUyMG1lJTNGJTIyJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHByb21wdCUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBJTIzJTIwR2VuZXJhdGUlMEFnZW5lcmF0ZV9pZHMlMjAlM0QlMjBtb2RlbC5nZW5lcmF0ZShpbnB1dHMuaW5wdXRfaWRzJTJDJTIwbWF4X2xlbmd0aCUzRDMwKSUwQXRva2VuaXplci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUlMkMlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNERmFsc2UpJTVCMCU1RA==",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;ibm/PowerLM-3b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ibm/PowerLM-3b&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}),T(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,L,qe='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,Ne="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,Xe="The abstract from the paper is the following:",fe,R,Ee=`<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,Ve="Tips:",_e,S,be,q,Ae='This model was contributed by <a href="https://huggingface.co/mayank-mishra" rel="nofollow">mayank-mishra</a>.',ye,N,Te,v,X,xe,ne,Qe=`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,Ye=`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,I,we,E,ve,w,V,Ie,ae,De=`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.)`,Ue,se,Oe=`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>",We,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.',Le,U,Me,Q,ke,J,Y,Ze,G,D,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,W,Ge,O,$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}}),N=new me({props:{title:"GraniteConfig",local:"transformers.GraniteConfig",headingTag:"h2"}}),X=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"}}),I=new ot({props:{anchor:"transformers.GraniteConfig.example",$$slots:{default:[ct]},$$scope:{ctx:z}}}),E=new me({props:{title:"GraniteModel",local:"transformers.GraniteModel",headingTag:"h2"}}),V=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.
config &#x2014; GraniteConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/modeling_granite.py#L704"}}),A=new ce({props:{name:"forward",anchor:"transformers.GraniteModel.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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#L747"}}),U=new nt({props:{$$slots:{default:[mt]},$$scope:{ctx:z}}}),Q=new me({props:{title:"GraniteForCausalLM",local:"transformers.GraniteForCausalLM",headingTag:"h2"}}),Y=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#L1008"}}),D=new ce({props:{name:"forward",anchor:"transformers.GraniteForCausalLM.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": Optional = None"},{name:"position_ids",val:": Optional = None"},{name:"past_key_values",val:": Union = None"},{name:"inputs_embeds",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"use_cache",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"cache_position",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.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.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"cache_position"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/granite/modeling_granite.py#L1039",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}}}),W=new ot({props:{anchor:"transformers.GraniteForCausalLM.forward.example",$$slots:{default:[ht]},$$scope:{ctx:z}}}),O=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(),L=l("p"),L.innerHTML=qe,he=r(),Z=l("p"),Z.textContent=Ne,ue=r(),P=l("p"),P.textContent=Xe,fe=r(),R=l("p"),R.innerHTML=Ee,ge=r(),H=l("p"),H.textContent=Ve,_e=r(),u(S.$$.fragment),be=r(),q=l("p"),q.innerHTML=Ae,ye=r(),u(N.$$.fragment),Te=r(),v=l("div"),u(X.$$.fragment),xe=r(),ne=l("p"),ne.innerHTML=Qe,Je=r(),oe=l("p"),oe.innerHTML=Ye,je=r(),u(I.$$.fragment),we=r(),u(E.$$.fragment),ve=r(),w=l("div"),u(V.$$.fragment),Ie=r(),ae=l("p"),ae.innerHTML=De,Ue=r(),se=l("p"),se.innerHTML=Oe,Be=r(),re=l("p"),re.innerHTML=Ke,We=r(),x=l("div"),u(A.$$.fragment),Fe=r(),ie=l("p"),ie.innerHTML=et,Le=r(),u(U.$$.fragment),Me=r(),u(Q.$$.fragment),ke=r(),J=l("div"),u(Y.$$.fragment),Ze=r(),G=l("div"),u(D.$$.fragment),Pe=r(),le=l("p"),le.innerHTML=tt,Re=r(),u(B.$$.fragment),He=r(),u(W.$$.fragment),Ge=r(),u(O.$$.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),L=d(e,"P",{"data-svelte-h":!0}),T(L)!=="svelte-1jwf5c3"&&(L.innerHTML=qe),he=i(e),Z=d(e,"P",{"data-svelte-h":!0}),T(Z)!=="svelte-1hugs36"&&(Z.textContent=Ne),ue=i(e),P=d(e,"P",{"data-svelte-h":!0}),T(P)!=="svelte-vfdo9a"&&(P.textContent=Xe),fe=i(e),R=d(e,"P",{"data-svelte-h":!0}),T(R)!=="svelte-16cvzw6"&&(R.innerHTML=Ee),ge=i(e),H=d(e,"P",{"data-svelte-h":!0}),T(H)!=="svelte-axv494"&&(H.textContent=Ve),_e=i(e),f(S.$$.fragment,e),be=i(e),q=d(e,"P",{"data-svelte-h":!0}),T(q)!=="svelte-xzc2lh"&&(q.innerHTML=Ae),ye=i(e),f(N.$$.fragment,e),Te=i(e),v=d(e,"DIV",{class:!0});var C=ee(v);f(X.$$.fragment,C),xe=i(C),ne=d(C,"P",{"data-svelte-h":!0}),T(ne)!=="svelte-1lacj8j"&&(ne.innerHTML=Qe),Je=i(C),oe=d(C,"P",{"data-svelte-h":!0}),T(oe)!=="svelte-o55m63"&&(oe.innerHTML=Ye),je=i(C),f(I.$$.fragment,C),C.forEach(n),we=i(e),f(E.$$.fragment,e),ve=i(e),w=d(e,"DIV",{class:!0});var M=ee(w);f(V.$$.fragment,M),Ie=i(M),ae=d(M,"P",{"data-svelte-h":!0}),T(ae)!=="svelte-u6vuei"&&(ae.innerHTML=De),Ue=i(M),se=d(M,"P",{"data-svelte-h":!0}),T(se)!=="svelte-hswkmf"&&(se.innerHTML=Oe),Be=i(M),re=d(M,"P",{"data-svelte-h":!0}),T(re)!=="svelte-v5sw3z"&&(re.innerHTML=Ke),We=i(M),x=d(M,"DIV",{class:!0});var j=ee(x);f(A.$$.fragment,j),Fe=i(j),ie=d(j,"P",{"data-svelte-h":!0}),T(ie)!=="svelte-m4rpo3"&&(ie.innerHTML=et),Le=i(j),f(U.$$.fragment,j),j.forEach(n),M.forEach(n),Me=i(e),f(Q.$$.fragment,e),ke=i(e),J=d(e,"DIV",{class:!0});var K=ee(J);f(Y.$$.fragment,K),Ze=i(K),G=d(K,"DIV",{class:!0});var F=ee(G);f(D.$$.fragment,F),Pe=i(F),le=d(F,"P",{"data-svelte-h":!0}),T(le)!=="svelte-1iuckjj"&&(le.innerHTML=tt),Re=i(F),f(B.$$.fragment,F),He=i(F),f(W.$$.fragment,F),F.forEach(n),K.forEach(n),Ge=i(e),f(O.$$.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(v,"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(w,"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,L,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,q,t),a(e,ye,t),g(N,e,t),a(e,Te,t),a(e,v,t),g(X,v,null),c(v,xe),c(v,ne),c(v,Je),c(v,oe),c(v,je),g(I,v,null),a(e,we,t),g(E,e,t),a(e,ve,t),a(e,w,t),g(V,w,null),c(w,Ie),c(w,ae),c(w,Ue),c(w,se),c(w,Be),c(w,re),c(w,We),c(w,x),g(A,x,null),c(x,Fe),c(x,ie),c(x,Le),g(U,x,null),a(e,Me,t),g(Q,e,t),a(e,ke,t),a(e,J,t),g(Y,J,null),c(J,Ze),c(J,G),g(D,G,null),c(G,Pe),c(G,le),c(G,Re),g(B,G,null),c(G,He),g(W,G,null),a(e,Ge,t),g(O,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}),I.$set(C);const M={};t&2&&(M.$$scope={dirty:t,ctx:e}),U.$set(M);const j={};t&2&&(j.$$scope={dirty:t,ctx:e}),B.$set(j);const K={};t&2&&(K.$$scope={dirty:t,ctx:e}),W.$set(K)},i(e){Ce||(_(k.$$.fragment,e),_($.$$.fragment,e),_(S.$$.fragment,e),_(N.$$.fragment,e),_(X.$$.fragment,e),_(I.$$.fragment,e),_(E.$$.fragment,e),_(V.$$.fragment,e),_(A.$$.fragment,e),_(U.$$.fragment,e),_(Q.$$.fragment,e),_(Y.$$.fragment,e),_(D.$$.fragment,e),_(B.$$.fragment,e),_(W.$$.fragment,e),_(O.$$.fragment,e),Ce=!0)},o(e){b(k.$$.fragment,e),b($.$$.fragment,e),b(S.$$.fragment,e),b(N.$$.fragment,e),b(X.$$.fragment,e),b(I.$$.fragment,e),b(E.$$.fragment,e),b(V.$$.fragment,e),b(A.$$.fragment,e),b(U.$$.fragment,e),b(Q.$$.fragment,e),b(Y.$$.fragment,e),b(D.$$.fragment,e),b(B.$$.fragment,e),b(W.$$.fragment,e),b(O.$$.fragment,e),Ce=!1},d(e){e&&(n(p),n(s),n(h),n(m),n(pe),n(L),n(he),n(Z),n(ue),n(P),n(fe),n(R),n(ge),n(H),n(_e),n(be),n(q),n(ye),n(Te),n(v),n(we),n(ve),n(w),n(Me),n(ke),n(J),n(Ge),n($e),n(de)),n(o),y(k,e),y($,e),y(S,e),y(N,e),y(X),y(I),y(E,e),y(V),y(A),y(U),y(Q,e),y(Y),y(D),y(B),y(W),y(O,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};
