import{s as Po,o as Zo,n as Xe}from"../chunks/scheduler.25b97de1.js";import{S as Ro,i as No,g as d,s,r as f,A as Fo,h as c,f as o,c as a,j as k,u as h,x as g,k as x,y as l,a as r,v as u,d as _,t as y,w as M}from"../chunks/index.d9030fc9.js";import{T as Wo}from"../chunks/Tip.baa67368.js";import{D as L}from"../chunks/Docstring.ffac8efa.js";import{C as Oe}from"../chunks/CodeBlock.e6cd0d95.js";import{E as kt}from"../chunks/ExampleCodeBlock.22dfe688.js";import{H as B,E as qo}from"../chunks/EditOnGithub.91d95064.js";function Lo(w){let i,T="Example:",p,m,b;return m=new Oe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMElkZWZpY3MzTW9kZWwlMkMlMjBJZGVmaWNzM0NvbmZpZyUwQSUyMyUyMEluaXRpYWxpemluZyUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwSWRlZmljczNDb25maWcoKSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBJZGVmaWNzM01vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Idefics3Model, Idefics3Config
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Idefics3Config()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Idefics3Model(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(){i=d("p"),i.textContent=T,p=s(),f(m.$$.fragment)},l(n){i=c(n,"P",{"data-svelte-h":!0}),g(i)!=="svelte-11lpom8"&&(i.textContent=T),p=a(n),h(m.$$.fragment,n)},m(n,I){r(n,i,I),r(n,p,I),u(m,n,I),b=!0},p:Xe,i(n){b||(_(m.$$.fragment,n),b=!0)},o(n){y(m.$$.fragment,n),b=!1},d(n){n&&(o(i),o(p)),M(m,n)}}}function Go(w){let i,T="Example:",p,m,b;return m=new Oe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMuaWRlZmljczMubW9kZWxpbmdfaWRlZmljczMlMjBpbXBvcnQlMjBJZGVmaWNzM1Zpc2lvblRyYW5zZm9ybWVyJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMuaWRlZmljczMuY29uZmlndXJhdGlvbl9pZGVmaWNzMyUyMGltcG9ydCUyMElkZWZpY3MzVmlzaW9uQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMElkZWZpY3MzVmlzaW9uQ29uZmlnJTIwd2l0aCUyMGdvb2dsZSUyRnNpZ2xpcC1iYXNlLXBhdGNoMTYtMjI0JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMElkZWZpY3MzVmlzaW9uQ29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwSWRlZmljczNWaXNpb25UcmFuc2Zvcm1lciUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZ29vZ2xlJTJGc2lnbGlwLWJhc2UtcGF0Y2gxNi0yMjQlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMElkZWZpY3MzVmlzaW9uVHJhbnNmb3JtZXIoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.idefics3.modeling_idefics3 <span class="hljs-keyword">import</span> Idefics3VisionTransformer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.models.idefics3.configuration_idefics3 <span class="hljs-keyword">import</span> Idefics3VisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Idefics3VisionConfig with google/siglip-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = Idefics3VisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Idefics3VisionTransformer (with random weights) from the google/siglip-base-patch16-224 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = Idefics3VisionTransformer(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(){i=d("p"),i.textContent=T,p=s(),f(m.$$.fragment)},l(n){i=c(n,"P",{"data-svelte-h":!0}),g(i)!=="svelte-11lpom8"&&(i.textContent=T),p=a(n),h(m.$$.fragment,n)},m(n,I){r(n,i,I),r(n,p,I),u(m,n,I),b=!0},p:Xe,i(n){b||(_(m.$$.fragment,n),b=!0)},o(n){y(m.$$.fragment,n),b=!1},d(n){n&&(o(i),o(p)),M(m,n)}}}function Bo(w){let i,T=`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(){i=d("p"),i.innerHTML=T},l(p){i=c(p,"P",{"data-svelte-h":!0}),g(i)!=="svelte-fincs2"&&(i.innerHTML=T)},m(p,m){r(p,i,m)},p:Xe,d(p){p&&o(i)}}}function So(w){let i,T=`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(){i=d("p"),i.innerHTML=T},l(p){i=c(p,"P",{"data-svelte-h":!0}),g(i)!=="svelte-fincs2"&&(i.innerHTML=T)},m(p,m){r(p,i,m)},p:Xe,d(p){p&&o(i)}}}function Vo(w){let i,T="Example:",p,m,b;return m=new Oe({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEF1dG9Nb2RlbEZvclZpc2lvbjJTZXElMEFmcm9tJTIwdHJhbnNmb3JtZXJzLmltYWdlX3V0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQSUyMyUyME5vdGUlMjB0aGF0JTIwcGFzc2luZyUyMHRoZSUyMGltYWdlJTIwdXJscyUyMChpbnN0ZWFkJTIwb2YlMjB0aGUlMjBhY3R1YWwlMjBwaWwlMjBpbWFnZXMpJTIwdG8lMjB0aGUlMjBwcm9jZXNzb3IlMjBpcyUyMGFsc28lMjBwb3NzaWJsZSUwQWltYWdlMSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZjZG4uYnJpdGFubmljYS5jb20lMkY2MSUyRjkzMDYxLTA1MC05OTE0N0RDRSUyRlN0YXR1ZS1vZi1MaWJlcnR5LUlzbGFuZC1OZXctWW9yay1CYXkuanBnJTIyKSUwQWltYWdlMiUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZjZG4uYnJpdGFubmljYS5jb20lMkY1OSUyRjk0NDU5LTA1MC1EQkE0MjQ2NyUyRlNreWxpbmUtQ2hpY2Fnby5qcGclMjIpJTBBaW1hZ2UzJTIwJTNEJTIwbG9hZF9pbWFnZSglMjJodHRwcyUzQSUyRiUyRmNkbi5icml0YW5uaWNhLmNvbSUyRjY4JTJGMTcwODY4LTA1MC04RERFODI2MyUyRkdvbGRlbi1HYXRlLUJyaWRnZS1TYW4tRnJhbmNpc2NvLmpwZyUyMiklMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJIdWdnaW5nRmFjZU00JTJGSWRlZmljczMtOEItTGxhbWEzJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yVmlzaW9uMlNlcS5mcm9tX3ByZXRyYWluZWQoJTIySHVnZ2luZ0ZhY2VNNCUyRklkZWZpY3MzLThCLUxsYW1hMyUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMjBkZXZpY2VfbWFwJTNEJTIyYXV0byUyMiklMEElMEElMjMlMjBDcmVhdGUlMjBpbnB1dHMlMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJpbWFnZSUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMkluJTIwdGhpcyUyMGltYWdlJTJDJTIwd2UlMjBjYW4lMjBzZWUlMjB0aGUlMjBjaXR5JTIwb2YlMjBOZXclMjBZb3JrJTJDJTIwYW5kJTIwbW9yZSUyMHNwZWNpZmljYWxseSUyMHRoZSUyMFN0YXR1ZSUyMG9mJTIwTGliZXJ0eS4lMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIyaW1hZ2UlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0eXBlJTIyJTNBJTIwJTIydGV4dCUyMiUyQyUyMCUyMnRleHQlMjIlM0ElMjAlMjJXaGF0JTIwY2FuJTIwd2UlMjBzZWUlMjBpbiUyMHRoaXMlMjBpbWFnZSUzRiUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJpbWFnZSUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMkluJTIwd2hpY2glMjBjaXR5JTIwaXMlMjB0aGF0JTIwYnJpZGdlJTIwbG9jYXRlZCUzRiUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCU3RCUwQSU1RCUwQSUwQXByb21wdHMlMjAlM0QlMjAlNUJwcm9jZXNzb3IuYXBwbHlfY2hhdF90ZW1wbGF0ZSglNUJtZXNzYWdlJTVEJTJDJTIwYWRkX2dlbmVyYXRpb25fcHJvbXB0JTNEVHJ1ZSklMjBmb3IlMjBtZXNzYWdlJTIwaW4lMjBtZXNzYWdlcyU1RCUwQWltYWdlcyUyMCUzRCUyMCU1QiU1QmltYWdlMSUyQyUyMGltYWdlMiU1RCUyQyUyMCU1QmltYWdlMyU1RCU1RCUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEcHJvbXB0cyUyQyUyMGltYWdlcyUzRGltYWdlcyUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikudG8obW9kZWwuZGV2aWNlKSUwQSUwQSUyMyUyMEdlbmVyYXRlJTBBZ2VuZXJhdGVkX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKCoqaW5wdXRzJTJDJTIwbWF4X25ld190b2tlbnMlM0QyNTYpJTBBZ2VuZXJhdGVkX3RleHRzJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTBBJTBBcHJpbnQoZ2VuZXJhdGVkX3RleHRzJTVCMCU1RCklMEElMEFwcmludChnZW5lcmF0ZWRfdGV4dHMlNUIxJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForVision2Seq
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.image_utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that passing the image urls (instead of the actual pil images) to the processor is also possible</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image1 = load_image(<span class="hljs-string">&quot;https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image2 = load_image(<span class="hljs-string">&quot;https://cdn.britannica.com/59/94459-050-DBA42467/Skyline-Chicago.jpg&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image3 = load_image(<span class="hljs-string">&quot;https://cdn.britannica.com/68/170868-050-8DDE8263/Golden-Gate-Bridge-San-Francisco.jpg&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;HuggingFaceM4/Idefics3-8B-Llama3&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForVision2Seq.from_pretrained(<span class="hljs-string">&quot;HuggingFaceM4/Idefics3-8B-Llama3&quot;</span>, torch_dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;auto&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Create inputs</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;content&quot;</span>: [
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>},
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;In this image, we can see the city of New York, and more specifically the Statue of Liberty.&quot;</span>},
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>},
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;What can we see in this image?&quot;</span>},
<span class="hljs-meta">... </span>        ]
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;content&quot;</span>: [
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;image&quot;</span>},
<span class="hljs-meta">... </span>            {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;In which city is that bridge located?&quot;</span>},
<span class="hljs-meta">... </span>        ]
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>prompts = [processor.apply_chat_template([message], add_generation_prompt=<span class="hljs-literal">True</span>) <span class="hljs-keyword">for</span> message <span class="hljs-keyword">in</span> messages]
<span class="hljs-meta">&gt;&gt;&gt; </span>images = [[image1, image2], [image3]]
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=prompts, images=images, padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(model.device)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(**inputs, max_new_tokens=<span class="hljs-number">256</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_texts = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_texts[<span class="hljs-number">0</span>])
Assistant: There are buildings, trees, lights, <span class="hljs-keyword">and</span> water visible <span class="hljs-keyword">in</span> this image.

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_texts[<span class="hljs-number">1</span>])
Assistant: The bridge <span class="hljs-keyword">is</span> <span class="hljs-keyword">in</span> San Francisco.`,wrap:!1}}),{c(){i=d("p"),i.textContent=T,p=s(),f(m.$$.fragment)},l(n){i=c(n,"P",{"data-svelte-h":!0}),g(i)!=="svelte-11lpom8"&&(i.textContent=T),p=a(n),h(m.$$.fragment,n)},m(n,I){r(n,i,I),r(n,p,I),u(m,n,I),b=!0},p:Xe,i(n){b||(_(m.$$.fragment,n),b=!0)},o(n){y(m.$$.fragment,n),b=!1},d(n){n&&(o(i),o(p)),M(m,n)}}}function Eo(w){let i,T="Example:",p,m,b;return m=new Oe({props:{code:"aW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwSWRlZmljczNQcm9jZXNzb3IlMEFmcm9tJTIwdHJhbnNmb3JtZXJzLmltYWdlX3V0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMElkZWZpY3MzUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJIdWdnaW5nRmFjZU00JTJGSWRlZmljczMtOEItTGxhbWEzJTIyKSUwQXByb2Nlc3Nvci5pbWFnZV9wcm9jZXNzb3IuZG9faW1hZ2Vfc3BsaXR0aW5nJTIwJTNEJTIwRmFsc2UlMjAlMjAlMjMlMjBGb3JjZSUyMGFzJTIwRmFsc2UlMjB0byUyMHNpbXBsaWZ5JTIwdGhlJTIwZXhhbXBsZSUwQSUwQXVybDElMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmNkbi5icml0YW5uaWNhLmNvbSUyRjYxJTJGOTMwNjEtMDUwLTk5MTQ3RENFJTJGU3RhdHVlLW9mLUxpYmVydHktSXNsYW5kLU5ldy1Zb3JrLUJheS5qcGclMjIlMEF1cmwyJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZjZG4uYnJpdGFubmljYS5jb20lMkY1OSUyRjk0NDU5LTA1MC1EQkE0MjQ2NyUyRlNreWxpbmUtQ2hpY2Fnby5qcGclMjIlMEElMEFpbWFnZTElMkMlMjBpbWFnZTIlMjAlM0QlMjBsb2FkX2ltYWdlKHVybDEpJTJDJTIwbG9hZF9pbWFnZSh1cmwyKSUwQWltYWdlcyUyMCUzRCUyMCU1QiU1QmltYWdlMSU1RCUyQyUyMCU1QmltYWdlMiU1RCU1RCUwQSUwQXRleHQlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjIlM0NpbWFnZSUzRUluJTIwdGhpcyUyMGltYWdlJTJDJTIwd2UlMjBzZWUlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJibGElMjBibGElMjBibGElM0NpbWFnZSUzRSUyMiUyQyUwQSU1RCUwQW91dHB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2VzJTJDJTIwdGV4dCUzRHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBaW5wdXRfaWRzJTIwJTNEJTIwb3V0cHV0cy5pbnB1dF9pZHMlMEFpbnB1dF90b2tlbnMlMjAlM0QlMjBwcm9jZXNzb3IudG9rZW5pemVyLmJhdGNoX2RlY29kZShpbnB1dF9pZHMpJTBBcHJpbnQoaW5wdXRfdG9rZW5zKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Idefics3Processor
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.image_utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = Idefics3Processor.from_pretrained(<span class="hljs-string">&quot;HuggingFaceM4/Idefics3-8B-Llama3&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.image_processor.do_image_splitting = <span class="hljs-literal">False</span>  <span class="hljs-comment"># Force as False to simplify the example</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>url1 = <span class="hljs-string">&quot;https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url2 = <span class="hljs-string">&quot;https://cdn.britannica.com/59/94459-050-DBA42467/Skyline-Chicago.jpg&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>image1, image2 = load_image(url1), load_image(url2)
<span class="hljs-meta">&gt;&gt;&gt; </span>images = [[image1], [image2]]

<span class="hljs-meta">&gt;&gt;&gt; </span>text = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;&lt;image&gt;In this image, we see&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;bla bla bla&lt;image&gt;&quot;</span>,
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = processor(images=images, text=text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = outputs.input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>input_tokens = processor.tokenizer.batch_decode(input_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(input_tokens)
[<span class="hljs-string">&#x27;&lt;|begin_of_text|&gt;&lt;fake_token_around_image&gt;&lt;global-img&gt;((&lt;image&gt;)*169)&lt;fake_token_around_image&gt; In this image, we see&#x27;</span>, <span class="hljs-string">&#x27;&lt;|reserved_special_token_0|&gt;&lt;|reserved_special_token_0|&gt;&lt;|reserved_special_token_0|&gt;&lt;|begin_of_text|&gt;bla bla bla&lt;fake_token_around_image&gt;&lt;global-img&gt;((&lt;image&gt;)*169)&lt;fake_token_around_image&gt;&#x27;</span>]`,wrap:!1}}),{c(){i=d("p"),i.textContent=T,p=s(),f(m.$$.fragment)},l(n){i=c(n,"P",{"data-svelte-h":!0}),g(i)!=="svelte-11lpom8"&&(i.textContent=T),p=a(n),h(m.$$.fragment,n)},m(n,I){r(n,i,I),r(n,p,I),u(m,n,I),b=!0},p:Xe,i(n){b||(_(m.$$.fragment,n),b=!0)},o(n){y(m.$$.fragment,n),b=!1},d(n){n&&(o(i),o(p)),M(m,n)}}}function Ho(w){let i,T,p,m,b,n,I,Ke,K,so='The Idefics3 model was proposed in <a href="https://huggingface.co/papers/2408.12637" rel="nofollow">Building and better understanding vision-language models: insights and future directions</a> by Hugo Laurençon, Andrés Marafioti, Victor Sanh, and Léo Tronchon.',et,ee,ao="Idefics3 is an adaptation of the Idefics2 model with three main differences:",tt,te,ro="<li>It uses Llama3 for the text model.</li> <li>It uses an updated processing logic for the images.</li> <li>It removes the perceiver.</li>",ot,oe,io="The abstract from the paper is the following:",nt,ne,lo="<em>The field of vision-language models (VLMs), which take images and texts as inputs and output texts, is rapidly evolving and has yet to reach consensus on several key aspects of the development pipeline, including data, architecture, and training methods. This paper can be seen as a tutorial for building a VLM. We begin by providing a comprehensive overview of the current state-of-the-art approaches, highlighting the strengths and weaknesses of each, addressing the major challenges in the field, and suggesting promising research directions for underexplored areas. We then walk through the practical steps to build Idefics3-8B, a powerful VLM that significantly outperforms its predecessor Idefics2-8B, while being trained efficiently, exclusively on open datasets, and using a straightforward pipeline. These steps include the creation of Docmatix, a dataset for improving document understanding capabilities, which is 240 times larger than previously available datasets. We release the model along with the datasets created for its training.</em>",st,se,at,ae,co="Input images are processed either by upsampling (if resizing is enabled) or at their original resolution. The resizing behavior depends on two parameters: do_resize and size.",rt,re,mo="If <code>do_resize</code> is set to <code>True</code>, the model resizes images so that the longest edge is 4<em>364 pixels by default.\nThe default resizing behavior can be customized by passing a dictionary to the <code>size</code> parameter. For example, `{“longest_edge”: 4</em> 364}` is the default, but you can change it to a different value if needed.",it,ie,po="Here’s how to control resizing and set a custom size:",lt,le,dt,de,go="Additionally, the <code>max_image_size</code> parameter, which controls the size of each square patch the image is decomposed into, is set to 364 by default but can be adjusted as needed. After resizing (if applicable), the image processor decomposes the images into square patches based on the <code>max_image_size</code> parameter.",ct,ce,fo='This model was contributed by <a href="https://huggingface.co/amyeroberts" rel="nofollow">amyeroberts</a> and <a href="https://huggingface.co/andito" rel="nofollow">andimarafioti</a>.',mt,me,pt,v,pe,xt,xe,ho=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Model">Idefics3Model</a>. It is used to instantiate a
Idefics3 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 model of the Idefics3
<a href="https://huggingface.co/HuggingFaceM4/Idefics3-8B-Llama3" rel="nofollow">HuggingFaceM4/Idefics3-8B-Llama3</a> architecture.`,$t,$e,uo=`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.`,Jt,V,gt,ge,ft,U,fe,Wt,Je,_o=`This is the configuration class to store the configuration of a <code>Idefics3VisionModel</code>. It is used to instantiate a
Idefics3 vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the SigLIP checkpoint
<a href="https://huggingface.co/google/siglip-base-patch16-224" rel="nofollow">google/siglip-base-patch16-224</a> used in the Idefics3 model
<a href="https://huggingface.co/HuggingFaceM4/Idefics3-8B-Llama3" rel="nofollow">HuggingFaceM4/Idefics3-8B-Llama3</a>.`,Pt,We,yo=`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.`,Zt,E,ht,he,ut,W,ue,Rt,Pe,Mo=`The Idefics3 Vision Transformer Model outputting raw image embedding.
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.)`,Nt,Ze,bo=`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.`,_t,_e,yt,C,ye,Ft,Re,Io=`Idefics3 model consisting of a SIGLIP vision encoder and Llama3 language decoder
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.)`,qt,Ne,To=`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.`,Lt,$,Me,Gt,Fe,wo='The <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Model">Idefics3Model</a> forward method, overrides the <code>__call__</code> special method.',Bt,H,St,qe,vo=`Inputs fed to the model can have an arbitrary number of images. To account for this, pixel_values fed to
the model have image padding -> (batch_size, max_num_images, 3, max_heights, max_widths) where
max_num_images is the maximum number of images among the batch_size samples in the batch.
Padding images are not needed beyond padding the pixel_values at the entrance of the model.
For efficiency, we only pass through the vision_model’s forward the real images by
discarding the padding images i.e. pixel_values of size (image_batch_size, 3, height, width) where
image_batch_size would be 7 when num_images_per_sample=[1, 3, 1, 2] and max_num_images would be 3.`,Mt,be,bt,j,Ie,Vt,Le,Uo=`The Idefics3 Model with a language modeling head. It is made up a SigLIP vision encoder, with a language modeling 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.)`,Et,Ge,Co=`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.`,Ht,J,Te,Yt,Be,jo='The <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3ForConditionalGeneration">Idefics3ForConditionalGeneration</a> forward method, overrides the <code>__call__</code> special method.',Qt,Y,At,Q,It,we,Tt,P,ve,Xt,Se,zo="Constructs a Idefics3 image processor.",Dt,A,Ue,Ot,Ve,ko="Preprocess a batch of images.",wt,Ce,vt,z,je,Kt,Ee,xo="Constructs a Idefics3 processor which wraps a LLama tokenizer and Idefics3 image processor into a single processor.",eo,He,$o=`<a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Processor">Idefics3Processor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3ImageProcessor">Idefics3ImageProcessor</a> and <code>Idefics3TokenizerFast</code>. See
the docstring of <a href="/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsProcessor.__call__"><strong>call</strong>()</a> and <code>decode()</code> for more information.`,to,G,ze,oo,Ye,Jo="Processes the input prompts and returns a BatchEncoding.",no,X,Ut,ke,Ct,De,jt;return b=new B({props:{title:"Idefics3",local:"idefics3",headingTag:"h1"}}),I=new B({props:{title:"Overview",local:"overview",headingTag:"h2"}}),se=new B({props:{title:"Usage tips",local:"usage-tips",headingTag:"h2"}}),le=new Oe({props:{code:"aW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwSWRlZmljczNJbWFnZVByb2Nlc3Nvcihkb19yZXNpemUlM0RUcnVlJTJDJTIwc2l6ZSUzRCU3QiUyMmxvbmdlc3RfZWRnZSUyMiUzQSUyMDIlMjAqJTIwMzY0JTdEJTJDJTIwbWF4X2ltYWdlX3NpemUlM0QzNjQp",highlighted:'image_processor = Idefics3ImageProcessor(do_resize=<span class="hljs-literal">True</span>, size={<span class="hljs-string">&quot;longest_edge&quot;</span>: <span class="hljs-number">2</span> * <span class="hljs-number">364</span>}, max_image_size=<span class="hljs-number">364</span>)',wrap:!1}}),me=new B({props:{title:"Idefics3Config",local:"transformers.Idefics3Config",headingTag:"h2"}}),pe=new L({props:{name:"class transformers.Idefics3Config",anchor:"transformers.Idefics3Config",parameters:[{name:"use_cache",val:" = True"},{name:"image_token_id",val:" = 128257"},{name:"tie_word_embeddings",val:" = False"},{name:"vision_config",val:" = None"},{name:"text_config",val:" = None"},{name:"scale_factor",val:" = 2"},{name:"pad_token_id",val:" = 128002"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Idefics3Config.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 cache the key/value pairs of the attention mechanism. Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.Idefics3Config.image_token_id",description:`<strong>image_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 128257) &#x2014;
The id of the &#x201C;image&#x201D; token.`,name:"image_token_id"},{anchor:"transformers.Idefics3Config.tie_word_embeddings",description:`<strong>tie_word_embeddings</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to tie the word embeddings with the token embeddings.`,name:"tie_word_embeddings"},{anchor:"transformers.Idefics3Config.vision_config",description:`<strong>vision_config</strong> (<code>IdeficsVisionConfig</code> or <code>dict</code>, <em>optional</em>, defaults to <code>IdeficsVisionConfig</code>) &#x2014;
Custom vision config or dict for the vision tower`,name:"vision_config"},{anchor:"transformers.Idefics3Config.text_config",description:`<strong>text_config</strong> (<code>PretrainedConfig</code> or <code>dict</code>, <em>optional</em>, defaults to <code>LlamaConfig</code>) &#x2014;
Custom text config or dict for the text model`,name:"text_config"},{anchor:"transformers.Idefics3Config.scale_factor",description:`<strong>scale_factor</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The scale factor for the image encoder.`,name:"scale_factor"},{anchor:"transformers.Idefics3Config.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 128002) &#x2014;
The id of the padding token.`,name:"pad_token_id"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/configuration_idefics3.py#L109"}}),V=new kt({props:{anchor:"transformers.Idefics3Config.example",$$slots:{default:[Lo]},$$scope:{ctx:w}}}),ge=new B({props:{title:"Idefics3VisionConfig",local:"transformers.Idefics3VisionConfig",headingTag:"h2"}}),fe=new L({props:{name:"class transformers.Idefics3VisionConfig",anchor:"transformers.Idefics3VisionConfig",parameters:[{name:"hidden_size",val:" = 1152"},{name:"intermediate_size",val:" = 3072"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 16"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'gelu_pytorch_tanh'"},{name:"layer_norm_eps",val:" = 1e-06"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Idefics3VisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1152) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.Idefics3VisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.Idefics3VisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.Idefics3VisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.Idefics3VisionConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
Number of channels in the input images.`,name:"num_channels"},{anchor:"transformers.Idefics3VisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.Idefics3VisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.Idefics3VisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu_pytorch_tanh&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> <code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.Idefics3VisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-06) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.Idefics3VisionConfig.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.Idefics3VisionConfig.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/idefics3/configuration_idefics3.py#L24"}}),E=new kt({props:{anchor:"transformers.Idefics3VisionConfig.example",$$slots:{default:[Go]},$$scope:{ctx:w}}}),he=new B({props:{title:"Idefics3VisionTransformer",local:"transformers.Idefics3VisionTransformer",headingTag:"h2"}}),ue=new L({props:{name:"class transformers.Idefics3VisionTransformer",anchor:"transformers.Idefics3VisionTransformer",parameters:[{name:"config",val:": Idefics3VisionConfig"}],parametersDescription:[{anchor:"transformers.Idefics3VisionTransformer.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3VisionConfig">Idefics3VisionConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/modeling_idefics3.py#L664"}}),_e=new B({props:{title:"Idefics3Model",local:"transformers.Idefics3Model",headingTag:"h2"}}),ye=new L({props:{name:"class transformers.Idefics3Model",anchor:"transformers.Idefics3Model",parameters:[{name:"config",val:": Idefics3Config"}],parametersDescription:[{anchor:"transformers.Idefics3Model.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Config">Idefics3Config</a> or <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3VisionConfig">Idefics3VisionConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/modeling_idefics3.py#L818"}}),Me=new L({props:{name:"forward",anchor:"transformers.Idefics3Model.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"image_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Idefics3Model.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.Idefics3Model.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.Idefics3Model.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>. <a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Idefics3Model.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Idefics3Model.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.Idefics3Model.forward.pixel_values",description:'<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)) -- The tensors corresponding to the input images. Pixel values can be obtained using [AutoImageProcessor](/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor). See [CLIPImageProcessor.__call__()](/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__) for details ([]</code>LlavaProcessor`] uses\n<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> for processing images).',name:"pixel_values"},{anchor:"transformers.Idefics3Model.forward.pixel_attention_mask",description:`<strong>pixel_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, image_size, image_size)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel indices.`,name:"pixel_attention_mask"},{anchor:"transformers.Idefics3Model.forward.image_hidden_states",description:`<strong>image_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>) &#x2014;
The hidden states of the image encoder after modality projection.`,name:"image_hidden_states"},{anchor:"transformers.Idefics3Model.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.Idefics3Model.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.Idefics3Model.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.Idefics3Model.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/idefics3/modeling_idefics3.py#L906"}}),H=new Wo({props:{$$slots:{default:[Bo]},$$scope:{ctx:w}}}),be=new B({props:{title:"Idefics3ForConditionalGeneration",local:"transformers.Idefics3ForConditionalGeneration",headingTag:"h2"}}),Ie=new L({props:{name:"class transformers.Idefics3ForConditionalGeneration",anchor:"transformers.Idefics3ForConditionalGeneration",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.Idefics3ForConditionalGeneration.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Config">Idefics3Config</a> or <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3VisionConfig">Idefics3VisionConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/modeling_idefics3.py#L1042"}}),Te=new L({props:{name:"forward",anchor:"transformers.Idefics3ForConditionalGeneration.forward",parameters:[{name:"input_ids",val:": LongTensor = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pixel_attention_mask",val:": typing.Optional[torch.BoolTensor] = None"},{name:"image_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p>If <code>past_key_values</code> is used, optionally only the last <code>decoder_input_ids</code> have to be input (see
<code>past_key_values</code>).</p>
<p>If you want to change padding behavior, you should read <code>modeling_opt._prepare_decoder_attention_mask</code>
and modify to your needs. See diagram 1 in <a href="https://arxiv.org/abs/1910.13461" rel="nofollow">the paper</a> for more
information on the default strategy.</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.Idefics3ForConditionalGeneration.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>. <a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.Idefics3ForConditionalGeneration.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.forward.pixel_values",description:'<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)) -- The tensors corresponding to the input images. Pixel values can be obtained using [AutoImageProcessor](/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor). See [CLIPImageProcessor.__call__()](/docs/transformers/main/en/model_doc/imagegpt#transformers.ImageGPTFeatureExtractor.__call__) for details ([]</code>LlavaProcessor`] uses\n<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a> for processing images).',name:"pixel_values"},{anchor:"transformers.Idefics3ForConditionalGeneration.forward.pixel_attention_mask",description:`<strong>pixel_attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, image_size, image_size)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding pixel indices.`,name:"pixel_attention_mask"},{anchor:"transformers.Idefics3ForConditionalGeneration.forward.image_hidden_states",description:`<strong>image_hidden_states</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>) &#x2014;
The hidden states of the image encoder after modality projection.`,name:"image_hidden_states"},{anchor:"transformers.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.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.Idefics3ForConditionalGeneration.forward.Args",description:`<strong>Args</strong> &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or <code>model.image_token_id</code> (where <code>model</code> is your instance of <code>Idefics3ForConditionalGeneration</code>).
Tokens with indices set to <code>model.image_token_id</code> are ignored (masked), the loss is only
computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"Args"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/modeling_idefics3.py#L1108",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.idefics3.modeling_idefics3.Idefics3CausalLMOutputWithPast</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3Config"
>Idefics3Config</a>) and inputs.</p>
<ul>
<li><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).</li>
<li><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).</li>
<li><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>)
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.</li>
<li><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>.
Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</li>
<li><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>.
Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</li>
<li><strong>image_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the image embeddings, <code>(batch_size, num_images, sequence_length, hidden_size)</code>.
image_hidden_states of the model produced by the vision encoder</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.idefics3.modeling_idefics3.Idefics3CausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Y=new Wo({props:{$$slots:{default:[So]},$$scope:{ctx:w}}}),Q=new kt({props:{anchor:"transformers.Idefics3ForConditionalGeneration.forward.example",$$slots:{default:[Vo]},$$scope:{ctx:w}}}),we=new B({props:{title:"Idefics3ImageProcessor",local:"transformers.Idefics3ImageProcessor",headingTag:"h2"}}),ve=new L({props:{name:"class transformers.Idefics3ImageProcessor",anchor:"transformers.Idefics3ImageProcessor",parameters:[{name:"do_convert_rgb",val:": bool = True"},{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.LANCZOS: 1>"},{name:"do_image_splitting",val:": bool = True"},{name:"max_image_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": 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_pad",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Idefics3ImageProcessor.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. This is useful if the input image is of a different format e.g. RGBA.
Only has an effect if the input image is in the PIL format.`,name:"do_convert_rgb"},{anchor:"transformers.Idefics3ImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image. The longest edge of the image is resized to  be &lt;= <code>size[&quot;longest_edge&quot;]</code>, with the
shortest edge resized to keep the input aspect ratio.`,name:"do_resize"},{anchor:"transformers.Idefics3ImageProcessor.size",description:`<strong>size</strong> (<code>Dict</code>, <em>optional</em>, defaults to <code>{&quot;longest_edge&quot; -- 4 * 364}</code>):
Controls the size of the output image. This is a dictionary containing the key &#x201C;longest_edge&#x201D;.
The image will be resized such that the longest edge is &lt;= <code>size[&quot;longest_edge&quot;]</code> and the shortest edge is resized
to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.Idefics3ImageProcessor.resample",description:`<strong>resample</strong> (<code>Resampling</code>, <em>optional</em>, defaults to <code>Resampling.LANCZOS</code>) &#x2014;
Resampling filter to use when resizing the image.`,name:"resample"},{anchor:"transformers.Idefics3ImageProcessor.do_image_splitting",description:`<strong>do_image_splitting</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to split the image into sub-images concatenated with the original image. They are split into patches
such that each patch has a size of <code>max_image_size[&quot;height&quot;]</code> x <code>max_image_size[&quot;width&quot;]</code>.`,name:"do_image_splitting"},{anchor:"transformers.Idefics3ImageProcessor.max_image_size",description:`<strong>max_image_size</strong> (<code>Dict</code>, <em>optional</em>, defaults to <code>{&quot;longest_edge&quot; -- 364}</code>):
Maximum resolution of the patches of images accepted by the model. This is a dictionary containing the key &#x201C;longest_edge&#x201D;.`,name:"max_image_size"},{anchor:"transformers.Idefics3ImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image. If set to <code>True</code>, the image is rescaled to have pixel values between 0 and 1.`,name:"do_rescale"},{anchor:"transformers.Idefics3ImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>1/255</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.Idefics3ImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. If set to <code>True</code>, the image is normalized to have a mean of <code>image_mean</code> and
a standard deviation of <code>image_std</code>.`,name:"do_normalize"},{anchor:"transformers.Idefics3ImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IDEFICS_STANDARD_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.Idefics3ImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IDEFICS_STANDARD_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.Idefics3ImageProcessor.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to pad the images to the largest height and width in the batch and number of images per
sample in the batch, such that the returned tensor is of shape (batch_size, max_num_images, num_channels, max_height, max_width).`,name:"do_pad"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/image_processing_idefics3.py#L285"}}),Ue=new L({props:{name:"preprocess",anchor:"transformers.Idefics3ImageProcessor.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_convert_rgb",val:": typing.Optional[bool] = None"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = None"},{name:"do_image_splitting",val:": typing.Optional[bool] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"max_image_size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[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_pad",val:": typing.Optional[bool] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_row_col_info",val:": bool = False"},{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"}],parametersDescription:[{anchor:"transformers.Idefics3ImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
A list of images to preprocess.`,name:"images"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. With the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.preprocess.do_image_splitting",description:`<strong>do_image_splitting</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_image_splitting</code>) &#x2014;
Whether to split the image into sub-images concatenated with the original image. They are split into patches
such that each patch has a size of <code>max_image_size[&quot;height&quot;]</code> x <code>max_image_size[&quot;width&quot;]</code>.`,name:"do_image_splitting"},{anchor:"transformers.Idefics3ImageProcessor.preprocess.max_image_size",description:`<strong>max_image_size</strong> (<code>Dict</code>, <em>optional</em>, defaults to <code>self.max_image_size</code>) &#x2014;
Maximum resolution of the images. If the image is larger than this size, the image is split into patches.`,name:"max_image_size"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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.Idefics3ImageProcessor.preprocess.do_pad",description:`<strong>do_pad</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_pad</code>) &#x2014;
Whether or not to pad the images to the largest height and width in the batch.`,name:"do_pad"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.preprocess.return_row_col_info",description:`<strong>return_row_col_info</strong> (<code>bool</code>, <em>optional</em>, default to <code>False</code>) &#x2014;
Whether to return the number of rows and columns of the split images. This is used for the
<code>Idefics3Processor</code> to generate prompt strings based on the number of rows and columns.`,name:"return_row_col_info"},{anchor:"transformers.Idefics3ImageProcessor.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.Idefics3ImageProcessor.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/idefics3/image_processing_idefics3.py#L636"}}),Ce=new B({props:{title:"Idefics3Processor",local:"transformers.Idefics3Processor",headingTag:"h2"}}),je=new L({props:{name:"class transformers.Idefics3Processor",anchor:"transformers.Idefics3Processor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:" = None"},{name:"image_seq_len",val:": int = 169"},{name:"chat_template",val:": str = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Idefics3Processor.image_processor",description:`<strong>image_processor</strong> (<code>Idefics3ImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/idefics3#transformers.Idefics3ImageProcessor">Idefics3ImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.Idefics3Processor.tokenizer",description:`<strong>tokenizer</strong> (<code>PreTrainedTokenizerBase</code>, <em>optional</em>) &#x2014;
An instance of <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase">PreTrainedTokenizerBase</a>. This should correspond with the model&#x2019;s text model. The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.Idefics3Processor.image_seq_len",description:`<strong>image_seq_len</strong> (<code>int</code>, <em>optional</em>, defaults to 169) &#x2014;
The length of the image sequence i.e. the number of <image> tokens per image in the input.
This parameter is used to build the string from the input prompt and image tokens and should match the
value the model used. It is computed as: image_seq_len = int(((image_size // patch_size) <strong> 2) / (scale_factor</strong>2))</image>`,name:"image_seq_len"},{anchor:"transformers.Idefics3Processor.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/processing_idefics3.py#L111"}}),ze=new L({props:{name:"__call__",anchor:"transformers.Idefics3Processor.__call__",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')], typing.List[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')]]], typing.List[typing.List[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')]]]]] = None"},{name:"text",val:": typing.Union[str, ForwardRef('PreTokenizedInput'), typing.List[str], typing.List[ForwardRef('PreTokenizedInput')]] = None"},{name:"audio",val:" = None"},{name:"videos",val:" = None"},{name:"image_seq_len",val:": typing.Optional[int] = None"},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.models.idefics3.processing_idefics3.Idefics3ProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.Idefics3Processor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>, <em>optional</em>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. If is of type <code>List[ImageInput]</code>, it&#x2019;s assumed that this is for a single prompt i.e. of batch size 1.`,name:"images"},{anchor:"transformers.Idefics3Processor.__call__.text",description:`<strong>text</strong> (<code>Union[TextInput, PreTokenizedInput, List[TextInput], List[PreTokenizedInput]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).
Wherever an image token, <code>&lt;image&gt;</code> is encountered it is expanded to
<code>&lt;fake_token_around_image&gt;</code> + <code>&lt;row_x_col_y&gt;</code> + <code>&lt;image&gt;</code> <em> <code>image_seq_len</code> </em> <fake_token_around_image>\`.</fake_token_around_image>`,name:"text"},{anchor:"transformers.Idefics3Processor.__call__.image_seq_len",description:`<strong>image_seq_len</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The length of the image sequence. If not provided, the default value of self.image_seq_len is used.
image_seq_len should be equal to int(((image_size // patch_size) <strong> 2) / (scale_factor</strong>2))`,name:"image_seq_len"},{anchor:"transformers.Idefics3Processor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>Union[str, TensorType]</code>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizerFast.<strong>call</strong>()</a> for more
information.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics3/processing_idefics3.py#L174"}}),X=new kt({props:{anchor:"transformers.Idefics3Processor.__call__.example",$$slots:{default:[Eo]},$$scope:{ctx:w}}}),ke=new qo({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/idefics3.md"}}),{c(){i=d("meta"),T=s(),p=d("p"),m=s(),f(b.$$.fragment),n=s(),f(I.$$.fragment),Ke=s(),K=d("p"),K.innerHTML=so,et=s(),ee=d("p"),ee.textContent=ao,tt=s(),te=d("ul"),te.innerHTML=ro,ot=s(),oe=d("p"),oe.textContent=io,nt=s(),ne=d("p"),ne.innerHTML=lo,st=s(),f(se.$$.fragment),at=s(),ae=d("p"),ae.textContent=co,rt=s(),re=d("p"),re.innerHTML=mo,it=s(),ie=d("p"),ie.textContent=po,lt=s(),f(le.$$.fragment),dt=s(),de=d("p"),de.innerHTML=go,ct=s(),ce=d("p"),ce.innerHTML=fo,mt=s(),f(me.$$.fragment),pt=s(),v=d("div"),f(pe.$$.fragment),xt=s(),xe=d("p"),xe.innerHTML=ho,$t=s(),$e=d("p"),$e.innerHTML=uo,Jt=s(),f(V.$$.fragment),gt=s(),f(ge.$$.fragment),ft=s(),U=d("div"),f(fe.$$.fragment),Wt=s(),Je=d("p"),Je.innerHTML=_o,Pt=s(),We=d("p"),We.innerHTML=yo,Zt=s(),f(E.$$.fragment),ht=s(),f(he.$$.fragment),ut=s(),W=d("div"),f(ue.$$.fragment),Rt=s(),Pe=d("p"),Pe.innerHTML=Mo,Nt=s(),Ze=d("p"),Ze.innerHTML=bo,_t=s(),f(_e.$$.fragment),yt=s(),C=d("div"),f(ye.$$.fragment),Ft=s(),Re=d("p"),Re.innerHTML=Io,qt=s(),Ne=d("p"),Ne.innerHTML=To,Lt=s(),$=d("div"),f(Me.$$.fragment),Gt=s(),Fe=d("p"),Fe.innerHTML=wo,Bt=s(),f(H.$$.fragment),St=s(),qe=d("p"),qe.textContent=vo,Mt=s(),f(be.$$.fragment),bt=s(),j=d("div"),f(Ie.$$.fragment),Vt=s(),Le=d("p"),Le.innerHTML=Uo,Et=s(),Ge=d("p"),Ge.innerHTML=Co,Ht=s(),J=d("div"),f(Te.$$.fragment),Yt=s(),Be=d("p"),Be.innerHTML=jo,Qt=s(),f(Y.$$.fragment),At=s(),f(Q.$$.fragment),It=s(),f(we.$$.fragment),Tt=s(),P=d("div"),f(ve.$$.fragment),Xt=s(),Se=d("p"),Se.textContent=zo,Dt=s(),A=d("div"),f(Ue.$$.fragment),Ot=s(),Ve=d("p"),Ve.textContent=ko,wt=s(),f(Ce.$$.fragment),vt=s(),z=d("div"),f(je.$$.fragment),Kt=s(),Ee=d("p"),Ee.textContent=xo,eo=s(),He=d("p"),He.innerHTML=$o,to=s(),G=d("div"),f(ze.$$.fragment),oo=s(),Ye=d("p"),Ye.textContent=Jo,no=s(),f(X.$$.fragment),Ut=s(),f(ke.$$.fragment),Ct=s(),De=d("p"),this.h()},l(e){const t=Fo("svelte-u9bgzb",document.head);i=c(t,"META",{name:!0,content:!0}),t.forEach(o),T=a(e),p=c(e,"P",{}),k(p).forEach(o),m=a(e),h(b.$$.fragment,e),n=a(e),h(I.$$.fragment,e),Ke=a(e),K=c(e,"P",{"data-svelte-h":!0}),g(K)!=="svelte-1m8d2ny"&&(K.innerHTML=so),et=a(e),ee=c(e,"P",{"data-svelte-h":!0}),g(ee)!=="svelte-1ox6z7j"&&(ee.textContent=ao),tt=a(e),te=c(e,"UL",{"data-svelte-h":!0}),g(te)!=="svelte-1nmvj8w"&&(te.innerHTML=ro),ot=a(e),oe=c(e,"P",{"data-svelte-h":!0}),g(oe)!=="svelte-vfdo9a"&&(oe.textContent=io),nt=a(e),ne=c(e,"P",{"data-svelte-h":!0}),g(ne)!=="svelte-lkhlij"&&(ne.innerHTML=lo),st=a(e),h(se.$$.fragment,e),at=a(e),ae=c(e,"P",{"data-svelte-h":!0}),g(ae)!=="svelte-ff9k4v"&&(ae.textContent=co),rt=a(e),re=c(e,"P",{"data-svelte-h":!0}),g(re)!=="svelte-y46b2t"&&(re.innerHTML=mo),it=a(e),ie=c(e,"P",{"data-svelte-h":!0}),g(ie)!=="svelte-1nkyanl"&&(ie.textContent=po),lt=a(e),h(le.$$.fragment,e),dt=a(e),de=c(e,"P",{"data-svelte-h":!0}),g(de)!=="svelte-1f79iiu"&&(de.innerHTML=go),ct=a(e),ce=c(e,"P",{"data-svelte-h":!0}),g(ce)!=="svelte-18htqbw"&&(ce.innerHTML=fo),mt=a(e),h(me.$$.fragment,e),pt=a(e),v=c(e,"DIV",{class:!0});var Z=k(v);h(pe.$$.fragment,Z),xt=a(Z),xe=c(Z,"P",{"data-svelte-h":!0}),g(xe)!=="svelte-1j3s3yg"&&(xe.innerHTML=ho),$t=a(Z),$e=c(Z,"P",{"data-svelte-h":!0}),g($e)!=="svelte-o55m63"&&($e.innerHTML=uo),Jt=a(Z),h(V.$$.fragment,Z),Z.forEach(o),gt=a(e),h(ge.$$.fragment,e),ft=a(e),U=c(e,"DIV",{class:!0});var R=k(U);h(fe.$$.fragment,R),Wt=a(R),Je=c(R,"P",{"data-svelte-h":!0}),g(Je)!=="svelte-1ullheb"&&(Je.innerHTML=_o),Pt=a(R),We=c(R,"P",{"data-svelte-h":!0}),g(We)!=="svelte-o55m63"&&(We.innerHTML=yo),Zt=a(R),h(E.$$.fragment,R),R.forEach(o),ht=a(e),h(he.$$.fragment,e),ut=a(e),W=c(e,"DIV",{class:!0});var S=k(W);h(ue.$$.fragment,S),Rt=a(S),Pe=c(S,"P",{"data-svelte-h":!0}),g(Pe)!=="svelte-1ncirdg"&&(Pe.innerHTML=Mo),Nt=a(S),Ze=c(S,"P",{"data-svelte-h":!0}),g(Ze)!=="svelte-hswkmf"&&(Ze.innerHTML=bo),S.forEach(o),_t=a(e),h(_e.$$.fragment,e),yt=a(e),C=c(e,"DIV",{class:!0});var N=k(C);h(ye.$$.fragment,N),Ft=a(N),Re=c(N,"P",{"data-svelte-h":!0}),g(Re)!=="svelte-1szubin"&&(Re.innerHTML=Io),qt=a(N),Ne=c(N,"P",{"data-svelte-h":!0}),g(Ne)!=="svelte-hswkmf"&&(Ne.innerHTML=To),Lt=a(N),$=c(N,"DIV",{class:!0});var F=k($);h(Me.$$.fragment,F),Gt=a(F),Fe=c(F,"P",{"data-svelte-h":!0}),g(Fe)!=="svelte-mtys3j"&&(Fe.innerHTML=wo),Bt=a(F),h(H.$$.fragment,F),St=a(F),qe=c(F,"P",{"data-svelte-h":!0}),g(qe)!=="svelte-1opccf8"&&(qe.textContent=vo),F.forEach(o),N.forEach(o),Mt=a(e),h(be.$$.fragment,e),bt=a(e),j=c(e,"DIV",{class:!0});var q=k(j);h(Ie.$$.fragment,q),Vt=a(q),Le=c(q,"P",{"data-svelte-h":!0}),g(Le)!=="svelte-1hn17lk"&&(Le.innerHTML=Uo),Et=a(q),Ge=c(q,"P",{"data-svelte-h":!0}),g(Ge)!=="svelte-hswkmf"&&(Ge.innerHTML=Co),Ht=a(q),J=c(q,"DIV",{class:!0});var D=k(J);h(Te.$$.fragment,D),Yt=a(D),Be=c(D,"P",{"data-svelte-h":!0}),g(Be)!=="svelte-1jaxflt"&&(Be.innerHTML=jo),Qt=a(D),h(Y.$$.fragment,D),At=a(D),h(Q.$$.fragment,D),D.forEach(o),q.forEach(o),It=a(e),h(we.$$.fragment,e),Tt=a(e),P=c(e,"DIV",{class:!0});var Qe=k(P);h(ve.$$.fragment,Qe),Xt=a(Qe),Se=c(Qe,"P",{"data-svelte-h":!0}),g(Se)!=="svelte-1atvvs0"&&(Se.textContent=zo),Dt=a(Qe),A=c(Qe,"DIV",{class:!0});var zt=k(A);h(Ue.$$.fragment,zt),Ot=a(zt),Ve=c(zt,"P",{"data-svelte-h":!0}),g(Ve)!=="svelte-1xds4wy"&&(Ve.textContent=ko),zt.forEach(o),Qe.forEach(o),wt=a(e),h(Ce.$$.fragment,e),vt=a(e),z=c(e,"DIV",{class:!0});var O=k(z);h(je.$$.fragment,O),Kt=a(O),Ee=c(O,"P",{"data-svelte-h":!0}),g(Ee)!=="svelte-1kh2zup"&&(Ee.textContent=xo),eo=a(O),He=c(O,"P",{"data-svelte-h":!0}),g(He)!=="svelte-19k6dku"&&(He.innerHTML=$o),to=a(O),G=c(O,"DIV",{class:!0});var Ae=k(G);h(ze.$$.fragment,Ae),oo=a(Ae),Ye=c(Ae,"P",{"data-svelte-h":!0}),g(Ye)!=="svelte-421t2f"&&(Ye.textContent=Jo),no=a(Ae),h(X.$$.fragment,Ae),Ae.forEach(o),O.forEach(o),Ut=a(e),h(ke.$$.fragment,e),Ct=a(e),De=c(e,"P",{}),k(De).forEach(o),this.h()},h(){x(i,"name","hf:doc:metadata"),x(i,"content",Yo),x(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(z,"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){l(document.head,i),r(e,T,t),r(e,p,t),r(e,m,t),u(b,e,t),r(e,n,t),u(I,e,t),r(e,Ke,t),r(e,K,t),r(e,et,t),r(e,ee,t),r(e,tt,t),r(e,te,t),r(e,ot,t),r(e,oe,t),r(e,nt,t),r(e,ne,t),r(e,st,t),u(se,e,t),r(e,at,t),r(e,ae,t),r(e,rt,t),r(e,re,t),r(e,it,t),r(e,ie,t),r(e,lt,t),u(le,e,t),r(e,dt,t),r(e,de,t),r(e,ct,t),r(e,ce,t),r(e,mt,t),u(me,e,t),r(e,pt,t),r(e,v,t),u(pe,v,null),l(v,xt),l(v,xe),l(v,$t),l(v,$e),l(v,Jt),u(V,v,null),r(e,gt,t),u(ge,e,t),r(e,ft,t),r(e,U,t),u(fe,U,null),l(U,Wt),l(U,Je),l(U,Pt),l(U,We),l(U,Zt),u(E,U,null),r(e,ht,t),u(he,e,t),r(e,ut,t),r(e,W,t),u(ue,W,null),l(W,Rt),l(W,Pe),l(W,Nt),l(W,Ze),r(e,_t,t),u(_e,e,t),r(e,yt,t),r(e,C,t),u(ye,C,null),l(C,Ft),l(C,Re),l(C,qt),l(C,Ne),l(C,Lt),l(C,$),u(Me,$,null),l($,Gt),l($,Fe),l($,Bt),u(H,$,null),l($,St),l($,qe),r(e,Mt,t),u(be,e,t),r(e,bt,t),r(e,j,t),u(Ie,j,null),l(j,Vt),l(j,Le),l(j,Et),l(j,Ge),l(j,Ht),l(j,J),u(Te,J,null),l(J,Yt),l(J,Be),l(J,Qt),u(Y,J,null),l(J,At),u(Q,J,null),r(e,It,t),u(we,e,t),r(e,Tt,t),r(e,P,t),u(ve,P,null),l(P,Xt),l(P,Se),l(P,Dt),l(P,A),u(Ue,A,null),l(A,Ot),l(A,Ve),r(e,wt,t),u(Ce,e,t),r(e,vt,t),r(e,z,t),u(je,z,null),l(z,Kt),l(z,Ee),l(z,eo),l(z,He),l(z,to),l(z,G),u(ze,G,null),l(G,oo),l(G,Ye),l(G,no),u(X,G,null),r(e,Ut,t),u(ke,e,t),r(e,Ct,t),r(e,De,t),jt=!0},p(e,[t]){const Z={};t&2&&(Z.$$scope={dirty:t,ctx:e}),V.$set(Z);const R={};t&2&&(R.$$scope={dirty:t,ctx:e}),E.$set(R);const S={};t&2&&(S.$$scope={dirty:t,ctx:e}),H.$set(S);const N={};t&2&&(N.$$scope={dirty:t,ctx:e}),Y.$set(N);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),Q.$set(F);const q={};t&2&&(q.$$scope={dirty:t,ctx:e}),X.$set(q)},i(e){jt||(_(b.$$.fragment,e),_(I.$$.fragment,e),_(se.$$.fragment,e),_(le.$$.fragment,e),_(me.$$.fragment,e),_(pe.$$.fragment,e),_(V.$$.fragment,e),_(ge.$$.fragment,e),_(fe.$$.fragment,e),_(E.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(_e.$$.fragment,e),_(ye.$$.fragment,e),_(Me.$$.fragment,e),_(H.$$.fragment,e),_(be.$$.fragment,e),_(Ie.$$.fragment,e),_(Te.$$.fragment,e),_(Y.$$.fragment,e),_(Q.$$.fragment,e),_(we.$$.fragment,e),_(ve.$$.fragment,e),_(Ue.$$.fragment,e),_(Ce.$$.fragment,e),_(je.$$.fragment,e),_(ze.$$.fragment,e),_(X.$$.fragment,e),_(ke.$$.fragment,e),jt=!0)},o(e){y(b.$$.fragment,e),y(I.$$.fragment,e),y(se.$$.fragment,e),y(le.$$.fragment,e),y(me.$$.fragment,e),y(pe.$$.fragment,e),y(V.$$.fragment,e),y(ge.$$.fragment,e),y(fe.$$.fragment,e),y(E.$$.fragment,e),y(he.$$.fragment,e),y(ue.$$.fragment,e),y(_e.$$.fragment,e),y(ye.$$.fragment,e),y(Me.$$.fragment,e),y(H.$$.fragment,e),y(be.$$.fragment,e),y(Ie.$$.fragment,e),y(Te.$$.fragment,e),y(Y.$$.fragment,e),y(Q.$$.fragment,e),y(we.$$.fragment,e),y(ve.$$.fragment,e),y(Ue.$$.fragment,e),y(Ce.$$.fragment,e),y(je.$$.fragment,e),y(ze.$$.fragment,e),y(X.$$.fragment,e),y(ke.$$.fragment,e),jt=!1},d(e){e&&(o(T),o(p),o(m),o(n),o(Ke),o(K),o(et),o(ee),o(tt),o(te),o(ot),o(oe),o(nt),o(ne),o(st),o(at),o(ae),o(rt),o(re),o(it),o(ie),o(lt),o(dt),o(de),o(ct),o(ce),o(mt),o(pt),o(v),o(gt),o(ft),o(U),o(ht),o(ut),o(W),o(_t),o(yt),o(C),o(Mt),o(bt),o(j),o(It),o(Tt),o(P),o(wt),o(vt),o(z),o(Ut),o(Ct),o(De)),o(i),M(b,e),M(I,e),M(se,e),M(le,e),M(me,e),M(pe),M(V),M(ge,e),M(fe),M(E),M(he,e),M(ue),M(_e,e),M(ye),M(Me),M(H),M(be,e),M(Ie),M(Te),M(Y),M(Q),M(we,e),M(ve),M(Ue),M(Ce,e),M(je),M(ze),M(X),M(ke,e)}}}const Yo='{"title":"Idefics3","local":"idefics3","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips","local":"usage-tips","sections":[],"depth":2},{"title":"Idefics3Config","local":"transformers.Idefics3Config","sections":[],"depth":2},{"title":"Idefics3VisionConfig","local":"transformers.Idefics3VisionConfig","sections":[],"depth":2},{"title":"Idefics3VisionTransformer","local":"transformers.Idefics3VisionTransformer","sections":[],"depth":2},{"title":"Idefics3Model","local":"transformers.Idefics3Model","sections":[],"depth":2},{"title":"Idefics3ForConditionalGeneration","local":"transformers.Idefics3ForConditionalGeneration","sections":[],"depth":2},{"title":"Idefics3ImageProcessor","local":"transformers.Idefics3ImageProcessor","sections":[],"depth":2},{"title":"Idefics3Processor","local":"transformers.Idefics3Processor","sections":[],"depth":2}],"depth":1}';function Qo(w){return Zo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class on extends Ro{constructor(i){super(),No(this,i,Qo,Ho,Po,{})}}export{on as component};
