import{s as nt,f as it,o as lt,n as st}from"../chunks/scheduler.25b97de1.js";import{S as ct,i as dt,g as i,s as r,r as m,A as mt,h as l,f as t,c as a,j as w,u as p,x as d,k as y,y as n,a as s,v as h,d as g,t as f,w as u}from"../chunks/index.d9030fc9.js";import{T as pt}from"../chunks/Tip.baa67368.js";import{D as q}from"../chunks/Docstring.ffac8efa.js";import{C as qo}from"../chunks/CodeBlock.e6cd0d95.js";import{E as ht}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as W,E as gt}from"../chunks/EditOnGithub.91d95064.js";function ft(_e){let c,U="Example:",x,M,I;return M=new qo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFBpeHRyYWxWaXNpb25Nb2RlbCUyQyUyMFBpeHRyYWxWaXNpb25Db25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwUGl4dHJhbC0xMkIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWclMjAlM0QlMjBQaXh0cmFsVmlzaW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwbW9kZWwlMjAod2l0aCUyMHJhbmRvbWx5JTIwaW5pdGlhbGl6ZWQlMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBQaXh0cmFsVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PixtralVisionModel, PixtralVisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Pixtral-12B style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config = PixtralVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with randomly initialized weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = PixtralVisionModel(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(){c=i("p"),c.textContent=U,x=r(),m(M.$$.fragment)},l(_){c=l(_,"P",{"data-svelte-h":!0}),d(c)!=="svelte-11lpom8"&&(c.textContent=U),x=a(_),p(M.$$.fragment,_)},m(_,z){s(_,c,z),s(_,x,z),h(M,_,z),I=!0},p:st,i(_){I||(g(M.$$.fragment,_),I=!0)},o(_){f(M.$$.fragment,_),I=!1},d(_){_&&(t(c),t(x)),u(M,_)}}}function ut(_e){let c,U=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){c=i("p"),c.innerHTML=U},l(x){c=l(x,"P",{"data-svelte-h":!0}),d(c)!=="svelte-fincs2"&&(c.innerHTML=U)},m(x,M){s(x,c,M)},p:st,d(x){x&&t(c)}}}function _t(_e){let c,U,x,M,I,_,z,Le,E,Fo='The Pixtral model was released by the Mistral AI team in a <a href="https://mistral.ai/news/pixtral-12b/" rel="nofollow">blog post</a>. Pixtral is a multimodal version of <a href="mistral">Mistral</a>, incorporating a 400 million parameter vision encoder trained from scratch.',Re,D,Lo="The intro from the blog says the following:",Ve,S,Ro="<em>Pixtral is trained to understand both natural images and documents, achieving 52.5% on the MMMU reasoning benchmark, surpassing a number of larger models. The model shows strong abilities in tasks such as chart and figure understanding, document question answering, multimodal reasoning and instruction following. Pixtral is able to ingest images at their natural resolution and aspect ratio, giving the user flexibility on the number of tokens used to process an image. Pixtral is also able to process any number of images in its long context window of 128K tokens. Unlike previous open-source models, Pixtral does not compromise on text benchmark performance to excel in multimodal tasks.</em>",Ne,F,Vo,Be,A,No='Pixtral architecture. Taken from the <a href="https://mistral.ai/news/pixtral-12b/">blog post.</a>',Ge,Z,Bo="Tips:",We,H,Go='<li>Pixtral is a multimodal model, taking images and text as input, and producing text as output.</li> <li>This model follows the <a href="llava">Llava</a> architecture. The model uses <a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralVisionModel">PixtralVisionModel</a> for its vision encoder, and <a href="/docs/transformers/main/en/model_doc/mistral#transformers.MistralForCausalLM">MistralForCausalLM</a> for its language decoder.</li> <li>The main contribution is the 2d ROPE (rotary position embeddings) on the images, and support for arbitrary image sizes (the images are not padded together nor are they resized).</li> <li>Similar to <a href="llava">Llava</a>, the model internally replaces the <code>[IMG]</code> token placeholders by image embeddings from the vision encoder. The format for one or multiple prompts is the following:</li>',Ee,X,De,Q,Wo='Then, the processor will replace each <code>[IMG]</code> token with a number of <code>[IMG]</code> tokens that depend on the height and the width of each image. Each <em>row</em> of the image is separated by an <code>[IMG_BREAK]</code> token, and each image is separated by an <code>[IMG_END]</code> token. It’s advised to use the <code>apply_chat_template</code> method of the processor, which takes care of all of this and formats the text for you. If you’re using <code>transformers&gt;=4.49.0</code>, you can also get a vectorized output from <code>apply_chat_template</code>. See the <a href="#usage">usage section</a> for more info.',Se,Y,Eo='This model was contributed by <a href="https://huggingface.co/amyeroberts" rel="nofollow">amyeroberts</a> and <a href="https://huggingface.co/ArthurZ" rel="nofollow">ArthurZ</a>. The original code can be found <a href="https://github.com/vllm-project/vllm/pull/8377" rel="nofollow">here</a>.',Ae,O,Ze,K,Do="At inference time, it’s advised to use the processor’s <code>apply_chat_template</code> method, which correctly formats the prompt for the model:",He,ee,Xe,oe,Qe,b,te,ho,xe,So=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralVisionModel">PixtralVisionModel</a>. It is used to instantiate an
Pixtral vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to the vision encoder used by Pixtral-12B.`,go,be,Ao='e.g. <a href="https://huggingface.co/pixtral-hf/pixtral-9b" rel="nofollow">pixtral-hf/pixtral-9b</a>',fo,Pe,Zo=`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.`,uo,L,Ye,re,Oe,v,ae,_o,ye,Ho=`The bare Pixtral vision encoder 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.)`,xo,Me,Xo=`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.`,bo,J,se,Po,ve,Qo='The <a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralVisionModel">PixtralVisionModel</a> forward method, overrides the <code>__call__</code> special method.',yo,R,Ke,ne,eo,$,ie,Mo,Te,Yo="Constructs a Pixtral image processor.",vo,V,le,To,Ie,Oo="Preprocess an image or batch of images.",oo,ce,to,C,de,Io,we,Ko="Constructs a fast ConvNeXT image processor.",wo,N,me,zo,ze,et="Preprocess an image or batch of images.",ro,pe,ao,P,he,$o,$e,ot="Constructs a Pixtral processor which wraps a Pixtral image processor and a Pixtral tokenizer into a single processor.",Co,Ce,tt=`<a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralProcessor">PixtralProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/llama#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>. See the
<code>__call__()</code> and <a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralProcessor.decode">decode()</a> for more information.`,jo,B,ge,Uo,je,rt=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,Jo,G,fe,ko,Ue,at=`This method forwards all its arguments to LlamaTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,so,ue,no,Fe,io;return I=new W({props:{title:"Pixtral",local:"pixtral",headingTag:"h1"}}),z=new W({props:{title:"Overview",local:"overview",headingTag:"h2"}}),X=new qo({props:{code:"JTIyJTNDcyUzRSU1QklOU1QlNUQlNUJJTUclNUQlNUNuV2hhdCUyMGFyZSUyMHRoZSUyMHRoaW5ncyUyMEklMjBzaG91bGQlMjBiZSUyMGNhdXRpb3VzJTIwYWJvdXQlMjB3aGVuJTIwSSUyMHZpc2l0JTIwdGhpcyUyMHBsYWNlJTNGJTVCJTJGSU5TVCU1RCUyMg==",highlighted:'&quot;&lt;s&gt;<span class="hljs-selector-attr">[INST]</span><span class="hljs-selector-attr">[IMG]</span>\\nWhat are the things <span class="hljs-selector-tag">I</span> should be cautious about when <span class="hljs-selector-tag">I</span> visit this place?<span class="hljs-selector-attr">[/INST]</span>&quot;',wrap:!1}}),O=new W({props:{title:"Usage",local:"usage",headingTag:"h2"}}),ee=new qo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBMbGF2YUZvckNvbmRpdGlvbmFsR2VuZXJhdGlvbiUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIybWlzdHJhbC1jb21tdW5pdHklMkZwaXh0cmFsLTEyYiUyMiUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkKSUwQW1vZGVsJTIwJTNEJTIwTGxhdmFGb3JDb25kaXRpb25hbEdlbmVyYXRpb24uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwZGV2aWNlX21hcCUzRCUyMmN1ZGElMjIpJTBBJTBBY2hhdCUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkNhbiUyMHRoaXMlMjBhbmltYWwlMjIlN0QlMkMlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIyaW1hZ2UlMjIlMkMlMjAlMjJ1ciUyMiUzQSUyMCUyMmh0dHBzJTNBJTJGJTJGcGljc3VtLnBob3RvcyUyRmlkJTJGMjM3JTJGMjAwJTJGMzAwJTIyJTdEJTJDJTIwJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIybGl2ZSUyMGhlcmUlM0YlMjIlN0QlMkMlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIyaW1hZ2UlMjIlMkMlMjAlMjJ1cmwlMjIlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnBpY3N1bS5waG90b3MlMkZzZWVkJTJGcGljc3VtJTJGMjAwJTJGMzAwJTIyJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTVEJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yLmFwcGx5X2NoYXRfdGVtcGxhdGUoJTBBJTIwJTIwJTIwJTIwY2hhdCUyQyUwQSUyMCUyMCUyMCUyMGFkZF9nZW5lcmF0aW9uX3Byb21wdCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZSUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fZGljdCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTBBKS50byhtb2RlbC5kZXZpY2UpJTBBJTBBZ2VuZXJhdGVfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBtYXhfbmV3X3Rva2VucyUzRDUwMCklMEFvdXRwdXQlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKGdlbmVyYXRlX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlJTJDJTIwY2xlYW5fdXBfdG9rZW5pemF0aW9uX3NwYWNlcyUzREZhbHNlKSU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, LlavaForConditionalGeneration

model_id = <span class="hljs-string">&quot;mistral-community/pixtral-12b&quot;</span>
processor = AutoProcessor.from_pretrained(model_id)
model = LlavaForConditionalGeneration.from_pretrained(model_id, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)

chat = [
    {
      <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [
        {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Can this animal&quot;</span>}, 
        {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>, <span class="hljs-string">&quot;ur&quot;</span>: <span class="hljs-string">&quot;https://picsum.photos/id/237/200/300&quot;</span>}, 
        {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;live here?&quot;</span>}, 
        {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>, <span class="hljs-string">&quot;url&quot;</span>: <span class="hljs-string">&quot;https://picsum.photos/seed/picsum/200/300&quot;</span>}
      ]
    }
]

inputs = processor.apply_chat_template(
    chat,
    add_generation_prompt=<span class="hljs-literal">True</span>,
    tokenize=<span class="hljs-literal">True</span>,
    return_dict=<span class="hljs-literal">True</span>,
    return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
).to(model.device)

generate_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">500</span>)
output = processor.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>]`,wrap:!1}}),oe=new W({props:{title:"PixtralVisionConfig",local:"transformers.PixtralVisionConfig",headingTag:"h2"}}),te=new q({props:{name:"class transformers.PixtralVisionConfig",anchor:"transformers.PixtralVisionConfig",parameters:[{name:"hidden_size",val:" = 1024"},{name:"intermediate_size",val:" = 4096"},{name:"num_hidden_layers",val:" = 24"},{name:"num_attention_heads",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 1024"},{name:"patch_size",val:" = 16"},{name:"hidden_act",val:" = 'gelu'"},{name:"attention_dropout",val:" = 0.0"},{name:"rope_theta",val:" = 10000.0"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.PixtralVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.PixtralVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.PixtralVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.PixtralVisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of input channels in the input images.`,name:"num_channels"},{anchor:"transformers.PixtralVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Max dimension of the input images.`,name:"image_size"},{anchor:"transformers.PixtralVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Size of the image patches.`,name:"patch_size"},{anchor:"transformers.PixtralVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
Activation function used in the hidden layers.`,name:"hidden_act"},{anchor:"transformers.PixtralVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Dropout probability for the attention layers.`,name:"attention_dropout"},{anchor:"transformers.PixtralVisionConfig.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.PixtralVisionConfig.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/configuration_pixtral.py#L23"}}),L=new ht({props:{anchor:"transformers.PixtralVisionConfig.example",$$slots:{default:[ft]},$$scope:{ctx:_e}}}),re=new W({props:{title:"PixtralVisionModel",local:"transformers.PixtralVisionModel",headingTag:"h2"}}),ae=new q({props:{name:"class transformers.PixtralVisionModel",anchor:"transformers.PixtralVisionModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.PixtralVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralVisionConfig">PixtralVisionConfig</a>) &#x2014;
Model configuration class with all the parameters of the vision encoder. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/modeling_pixtral.py#L456"}}),se=new q({props:{name:"forward",anchor:"transformers.PixtralVisionModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"image_sizes",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <code>AutoImageProcessor.__call__()</code>
for details.`,name:"pixel_values"},{anchor:"transformers.PixtralVisionModel.forward.image_sizes",description:`<strong>image_sizes</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, 2)</code>, <em>optional</em>) &#x2014;
The sizes of the images in the batch, being (height, width) for each image.`,name:"image_sizes"},{anchor:"transformers.PixtralVisionModel.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.PixtralVisionModel.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.PixtralVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/modeling_pixtral.py#L483",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>tensor of token features for
all tokens of all images of shape (N_toks, D)</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>pixel_values</p>
`}}),R=new pt({props:{$$slots:{default:[ut]},$$scope:{ctx:_e}}}),ne=new W({props:{title:"PixtralImageProcessor",local:"transformers.PixtralImageProcessor",headingTag:"h2"}}),ie=new q({props:{name:"class transformers.PixtralImageProcessor",anchor:"transformers.PixtralImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"patch_size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.PixtralImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;longest_edge&quot; -- 1024}</code>):
Size of the maximum dimension of either the height or width dimension of the image. Used to control how
images are resized. If either the height or width are greater than <code>size[&quot;longest_edge&quot;]</code> then both the height and width are rescaled by <code>height / ratio</code>, <code>width /ratio</code> where <code>ratio = max(height / longest_edge, width / longest_edge)</code>`,name:"size"},{anchor:"transformers.PixtralImageProcessor.patch_size",description:`<strong>patch_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 16, &quot;width&quot;: 16}</code>):
Size of the patches in the model, used to calculate the output image size. Can be overridden by <code>patch_size</code> in the <code>preprocess</code> method.`,name:"patch_size"},{anchor:"transformers.PixtralImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>Resampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.PixtralImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.PixtralImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by <code>rescale_factor</code> in the <code>preprocess</code>
method.`,name:"rescale_factor"},{anchor:"transformers.PixtralImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.PixtralImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.48145466, 0.4578275, 0.40821073]</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.PixtralImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.26862954, 0.26130258, 0.27577711]</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.PixtralImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/image_processing_pixtral.py#L138"}}),le=new q({props:{name:"preprocess",anchor:"transformers.PixtralImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"patch_size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.PixtralImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.PixtralImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.PixtralImageProcessor.preprocess.patch_size",description:`<strong>patch_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.patch_size</code>) &#x2014;
Patch size in the model. Used to calculate the image after resizing.`,name:"patch_size"},{anchor:"transformers.PixtralImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.PixtralImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.PixtralImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.PixtralImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.PixtralImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.PixtralImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.PixtralImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.PixtralImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.PixtralImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.PixtralImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/image_processing_pixtral.py#L318"}}),ce=new W({props:{title:"PixtralImageProcessorFast",local:"transformers.PixtralImageProcessorFast",headingTag:"h2"}}),de=new q({props:{name:"class transformers.PixtralImageProcessorFast",anchor:"transformers.PixtralImageProcessorFast",parameters:[{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.pixtral.image_processing_pixtral_fast.PixtralFastImageProcessorInitKwargs]"}],parametersDescription:[{anchor:"transformers.PixtralImageProcessorFast.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by the
<code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.PixtralImageProcessorFast.size",description:`<strong>size</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.PixtralImageProcessorFast.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.default_to_square</code>) &#x2014;
Whether to default to a square image when resizing, if size is an int.`,name:"default_to_square"},{anchor:"transformers.PixtralImageProcessorFast.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. Only has an effect if <code>do_resize</code> is set to <code>True</code>. Can be
overridden by the <code>resample</code> parameter in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.PixtralImageProcessorFast.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.PixtralImageProcessorFast.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.PixtralImageProcessorFast.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the
<code>do_rescale</code> parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.PixtralImageProcessorFast.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Scale factor to use if rescaling the image. Only has an effect if <code>do_rescale</code> is set to <code>True</code>. Can be
overridden by the <code>rescale_factor</code> parameter in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.PixtralImageProcessorFast.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code> method.`,name:"do_normalize"},{anchor:"transformers.PixtralImageProcessorFast.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method. Can be
overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.PixtralImageProcessorFast.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.PixtralImageProcessorFast.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.PixtralImageProcessorFast.patch_size",description:`<strong>patch_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 16, &quot;width&quot;: 16}</code>):
Size of the patches in the model, used to calculate the output image size. Can be overridden by <code>patch_size</code> in the <code>preprocess</code> method.`,name:"patch_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/image_processing_pixtral_fast.py#L72"}}),me=new q({props:{name:"preprocess",anchor:"transformers.PixtralImageProcessorFast.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.pixtral.image_processing_pixtral_fast.PixtralFastImageProcessorPreprocessKwargs]"}],parametersDescription:[{anchor:"transformers.PixtralImageProcessorFast.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> or <code>InterpolationMode</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the output image after applying <code>center_crop</code>.`,name:"crop_size"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.return_tensors",description:"<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;\nReturns stacked tensors if set to `pt, otherwise returns a list of tensors.",name:"return_tensors"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.`,name:"device"},{anchor:"transformers.PixtralImageProcessorFast.preprocess.patch_size",description:`<strong>patch_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 16, &quot;width&quot;: 16}</code>):
Size of the patches in the model, used to calculate the output image size. Can be overridden by <code>patch_size</code> in the <code>preprocess</code> method.`,name:"patch_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/image_processing_pixtral_fast.py#L97"}}),pe=new W({props:{title:"PixtralProcessor",local:"transformers.PixtralProcessor",headingTag:"h2"}}),he=new q({props:{name:"class transformers.PixtralProcessor",anchor:"transformers.PixtralProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"patch_size",val:": int = 16"},{name:"chat_template",val:" = None"},{name:"image_token",val:" = '[IMG]'"},{name:"image_break_token",val:" = '[IMG_BREAK]'"},{name:"image_end_token",val:" = '[IMG_END]'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PixtralProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/pixtral#transformers.PixtralImageProcessor">PixtralImageProcessor</a>, <em>optional</em>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.PixtralProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/llama#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.PixtralProcessor.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Patch size from the vision tower.`,name:"patch_size"},{anchor:"transformers.PixtralProcessor.chat_template",description:`<strong>chat_template</strong> (<code>str</code>, <em>optional</em>) &#x2014; A Jinja template which will be used to convert lists of messages
in a chat into a tokenizable string.`,name:"chat_template"},{anchor:"transformers.PixtralProcessor.image_token",description:`<strong>image_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[IMG]&quot;</code>) &#x2014;
Special token used to denote image location.`,name:"image_token"},{anchor:"transformers.PixtralProcessor.image_break_token",description:`<strong>image_break_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[IMG_BREAK]&quot;</code>) &#x2014;
Special token used to denote the end of a line of pixels in an image.`,name:"image_break_token"},{anchor:"transformers.PixtralProcessor.image_end_token",description:`<strong>image_end_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[IMG_END]&quot;</code>) &#x2014;
Special token used to denote the end of an image input.`,name:"image_end_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/processing_pixtral.py#L53"}}),ge=new q({props:{name:"batch_decode",anchor:"transformers.PixtralProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/processing_pixtral.py#L213"}}),fe=new q({props:{name:"decode",anchor:"transformers.PixtralProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/pixtral/processing_pixtral.py#L221"}}),ue=new gt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/pixtral.md"}}),{c(){c=i("meta"),U=r(),x=i("p"),M=r(),m(I.$$.fragment),_=r(),m(z.$$.fragment),Le=r(),E=i("p"),E.innerHTML=Fo,Re=r(),D=i("p"),D.textContent=Lo,Ve=r(),S=i("p"),S.innerHTML=Ro,Ne=r(),F=i("img"),Be=r(),A=i("small"),A.innerHTML=No,Ge=r(),Z=i("p"),Z.textContent=Bo,We=r(),H=i("ul"),H.innerHTML=Go,Ee=r(),m(X.$$.fragment),De=r(),Q=i("p"),Q.innerHTML=Wo,Se=r(),Y=i("p"),Y.innerHTML=Eo,Ae=r(),m(O.$$.fragment),Ze=r(),K=i("p"),K.innerHTML=Do,He=r(),m(ee.$$.fragment),Xe=r(),m(oe.$$.fragment),Qe=r(),b=i("div"),m(te.$$.fragment),ho=r(),xe=i("p"),xe.innerHTML=So,go=r(),be=i("p"),be.innerHTML=Ao,fo=r(),Pe=i("p"),Pe.innerHTML=Zo,uo=r(),m(L.$$.fragment),Ye=r(),m(re.$$.fragment),Oe=r(),v=i("div"),m(ae.$$.fragment),_o=r(),ye=i("p"),ye.innerHTML=Ho,xo=r(),Me=i("p"),Me.innerHTML=Xo,bo=r(),J=i("div"),m(se.$$.fragment),Po=r(),ve=i("p"),ve.innerHTML=Qo,yo=r(),m(R.$$.fragment),Ke=r(),m(ne.$$.fragment),eo=r(),$=i("div"),m(ie.$$.fragment),Mo=r(),Te=i("p"),Te.textContent=Yo,vo=r(),V=i("div"),m(le.$$.fragment),To=r(),Ie=i("p"),Ie.textContent=Oo,oo=r(),m(ce.$$.fragment),to=r(),C=i("div"),m(de.$$.fragment),Io=r(),we=i("p"),we.textContent=Ko,wo=r(),N=i("div"),m(me.$$.fragment),zo=r(),ze=i("p"),ze.textContent=et,ro=r(),m(pe.$$.fragment),ao=r(),P=i("div"),m(he.$$.fragment),$o=r(),$e=i("p"),$e.textContent=ot,Co=r(),Ce=i("p"),Ce.innerHTML=tt,jo=r(),B=i("div"),m(ge.$$.fragment),Uo=r(),je=i("p"),je.innerHTML=rt,Jo=r(),G=i("div"),m(fe.$$.fragment),ko=r(),Ue=i("p"),Ue.innerHTML=at,so=r(),m(ue.$$.fragment),no=r(),Fe=i("p"),this.h()},l(e){const o=mt("svelte-u9bgzb",document.head);c=l(o,"META",{name:!0,content:!0}),o.forEach(t),U=a(e),x=l(e,"P",{}),w(x).forEach(t),M=a(e),p(I.$$.fragment,e),_=a(e),p(z.$$.fragment,e),Le=a(e),E=l(e,"P",{"data-svelte-h":!0}),d(E)!=="svelte-tgqlpw"&&(E.innerHTML=Fo),Re=a(e),D=l(e,"P",{"data-svelte-h":!0}),d(D)!=="svelte-3te1w2"&&(D.textContent=Lo),Ve=a(e),S=l(e,"P",{"data-svelte-h":!0}),d(S)!=="svelte-1y5kg5k"&&(S.innerHTML=Ro),Ne=a(e),F=l(e,"IMG",{src:!0,alt:!0,width:!0}),Be=a(e),A=l(e,"SMALL",{"data-svelte-h":!0}),d(A)!=="svelte-10jofpl"&&(A.innerHTML=No),Ge=a(e),Z=l(e,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-axv494"&&(Z.textContent=Bo),We=a(e),H=l(e,"UL",{"data-svelte-h":!0}),d(H)!=="svelte-rknnv7"&&(H.innerHTML=Go),Ee=a(e),p(X.$$.fragment,e),De=a(e),Q=l(e,"P",{"data-svelte-h":!0}),d(Q)!=="svelte-n0o11w"&&(Q.innerHTML=Wo),Se=a(e),Y=l(e,"P",{"data-svelte-h":!0}),d(Y)!=="svelte-1fxleij"&&(Y.innerHTML=Eo),Ae=a(e),p(O.$$.fragment,e),Ze=a(e),K=l(e,"P",{"data-svelte-h":!0}),d(K)!=="svelte-orhe3n"&&(K.innerHTML=Do),He=a(e),p(ee.$$.fragment,e),Xe=a(e),p(oe.$$.fragment,e),Qe=a(e),b=l(e,"DIV",{class:!0});var T=w(b);p(te.$$.fragment,T),ho=a(T),xe=l(T,"P",{"data-svelte-h":!0}),d(xe)!=="svelte-1xxf4yy"&&(xe.innerHTML=So),go=a(T),be=l(T,"P",{"data-svelte-h":!0}),d(be)!=="svelte-l0qt95"&&(be.innerHTML=Ao),fo=a(T),Pe=l(T,"P",{"data-svelte-h":!0}),d(Pe)!=="svelte-o55m63"&&(Pe.innerHTML=Zo),uo=a(T),p(L.$$.fragment,T),T.forEach(t),Ye=a(e),p(re.$$.fragment,e),Oe=a(e),v=l(e,"DIV",{class:!0});var j=w(v);p(ae.$$.fragment,j),_o=a(j),ye=l(j,"P",{"data-svelte-h":!0}),d(ye)!=="svelte-ybvejp"&&(ye.innerHTML=Ho),xo=a(j),Me=l(j,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-hswkmf"&&(Me.innerHTML=Xo),bo=a(j),J=l(j,"DIV",{class:!0});var Je=w(J);p(se.$$.fragment,Je),Po=a(Je),ve=l(Je,"P",{"data-svelte-h":!0}),d(ve)!=="svelte-1mwzfrr"&&(ve.innerHTML=Qo),yo=a(Je),p(R.$$.fragment,Je),Je.forEach(t),j.forEach(t),Ke=a(e),p(ne.$$.fragment,e),eo=a(e),$=l(e,"DIV",{class:!0});var ke=w($);p(ie.$$.fragment,ke),Mo=a(ke),Te=l(ke,"P",{"data-svelte-h":!0}),d(Te)!=="svelte-1eqw4iw"&&(Te.textContent=Yo),vo=a(ke),V=l(ke,"DIV",{class:!0});var lo=w(V);p(le.$$.fragment,lo),To=a(lo),Ie=l(lo,"P",{"data-svelte-h":!0}),d(Ie)!=="svelte-1x3yxsa"&&(Ie.textContent=Oo),lo.forEach(t),ke.forEach(t),oo=a(e),p(ce.$$.fragment,e),to=a(e),C=l(e,"DIV",{class:!0});var qe=w(C);p(de.$$.fragment,qe),Io=a(qe),we=l(qe,"P",{"data-svelte-h":!0}),d(we)!=="svelte-1bn0s7p"&&(we.textContent=Ko),wo=a(qe),N=l(qe,"DIV",{class:!0});var co=w(N);p(me.$$.fragment,co),zo=a(co),ze=l(co,"P",{"data-svelte-h":!0}),d(ze)!=="svelte-1x3yxsa"&&(ze.textContent=et),co.forEach(t),qe.forEach(t),ro=a(e),p(pe.$$.fragment,e),ao=a(e),P=l(e,"DIV",{class:!0});var k=w(P);p(he.$$.fragment,k),$o=a(k),$e=l(k,"P",{"data-svelte-h":!0}),d($e)!=="svelte-1i1eb5d"&&($e.textContent=ot),Co=a(k),Ce=l(k,"P",{"data-svelte-h":!0}),d(Ce)!=="svelte-6p9so9"&&(Ce.innerHTML=tt),jo=a(k),B=l(k,"DIV",{class:!0});var mo=w(B);p(ge.$$.fragment,mo),Uo=a(mo),je=l(mo,"P",{"data-svelte-h":!0}),d(je)!=="svelte-1o9eza"&&(je.innerHTML=rt),mo.forEach(t),Jo=a(k),G=l(k,"DIV",{class:!0});var po=w(G);p(fe.$$.fragment,po),ko=a(po),Ue=l(po,"P",{"data-svelte-h":!0}),d(Ue)!=="svelte-kk16qw"&&(Ue.innerHTML=at),po.forEach(t),k.forEach(t),so=a(e),p(ue.$$.fragment,e),no=a(e),Fe=l(e,"P",{}),w(Fe).forEach(t),this.h()},h(){y(c,"name","hf:doc:metadata"),y(c,"content",xt),it(F.src,Vo="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/pixtral_architecture.webp")||y(F,"src",Vo),y(F,"alt","drawing"),y(F,"width","600"),y(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(P,"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,o){n(document.head,c),s(e,U,o),s(e,x,o),s(e,M,o),h(I,e,o),s(e,_,o),h(z,e,o),s(e,Le,o),s(e,E,o),s(e,Re,o),s(e,D,o),s(e,Ve,o),s(e,S,o),s(e,Ne,o),s(e,F,o),s(e,Be,o),s(e,A,o),s(e,Ge,o),s(e,Z,o),s(e,We,o),s(e,H,o),s(e,Ee,o),h(X,e,o),s(e,De,o),s(e,Q,o),s(e,Se,o),s(e,Y,o),s(e,Ae,o),h(O,e,o),s(e,Ze,o),s(e,K,o),s(e,He,o),h(ee,e,o),s(e,Xe,o),h(oe,e,o),s(e,Qe,o),s(e,b,o),h(te,b,null),n(b,ho),n(b,xe),n(b,go),n(b,be),n(b,fo),n(b,Pe),n(b,uo),h(L,b,null),s(e,Ye,o),h(re,e,o),s(e,Oe,o),s(e,v,o),h(ae,v,null),n(v,_o),n(v,ye),n(v,xo),n(v,Me),n(v,bo),n(v,J),h(se,J,null),n(J,Po),n(J,ve),n(J,yo),h(R,J,null),s(e,Ke,o),h(ne,e,o),s(e,eo,o),s(e,$,o),h(ie,$,null),n($,Mo),n($,Te),n($,vo),n($,V),h(le,V,null),n(V,To),n(V,Ie),s(e,oo,o),h(ce,e,o),s(e,to,o),s(e,C,o),h(de,C,null),n(C,Io),n(C,we),n(C,wo),n(C,N),h(me,N,null),n(N,zo),n(N,ze),s(e,ro,o),h(pe,e,o),s(e,ao,o),s(e,P,o),h(he,P,null),n(P,$o),n(P,$e),n(P,Co),n(P,Ce),n(P,jo),n(P,B),h(ge,B,null),n(B,Uo),n(B,je),n(P,Jo),n(P,G),h(fe,G,null),n(G,ko),n(G,Ue),s(e,so,o),h(ue,e,o),s(e,no,o),s(e,Fe,o),io=!0},p(e,[o]){const T={};o&2&&(T.$$scope={dirty:o,ctx:e}),L.$set(T);const j={};o&2&&(j.$$scope={dirty:o,ctx:e}),R.$set(j)},i(e){io||(g(I.$$.fragment,e),g(z.$$.fragment,e),g(X.$$.fragment,e),g(O.$$.fragment,e),g(ee.$$.fragment,e),g(oe.$$.fragment,e),g(te.$$.fragment,e),g(L.$$.fragment,e),g(re.$$.fragment,e),g(ae.$$.fragment,e),g(se.$$.fragment,e),g(R.$$.fragment,e),g(ne.$$.fragment,e),g(ie.$$.fragment,e),g(le.$$.fragment,e),g(ce.$$.fragment,e),g(de.$$.fragment,e),g(me.$$.fragment,e),g(pe.$$.fragment,e),g(he.$$.fragment,e),g(ge.$$.fragment,e),g(fe.$$.fragment,e),g(ue.$$.fragment,e),io=!0)},o(e){f(I.$$.fragment,e),f(z.$$.fragment,e),f(X.$$.fragment,e),f(O.$$.fragment,e),f(ee.$$.fragment,e),f(oe.$$.fragment,e),f(te.$$.fragment,e),f(L.$$.fragment,e),f(re.$$.fragment,e),f(ae.$$.fragment,e),f(se.$$.fragment,e),f(R.$$.fragment,e),f(ne.$$.fragment,e),f(ie.$$.fragment,e),f(le.$$.fragment,e),f(ce.$$.fragment,e),f(de.$$.fragment,e),f(me.$$.fragment,e),f(pe.$$.fragment,e),f(he.$$.fragment,e),f(ge.$$.fragment,e),f(fe.$$.fragment,e),f(ue.$$.fragment,e),io=!1},d(e){e&&(t(U),t(x),t(M),t(_),t(Le),t(E),t(Re),t(D),t(Ve),t(S),t(Ne),t(F),t(Be),t(A),t(Ge),t(Z),t(We),t(H),t(Ee),t(De),t(Q),t(Se),t(Y),t(Ae),t(Ze),t(K),t(He),t(Xe),t(Qe),t(b),t(Ye),t(Oe),t(v),t(Ke),t(eo),t($),t(oo),t(to),t(C),t(ro),t(ao),t(P),t(so),t(no),t(Fe)),t(c),u(I,e),u(z,e),u(X,e),u(O,e),u(ee,e),u(oe,e),u(te),u(L),u(re,e),u(ae),u(se),u(R),u(ne,e),u(ie),u(le),u(ce,e),u(de),u(me),u(pe,e),u(he),u(ge),u(fe),u(ue,e)}}}const xt='{"title":"Pixtral","local":"pixtral","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage","local":"usage","sections":[],"depth":2},{"title":"PixtralVisionConfig","local":"transformers.PixtralVisionConfig","sections":[],"depth":2},{"title":"PixtralVisionModel","local":"transformers.PixtralVisionModel","sections":[],"depth":2},{"title":"PixtralImageProcessor","local":"transformers.PixtralImageProcessor","sections":[],"depth":2},{"title":"PixtralImageProcessorFast","local":"transformers.PixtralImageProcessorFast","sections":[],"depth":2},{"title":"PixtralProcessor","local":"transformers.PixtralProcessor","sections":[],"depth":2}],"depth":1}';function bt(_e){return lt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zt extends ct{constructor(c){super(),dt(this,c,bt,_t,nt,{})}}export{zt as component};
