import{S as Da,i as La,s as Oa,e as n,k as c,w as y,t as i,M as Ha,c as s,d as t,m,a,x as T,h as d,b as h,G as e,g as _,y as I,q as w,o as M,B as k,v as qa,L as ot}from"../../chunks/vendor-hf-doc-builder.js";import{T as qs}from"../../chunks/Tip-hf-doc-builder.js";import{D as K}from"../../chunks/Docstring-hf-doc-builder.js";import{C as tt}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Xe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as et}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ga(C){let l,v,u,f,b;return{c(){l=n("p"),v=i("Idefics modeling code in Transformers is for finetuning and inferencing the pre-trained Idefics models."),u=c(),f=n("p"),b=i("To train a new Idefics model from scratch use the m4 codebase (a link will be provided once it\u2019s made public)")},l(r){l=s(r,"P",{});var p=a(l);v=d(p,"Idefics modeling code in Transformers is for finetuning and inferencing the pre-trained Idefics models."),p.forEach(t),u=m(r),f=s(r,"P",{});var z=a(f);b=d(z,"To train a new Idefics model from scratch use the m4 codebase (a link will be provided once it\u2019s made public)"),z.forEach(t)},m(r,p){_(r,l,p),e(l,v),_(r,u,p),_(r,f,p),e(f,b)},d(r){r&&t(l),r&&t(u),r&&t(f)}}}function Xa(C){let l,v,u,f,b;return f=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMElkZWZpY3NNb2RlbCUyQyUyMElkZWZpY3NDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwSWRlZmljcyUyMGlkZWZpY3MtOWIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwSWRlZmljc0NvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMGlkZWZpY3MtOWIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMElkZWZpY3NNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> IdeficsModel, IdeficsConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Idefics idefics-9b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = IdeficsConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the idefics-9b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = IdeficsModel(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`}}),{c(){l=n("p"),v=i("Example:"),u=c(),y(f.$$.fragment)},l(r){l=s(r,"P",{});var p=a(l);v=d(p,"Example:"),p.forEach(t),u=m(r),T(f.$$.fragment,r)},m(r,p){_(r,l,p),e(l,v),_(r,u,p),I(f,r,p),b=!0},p:ot,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(u),k(f,r)}}}function Ya(C){let l,v,u,f,b;return{c(){l=n("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=s(r,"P",{});var p=a(l);v=d(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var z=a(u);f=d(z,"Module"),z.forEach(t),b=d(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(r,p){_(r,l,p),e(l,v),e(l,u),e(u,f),e(l,b)},d(r){r&&t(l)}}}function Qa(C){let l,v,u,f,b;return{c(){l=n("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=n("code"),f=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){l=s(r,"P",{});var p=a(l);v=d(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(p,"CODE",{});var z=a(u);f=d(z,"Module"),z.forEach(t),b=d(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(r,p){_(r,l,p),e(l,v),e(l,u),e(u,f),e(l,b)},d(r){r&&t(l)}}}function Ka(C){let l,v,u,f,b;return f=new tt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBMbGFtYUZvckNhdXNhbExNJTBBJTBBbW9kZWwlMjAlM0QlMjBMbGFtYUZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZChQQVRIX1RPX0NPTlZFUlRFRF9XRUlHSFRTKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKFBBVEhfVE9fQ09OVkVSVEVEX1RPS0VOSVpFUiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXJzJTNGJTIwQ2FuJTIweW91JTIwdGFsayUyMHRvJTIwbWUlM0YlMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cy5pbnB1dF9pZHMlMkMlMjBtYXhfbGVuZ3RoJTNEMzApJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LlamaForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LlamaForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;Hey, are you consciours? Can you talk to me?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Generate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generate_ids = model.generate(inputs.input_ids, max_length=<span class="hljs-number">30</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.batch_decode(generate_ids, skip_special_tokens=<span class="hljs-literal">True</span>, clean_up_tokenization_spaces=<span class="hljs-literal">False</span>)[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;Hey, are you consciours? Can you talk to me?\\nI&#x27;m not consciours, but I can talk to you.&quot;</span>`}}),{c(){l=n("p"),v=i("Example:"),u=c(),y(f.$$.fragment)},l(r){l=s(r,"P",{});var p=a(l);v=d(p,"Example:"),p.forEach(t),u=m(r),T(f.$$.fragment,r)},m(r,p){_(r,l,p),e(l,v),_(r,u,p),I(f,r,p),b=!0},p:ot,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(u),k(f,r)}}}function er(C){let l,v,u,f,b;return f=new tt({props:{code:"Y2hlY2twb2ludCUyMCUzRCUyMCUyMkh1Z2dpbmdGYWNlTTQlMkZpZGVmaWNzLTliJTIyJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCklMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmhpcHMuaGVhcnN0YXBwcy5jb20lMkZobWctcHJvZCUyRmltYWdlcyUyRmN1dGUtcGhvdG9zLW9mLWNhdHMtaW4tZ3Jhc3MtMTU5MzE4NDc3Ny5qcGclMjIlMEFpbWclMjAlM0QlMjBwcm9jZXNzb3IuaW1hZ2VfcHJvY2Vzc29yLmZldGNoX2ltYWdlcyglNUJ1cmwlNUQpJTVCMCU1RCUwQSUwQXByb21wdHMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjJVc2VyJTNBJTIyJTJDJTBBJTIwJTIwJTIwJTIwaW1nJTJDJTBBJTIwJTIwJTIwJTIwJTIyRGVzY3JpYmUlMjB0aGlzJTIwaW1hZ2UuJTBBdCUzQSUyMEFuJTIwaW1hZ2UlMjBvZiUyMHR3byUyMGtpdHRlbnMlMjBpbiUyMGdyYXNzLiUwQSUwQSUyMCUyMCUyMCUyMCUyMlVzZXIlM0ElMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhpcHMuaGVhcnN0YXBwcy5jb20lMkZobWctcHJvZCUyRmltYWdlcyUyRmRvZy1wdW5zLTE1ODE3MDgyMDguanBnJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyRGVzY3JpYmUlMjB0aGlzJTIwaW1hZ2UuJTBBdCUzQSUyMiUyQyUwQSU1RCUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcihwcm9tcHRzJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKippbnB1dHMlMkMlMjBtYXhfbGVuZ3RoJTNEMTAwKSUwQWdlbmVyYXRlZF90ZXh0JTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RA==",highlighted:`checkpoint = <span class="hljs-string">&quot;HuggingFaceM4/idefics-9b&quot;</span>
processor = AutoProcessor.from_pretrained(checkpoint)
url = <span class="hljs-string">&quot;https://hips.hearstapps.com/hmg-prod/images/cute-photos-of-cats-in-grass-1593184777.jpg&quot;</span>
img = processor.image_processor.fetch_images([url])[<span class="hljs-number">0</span>]

prompts = [
    <span class="hljs-string">&quot;User:&quot;</span>,
    img,
    <span class="hljs-string">&quot;Describe this image.
t: An image of two kittens in grass.

    &quot;</span>User:<span class="hljs-string">&quot;,
    &quot;</span>https://hips.hearstapps.com/hmg-prod/images/dog-puns-<span class="hljs-number">1581708208.j</span>pg<span class="hljs-string">&quot;,
    &quot;</span>Describe this image.
t:<span class="hljs-string">&quot;,
]

inputs = processor(prompts, return_tensors=&quot;</span>pt<span class="hljs-string">&quot;)
generated_ids = model.generate(**inputs, max_length=100)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]</span>`}}),{c(){l=n("p"),v=i("Example:"),u=c(),y(f.$$.fragment)},l(r){l=s(r,"P",{});var p=a(l);v=d(p,"Example:"),p.forEach(t),u=m(r),T(f.$$.fragment,r)},m(r,p){_(r,l,p),e(l,v),_(r,u,p),I(f,r,p),b=!0},p:ot,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(u),k(f,r)}}}function or(C){let l,v,u,f,b,r,p,z;return p=new tt({props:{code:"JTNDcyUzRVVzZXIlM0ElM0NmYWtlX3Rva2VuX2Fyb3VuZF9pbWFnZSUzRSUzQ2ltYWdlJTNFJTNDZmFrZV90b2tlbl9hcm91bmRfaW1hZ2UlM0VEZXNjcmliZSUyMHRoaXMlMjBpbWFnZS4lMEFBc3Npc3RhbnQlM0ElMjBBbiUyMGltYWdlJTIwb2YlMjB0d28lMjBraXR0ZW5zJTIwaW4lMjBncmFzcy4lMEFVc2VyJTNBJTNDZmFrZV90b2tlbl9hcm91bmRfaW1hZ2UlM0UlM0NpbWFnZSUzRSUzQ2Zha2VfdG9rZW5fYXJvdW5kX2ltYWdlJTNFRGVzY3JpYmUlMjB0aGlzJTIwaW1hZ2UuJTBBQXNzaXN0YW50JTNBJw==",highlighted:`&lt;s&gt;User:&lt;fake_token_around_image&gt;&lt;image&gt;&lt;fake_token_around_image&gt;Describe <span class="hljs-keyword">this</span> image.
Assistant: An image of two kittens in grass.
User:&lt;fake_token_around_image&gt;&lt;image&gt;&lt;fake_token_around_image&gt;Describe <span class="hljs-keyword">this</span> image.
Assistant:&#x27;`}}),{c(){l=n("p"),v=i("In this example the "),u=n("code"),f=i("prompts"),b=i(" will be converted into:"),r=c(),y(p.$$.fragment)},l(E){l=s(E,"P",{});var J=a(l);v=d(J,"In this example the "),u=s(J,"CODE",{});var W=a(u);f=d(W,"prompts"),W.forEach(t),b=d(J," will be converted into:"),J.forEach(t),r=m(E),T(p.$$.fragment,E)},m(E,J){_(E,l,J),e(l,v),e(l,u),e(u,f),e(l,b),_(E,r,J),I(p,E,J),z=!0},p:ot,i(E){z||(w(p.$$.fragment,E),z=!0)},o(E){M(p.$$.fragment,E),z=!1},d(E){E&&t(l),E&&t(r),k(p,E)}}}function tr(C){let l,v,u,f,b;return f=new tt({props:{code:"aW1hZ2VfdHJhbnNmb3JtJTIwJTNEJTIwdHJhbnNmb3Jtcy5Db21wb3NlKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRyYW5zZm9ybXMuUmFuZG9tUmVzaXplZENyb3AoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKHclMkMlMjBoKSUyQyUyMHNjYWxlJTNEKDAuOSUyQyUyMDEuMCklMkMlMjBpbnRlcnBvbGF0aW9uJTNEdHJhbnNmb3Jtcy5JbnRlcnBvbGF0aW9uTW9kZS5CSUNVQklDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRyYW5zZm9ybXMuVG9UZW5zb3IoKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRyYW5zZm9ybXMuTm9ybWFsaXplKG1lYW4lM0RzZWxmLmltYWdlX21lYW4lMkMlMjBzdGQlM0RzZWxmLmltYWdlX3N0ZCklMkMlMEElMjAlMjAlMjAlMjAlNUQlMEEpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHByb21wdHMlMkMlMjB0cmFuc2Zvcm0lM0RpbWFnZV90cmFuc2Zvcm0lMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKQ==",highlighted:`image_transform = transforms.Compose(
    [
        transforms.RandomResizedCrop(
            (w, h), scale=(<span class="hljs-number">0.9</span>, <span class="hljs-number">1.0</span>), interpolation=transforms.InterpolationMode.BICUBIC
        ),
        transforms.ToTensor(),
        transforms.Normalize(mean=self.image_mean, std=self.image_std),
    ]
)
inputs = processor(prompts, transform=image_transform, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`}}),{c(){l=n("p"),v=i("To do training do:"),u=c(),y(f.$$.fragment)},l(r){l=s(r,"P",{});var p=a(l);v=d(p,"To do training do:"),p.forEach(t),u=m(r),T(f.$$.fragment,r)},m(r,p){_(r,l,p),e(l,v),_(r,u,p),I(f,r,p),b=!0},p:ot,i(r){b||(w(f.$$.fragment,r),b=!0)},o(r){M(f.$$.fragment,r),b=!1},d(r){r&&t(l),r&&t(u),k(f,r)}}}function nr(C){let l,v,u,f,b,r,p,z,E,J,W,ee,uo,Te,Wt,_o,jt,nt,oe,St,Ie,Zt,At,st,Ye,Rt,at,Qe,bo,Vt,rt,te,Bt,we,Dt,Lt,it,ne,dt,B,se,vo,Me,Ot,yo,Ht,lt,U,ke,qt,$e,Gt,Ke,Xt,Yt,Qt,eo,Kt,xe,en,on,D,tn,oo,nn,sn,to,an,rn,dn,ae,ct,L,re,To,ze,ln,Io,cn,mt,P,Ee,mn,Ce,pn,no,fn,hn,gn,Ue,un,Pe,_n,bn,vn,ie,yn,wo,Tn,In,Mo,wn,Mn,A,Ne,kn,O,$n,so,xn,zn,ko,En,Cn,Un,de,pt,H,le,$o,Je,Pn,xo,Nn,ft,q,Fe,Jn,j,We,Fn,G,Wn,ao,jn,Sn,zo,Zn,An,Rn,ce,Vn,me,ht,X,pe,Eo,je,Bn,Co,Dn,gt,S,Se,Ln,Uo,On,Hn,fe,Ze,qn,Po,Gn,ut,Y,he,No,Ae,Xn,Jo,Yn,_t,F,Re,Qn,Fo,Kn,es,N,ro,os,ts,io,ns,ss,lo,as,rs,Ve,Wo,is,ds,ls,jo,cs,ms,ps,$,Be,fs,So,hs,gs,Zo,us,_s,De,bs,Ao,vs,ys,Ts,Le,Is,Ro,ws,Ms,ks,Oe,$s,Vo,xs,zs,Es,ge,Cs,ue,Us,Q,Ps,_e,Ns,Bo,Js,Fs,Ws,Do,js,Ss,Zs,Lo,As,Rs,be,Vs,He,Bs,Oo,Ds,Ls,bt;return r=new Xe({}),Te=new Xe({}),ne=new qs({props:{warning:!0,$$slots:{default:[Ga]},$$scope:{ctx:C}}}),Me=new Xe({}),ke=new K({props:{name:"class transformers.IdeficsConfig",anchor:"transformers.IdeficsConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"additional_vocab_size",val:" = 0"},{name:"hidden_size",val:" = 4096"},{name:"intermediate_size",val:" = 11008"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"dropout",val:" = 0.0"},{name:"hidden_act",val:" = 'silu'"},{name:"initializer_range",val:" = 0.02"},{name:"alpha_initializer",val:" = 'zeros'"},{name:"alphas_initializer_range",val:" = 0.0"},{name:"alpha_type",val:" = 'float'"},{name:"rms_norm_eps",val:" = 1e-06"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"tie_word_embeddings",val:" = False"},{name:"cross_layer_interval",val:" = 1"},{name:"qk_layer_norms",val:" = False"},{name:"freeze_text_layers",val:" = True"},{name:"freeze_text_module_exceptions",val:" = []"},{name:"freeze_lm_head",val:" = False"},{name:"freeze_vision_layers",val:" = True"},{name:"freeze_vision_module_exceptions",val:" = []"},{name:"use_resampler",val:" = False"},{name:"vision_config",val:" = None"},{name:"perceiver_config",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IdeficsConfig.additional_vocab_size",description:`<strong>additional_vocab_size</strong> (<code>int</code>, *optional\`, defaults to 0) &#x2014;
Additional vocabulary size of the model, typically for the special &#x201D;<img>&#x201D; token. Additional vocab tokens
are always trainable whereas regular vocab tokens can be frozen or not.`,name:"additional_vocab_size"},{anchor:"transformers.IdeficsConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the Idefics model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsModel">~IdeficsModel</a>`,name:"vocab_size"},{anchor:"transformers.IdeficsConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimension of the hidden representations.`,name:"hidden_size"},{anchor:"transformers.IdeficsConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 11008) &#x2014;
Dimension of the MLP representations.`,name:"intermediate_size"},{anchor:"transformers.IdeficsConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.IdeficsConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.IdeficsConfig.dropout",description:`<strong>dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"dropout"},{anchor:"transformers.IdeficsConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the decoder.`,name:"hidden_act"},{anchor:"transformers.IdeficsConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.IdeficsConfig.alpha_initializer",description:`<strong>alpha_initializer</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;zeros&quot;</code>) &#x2014;
Initialization type for the alphas.`,name:"alpha_initializer"},{anchor:"transformers.IdeficsConfig.alphas_initializer_range",description:`<strong>alphas_initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing the alphas in the Gated Cross
Attention.`,name:"alphas_initializer_range"},{anchor:"transformers.IdeficsConfig.alpha_type",description:`<strong>alpha_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;float&quot;</code>) &#x2014;
Whether the gating alphas should be vectors or single floats.`,name:"alpha_type"},{anchor:"transformers.IdeficsConfig.rms_norm_eps",description:`<strong>rms_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-6) &#x2014;
The epsilon used by the rms normalization layers.`,name:"rms_norm_eps"},{anchor:"transformers.IdeficsConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.IdeficsConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Padding token id.`,name:"pad_token_id"},{anchor:"transformers.IdeficsConfig.bos_token_id",description:`<strong>bos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Beginning of stream token id.`,name:"bos_token_id"},{anchor:"transformers.IdeficsConfig.eos_token_id",description:`<strong>eos_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
End of stream token id.`,name:"eos_token_id"},{anchor:"transformers.IdeficsConfig.tie_word_embeddings(bool,",description:`<strong>tie_word_embeddings(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to tie weight embeddings`,name:"tie_word_embeddings(bool,"},{anchor:"transformers.IdeficsConfig.cross_layer_interval",description:`<strong>cross_layer_interval</strong> (<code>int</code>, <em>optional</em>, default to 1) &#x2014;
Interval for cross attention (from text to image) layers.`,name:"cross_layer_interval"},{anchor:"transformers.IdeficsConfig.qk_layer_norms",description:"<strong>qk_layer_norms</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Whether to add layer norm after q and k",name:"qk_layer_norms"},{anchor:"transformers.IdeficsConfig.freeze_text_layers",description:"<strong>freeze_text_layers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014; Whether to freeze text layers",name:"freeze_text_layers"},{anchor:"transformers.IdeficsConfig.freeze_text_module_exceptions",description:`<strong>freeze_text_module_exceptions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>[]</code>) &#x2014;
Exceptions to freezing text layers when <code>freeze_text_layers</code> is <code>True</code>`,name:"freeze_text_module_exceptions"},{anchor:"transformers.IdeficsConfig.freeze_lm_head",description:"<strong>freeze_lm_head</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Whether to freeze lm head",name:"freeze_lm_head"},{anchor:"transformers.IdeficsConfig.freeze_vision_layers",description:"<strong>freeze_vision_layers</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;  Whether to freeze vision layers",name:"freeze_vision_layers"},{anchor:"transformers.IdeficsConfig.freeze_vision_module_exceptions",description:`<strong>freeze_vision_module_exceptions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>[]</code>) &#x2014;
Exceptions to freezing vision layers when <code>freeze_vision_layers</code> is <code>True</code>`,name:"freeze_vision_module_exceptions"},{anchor:"transformers.IdeficsConfig.use_resampler",description:"<strong>use_resampler</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Whether to use the Resampler",name:"use_resampler"},{anchor:"transformers.IdeficsConfig.vision_config",description:"<strong>vision_config</strong> (<code>IdeficsVisionConfig</code>,  <em>optional</em>) &#x2014; Custom vision config or dict",name:"vision_config"},{anchor:"transformers.IdeficsConfig.perceiver_config",description:"<strong>perceiver_config</strong> (<code>IdeficsPerceiverConfig</code>,  <em>optional</em>) &#x2014; Custom perceiver config or dict",name:"perceiver_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics/configuration_idefics.py#L159"}}),ae=new et({props:{anchor:"transformers.IdeficsConfig.example",$$slots:{default:[Xa]},$$scope:{ctx:C}}}),ze=new Xe({}),Ee=new K({props:{name:"class transformers.IdeficsModel",anchor:"transformers.IdeficsModel",parameters:[{name:"config",val:": IdeficsConfig"}],parametersDescription:[{anchor:"transformers.IdeficsModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsConfig">IdeficsConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.
config &#x2014; IdeficsConfig`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics/modeling_idefics.py#L1043"}}),Ne=new K({props:{name:"forward",anchor:"transformers.IdeficsModel.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:"image_encoder_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"perceiver_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_attention_mask",val:": typing.Optional[torch.Tensor] = 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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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.IdeficsModel.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/idefics/modeling_idefics.py#L1145"}}),de=new qs({props:{$$slots:{default:[Ya]},$$scope:{ctx:C}}}),Je=new Xe({}),Fe=new K({props:{name:"class transformers.IdeficsForVisionText2Text",anchor:"transformers.IdeficsForVisionText2Text",parameters:[{name:"config",val:""},{name:"vision_model",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics/modeling_idefics.py#L1396"}}),We=new K({props:{name:"forward",anchor:"transformers.IdeficsForVisionText2Text.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:"image_encoder_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"perceiver_embeddings",val:": typing.Optional[torch.FloatTensor] = None"},{name:"image_attention_mask",val:": typing.Optional[torch.Tensor] = 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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.IdeficsForVisionText2Text.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.</p>
<p>Args &#x2014;
labels (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (see <code>input_ids</code> docstring). Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics/modeling_idefics.py#L1454",returnDescription:`
<p>A <code>transformers.models.idefics.modeling_idefics.IdeficsCausalLMOutputWithPast</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/idefics#transformers.IdeficsConfig"
>IdeficsConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>image_hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the image embeddings, <code>(batch_size, num_images, sequence_length, hidden_size)</code>.</p>
<p>image_hidden_states of the model produced by the vision encoder, and optionally by the perceiver</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.models.idefics.modeling_idefics.IdeficsCausalLMOutputWithPast</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new qs({props:{$$slots:{default:[Qa]},$$scope:{ctx:C}}}),me=new et({props:{anchor:"transformers.IdeficsForVisionText2Text.forward.example",$$slots:{default:[Ka]},$$scope:{ctx:C}}}),je=new Xe({}),Se=new K({props:{name:"class transformers.IdeficsImageProcessor",anchor:"transformers.IdeficsImageProcessor",parameters:[{name:"image_size",val:": int = 224"},{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:"image_num_channels",val:": typing.Optional[int] = 3"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IdeficsImageProcessor.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>224</code>) &#x2014;
Resize to image size`,name:"image_size"},{anchor:"transformers.IdeficsImageProcessor.image_num_channels",description:`<strong>image_num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>3</code>) &#x2014;
Number of image channels.`,name:"image_num_channels"},{anchor:"transformers.IdeficsImageProcessor.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.IdeficsImageProcessor.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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics/image_processing_idefics.py#L51"}}),Ze=new K({props:{name:"preprocess",anchor:"transformers.IdeficsImageProcessor.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:"image_num_channels",val:": typing.Optional[int] = 3"},{name:"image_size",val:": typing.Union[typing.Dict[str, int], NoneType] = 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:"transform",val:": typing.Callable = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IdeficsImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
A list of images to preprocess.`,name:"images"},{anchor:"transformers.IdeficsImageProcessor.preprocess.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.image_size</code>) &#x2014;
Resize to image size`,name:"image_size"},{anchor:"transformers.IdeficsImageProcessor.preprocess.image_num_channels",description:`<strong>image_num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.image_num_channels</code>) &#x2014;
Number of image channels.`,name:"image_num_channels"},{anchor:"transformers.IdeficsImageProcessor.preprocess.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.IdeficsImageProcessor.preprocess.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.IdeficsImageProcessor.preprocess.transform",description:`<strong>transform</strong> (<code>Callable</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
A custom transform function that accepts a single image can be passed for training. For example,
<code>torchvision.Compose</code> can be used to compose multiple transforms. If <code>None</code> - an inference mode is
assumed - and then a preset of inference-specific transforms will be applied to the images`,name:"transform"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics/image_processing_idefics.py#L87",returnDescription:`
<p>a PyTorch tensor of the processed images</p>
`}}),Ae=new Xe({}),Re=new K({props:{name:"class transformers.IdeficsProcessor",anchor:"transformers.IdeficsProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:" = None"},{name:"image_size",val:" = 224"},{name:"add_end_of_utterance_token",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.IdeficsProcessor.image_processor",description:`<strong>image_processor</strong> (<code>IdeficsImageProcessor</code>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsImageProcessor">IdeficsImageProcessor</a>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.IdeficsProcessor.tokenizer",description:`<strong>tokenizer</strong> (<code>LlamaTokenizerFast</code>) &#x2014;
An instance of <a href="/docs/transformers/main/en/model_doc/llama2#transformers.LlamaTokenizerFast">LlamaTokenizerFast</a>. The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.IdeficsProcessor.image_size",description:"<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014; Image size (assuming a square image)",name:"image_size"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics/processing_idefics.py#L108"}}),Be=new K({props:{name:"__call__",anchor:"transformers.IdeficsProcessor.__call__",parameters:[{name:"prompts",val:": typing.Union[typing.List[str], typing.List[typing.List[str]]]"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"transform",val:": typing.Callable = None"},{name:"add_eos_token",val:" = False"},{name:"add_end_of_utterance_token",val:" = None"},{name:"debug",val:" = False"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = <TensorType.PYTORCH: 'pt'>"}],parametersDescription:[{anchor:"transformers.IdeficsProcessor.__call__.prompts",description:`<strong>prompts</strong> (<code>Union[List[TextInput], [List[List[TextInput]]]]</code>) &#x2014;
either a single prompt or a batched list of prompts - see the detailed description immediately after
the end of the arguments doc section.`,name:"prompts"},{anchor:"transformers.IdeficsProcessor.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Select a strategy to pad the returned sequences (according to the model&#x2019;s padding side and padding
index) among:<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.IdeficsProcessor.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length of the returned list and optionally padding length (see above).`,name:"max_length"},{anchor:"transformers.IdeficsProcessor.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Activates truncation to cut input sequences longer than <code>max_length</code> to <code>max_length</code>.`,name:"truncation"},{anchor:"transformers.IdeficsProcessor.__call__.transform",description:`<strong>transform</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A custom transform function that accepts a single image can be passed for training. For example,
<code>torchvision.Compose</code> can be used to compose multiple functions. If <code>None</code> a preset inference-specific
set of transforms will be applied to the images`,name:"transform"},{anchor:"transformers.IdeficsProcessor.__call__.add_eos_token",description:"<strong>add_eos_token</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;\nAdds <code>eos_token</code> at the end of the final prompt if True`",name:"add_eos_token"},{anchor:"transformers.IdeficsProcessor.__call__.add_end_of_utterance_token",description:`<strong>add_end_of_utterance_token</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to automatically add <code>&lt;end_of_utterance&gt;</code> after each prompt&#x2019;s text input (unless followed by an
image). If <code>None</code> the tokenizer will be checked instead and if this token is found in
<code>additional_special_tokens</code> then the value will be <code>True</code>.`,name:"add_end_of_utterance_token"},{anchor:"transformers.IdeficsProcessor.__call__.debug",description:`<strong>debug</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
<code>True</code> value will help debug prompt generation by dumping useful information`,name:"debug"},{anchor:"transformers.IdeficsProcessor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>, defaults to <code>TensorType.PYTORCH</code>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/idefics/processing_idefics.py#L148",returnDescription:`
<p><code>input_ids</code>, <code>attention_mask</code>, <code>pixel_values</code>, <code>image_attention_mask</code> which can be
directly passed to <code>model.generate</code></p>
`,returnType:`
<p>a dict with entries</p>
`}}),ge=new et({props:{anchor:"transformers.IdeficsProcessor.__call__.example",$$slots:{default:[er]},$$scope:{ctx:C}}}),ue=new et({props:{anchor:"transformers.IdeficsProcessor.__call__.example-2",$$slots:{default:[or]},$$scope:{ctx:C}}}),be=new et({props:{anchor:"transformers.IdeficsProcessor.__call__.example-3",$$slots:{default:[tr]},$$scope:{ctx:C}}}),{c(){l=n("meta"),v=c(),u=n("h1"),f=n("a"),b=n("span"),y(r.$$.fragment),p=c(),z=n("span"),E=i("IDEFICS"),J=c(),W=n("h2"),ee=n("a"),uo=n("span"),y(Te.$$.fragment),Wt=c(),_o=n("span"),jt=i("Overview"),nt=c(),oe=n("p"),St=i("The IDEFICS model was proposed in "),Ie=n("a"),Zt=i("OBELICS: An Open Web-Scale Filtered Dataset of Interleaved Image-Text Documents"),At=i(" by Hugo Lauren\xE7on, Lucile Saulnier, L\xE9o Tronchon, Stas Bekman, Amanpreet Singh, Anton Lozhkov, Thomas Wang, Siddharth Karamcheti, Alexander M. Rush, Douwe Kiela, Matthieu Cord, Victor Sanh"),st=c(),Ye=n("p"),Rt=i("The abstract from the paper is the following:"),at=c(),Qe=n("p"),bo=n("em"),Vt=i("Large multimodal models trained on natural documents, which interleave images and text, outperform models trained on image-text pairs on various multimodal benchmarks that require reasoning over one or multiple images to generate a text. However, the datasets used to train these models have not been released, and the collection process has not been fully specified. We introduce the OBELICS dataset, an open web-scale filtered dataset of interleaved image-text documents comprising 141 million web pages extracted from Common Crawl, 353 million associated images, and 115 billion text tokens. We describe the dataset creation process, present comprehensive filtering rules, and provide an analysis of the dataset\u2019s content. To show the viability of OBELISC, we train an 80 billion parameters vision and language model on the dataset and obtain competitive performance on various multimodal benchmarks. We release the code to reproduce the dataset along with the dataset itself."),rt=c(),te=n("p"),Bt=i("This model was contributed by "),we=n("a"),Dt=i("HuggingFaceM4"),Lt=i(". The original code can be found [here](<INSERT LINK TO GITHUB REPO HERE>). (TODO: don\u2019t have a public link yet)."),it=c(),y(ne.$$.fragment),dt=c(),B=n("h2"),se=n("a"),vo=n("span"),y(Me.$$.fragment),Ot=c(),yo=n("span"),Ht=i("IdeficsConfig"),lt=c(),U=n("div"),y(ke.$$.fragment),qt=c(),$e=n("p"),Gt=i("This is the configuration class to store the configuration of a "),Ke=n("a"),Xt=i("IdeficsModel"),Yt=i(`. It is used to instantiate an
Idefics 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 Idefics-9B.`),Qt=c(),eo=n("p"),Kt=i("e.g. "),xe=n("a"),en=i("HuggingFaceM4/idefics-9b"),on=c(),D=n("p"),tn=i("Configuration objects inherit from "),oo=n("a"),nn=i("PretrainedConfig"),sn=i(` and can be used to control the model outputs. Read the
documentation from `),to=n("a"),an=i("PretrainedConfig"),rn=i(" for more information."),dn=c(),y(ae.$$.fragment),ct=c(),L=n("h2"),re=n("a"),To=n("span"),y(ze.$$.fragment),ln=c(),Io=n("span"),cn=i("IdeficsModel"),mt=c(),P=n("div"),y(Ee.$$.fragment),mn=c(),Ce=n("p"),pn=i(`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from `),no=n("a"),fn=i("PreTrainedModel"),hn=i(`. 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.)`),gn=c(),Ue=n("p"),un=i("This model is also a PyTorch "),Pe=n("a"),_n=i("torch.nn.Module"),bn=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vn=c(),ie=n("p"),yn=i("Transformer decoder consisting of "),wo=n("code"),Tn=i("config.num_hidden_layers"),In=i(" layers. Each layer is a "),Mo=n("code"),wn=i("IdeficsDecoderLayer"),Mn=c(),A=n("div"),y(Ne.$$.fragment),kn=c(),O=n("p"),$n=i("The "),so=n("a"),xn=i("IdeficsModel"),zn=i(" forward method, overrides the "),ko=n("code"),En=i("__call__"),Cn=i(" special method."),Un=c(),y(de.$$.fragment),pt=c(),H=n("h2"),le=n("a"),$o=n("span"),y(Je.$$.fragment),Pn=c(),xo=n("span"),Nn=i("IdeficsForVisionText2Text"),ft=c(),q=n("div"),y(Fe.$$.fragment),Jn=c(),j=n("div"),y(We.$$.fragment),Fn=c(),G=n("p"),Wn=i("The "),ao=n("a"),jn=i("IdeficsForVisionText2Text"),Sn=i(" forward method, overrides the "),zo=n("code"),Zn=i("__call__"),An=i(" special method."),Rn=c(),y(ce.$$.fragment),Vn=c(),y(me.$$.fragment),ht=c(),X=n("h2"),pe=n("a"),Eo=n("span"),y(je.$$.fragment),Bn=c(),Co=n("span"),Dn=i("IdeficsImageProcessor"),gt=c(),S=n("div"),y(Se.$$.fragment),Ln=c(),Uo=n("p"),On=i("Constructs a Idefics image processor."),Hn=c(),fe=n("div"),y(Ze.$$.fragment),qn=c(),Po=n("p"),Gn=i("Preprocess a batch of images."),ut=c(),Y=n("h2"),he=n("a"),No=n("span"),y(Ae.$$.fragment),Xn=c(),Jo=n("span"),Yn=i("IdeficsProcessor"),_t=c(),F=n("div"),y(Re.$$.fragment),Qn=c(),Fo=n("p"),Kn=i("Constructs a IDEFICS processor which wraps a LLama tokenizer and IDEFICS image processor into a single processor."),es=c(),N=n("p"),ro=n("a"),os=i("IdeficsProcessor"),ts=i(" offers all the functionalities of "),io=n("a"),ns=i("IdeficsImageProcessor"),ss=i(" and "),lo=n("a"),as=i("LlamaTokenizerFast"),rs=i(`. See
the docstring of `),Ve=n("a"),Wo=n("strong"),is=i("call"),ds=i("()"),ls=i(" and "),jo=n("code"),cs=i("decode()"),ms=i(" for more information."),ps=c(),$=n("div"),y(Be.$$.fragment),fs=c(),So=n("p"),hs=i(`This method takes batched or non-batched prompts made of text and images and converts them into prompts that
the model was trained on and prepares the image pixel values for the model to process.`),gs=c(),Zo=n("p"),us=i("Detailed explanation:"),_s=c(),De=n("p"),bs=i("Each entry in "),Ao=n("code"),vs=i("prompts"),ys=i(" is either a text to be passed as is or an image that will be processed."),Ts=c(),Le=n("p"),Is=i("An image can be either an image object ("),Ro=n("code"),ws=i("PIL.Image"),Ms=i(") or a url from which the image can be retrieved."),ks=c(),Oe=n("p"),$s=i("When the processor encounters an image it\u2019ll inject "),Vo=n("code"),xs=i("<fake_token_around_image><image><fake_token_around_image>"),zs=i(`
entry into the prompt.`),Es=c(),y(ge.$$.fragment),Cs=c(),y(ue.$$.fragment),Us=c(),Q=n("p"),Ps=i("and the two images will be massaged using "),_e=n("a"),Ns=i("IdeficsImageProcessor."),Bo=n("strong"),Js=i("call"),Fs=i("()"),Ws=i(` method and placed inside the
`),Do=n("code"),js=i("pixel_values"),Ss=i(" dict entry of the return value."),Zs=c(),Lo=n("p"),As=i(`This example also examplifies that images can be passed as objects or as text urls. It can be seen that the
first image is passed as object and the second one as a url.`),Rs=c(),y(be.$$.fragment),Vs=c(),He=n("p"),Bs=i("In order to help debug prompt generation enable "),Oo=n("code"),Ds=i("debug=True"),Ls=i(" which will show you what\u2019s happening."),this.h()},l(o){const g=Ha('[data-svelte="svelte-1phssyn"]',document.head);l=s(g,"META",{name:!0,content:!0}),g.forEach(t),v=m(o),u=s(o,"H1",{class:!0});var qe=a(u);f=s(qe,"A",{id:!0,class:!0,href:!0});var Ho=a(f);b=s(Ho,"SPAN",{});var qo=a(b);T(r.$$.fragment,qo),qo.forEach(t),Ho.forEach(t),p=m(qe),z=s(qe,"SPAN",{});var Go=a(z);E=d(Go,"IDEFICS"),Go.forEach(t),qe.forEach(t),J=m(o),W=s(o,"H2",{class:!0});var Ge=a(W);ee=s(Ge,"A",{id:!0,class:!0,href:!0});var Xo=a(ee);uo=s(Xo,"SPAN",{});var Yo=a(uo);T(Te.$$.fragment,Yo),Yo.forEach(t),Xo.forEach(t),Wt=m(Ge),_o=s(Ge,"SPAN",{});var Qo=a(_o);jt=d(Qo,"Overview"),Qo.forEach(t),Ge.forEach(t),nt=m(o),oe=s(o,"P",{});var vt=a(oe);St=d(vt,"The IDEFICS model was proposed in "),Ie=s(vt,"A",{href:!0,rel:!0});var Gs=a(Ie);Zt=d(Gs,"OBELICS: An Open Web-Scale Filtered Dataset of Interleaved Image-Text Documents"),Gs.forEach(t),At=d(vt," by Hugo Lauren\xE7on, Lucile Saulnier, L\xE9o Tronchon, Stas Bekman, Amanpreet Singh, Anton Lozhkov, Thomas Wang, Siddharth Karamcheti, Alexander M. Rush, Douwe Kiela, Matthieu Cord, Victor Sanh"),vt.forEach(t),st=m(o),Ye=s(o,"P",{});var Xs=a(Ye);Rt=d(Xs,"The abstract from the paper is the following:"),Xs.forEach(t),at=m(o),Qe=s(o,"P",{});var Ys=a(Qe);bo=s(Ys,"EM",{});var Qs=a(bo);Vt=d(Qs,"Large multimodal models trained on natural documents, which interleave images and text, outperform models trained on image-text pairs on various multimodal benchmarks that require reasoning over one or multiple images to generate a text. However, the datasets used to train these models have not been released, and the collection process has not been fully specified. We introduce the OBELICS dataset, an open web-scale filtered dataset of interleaved image-text documents comprising 141 million web pages extracted from Common Crawl, 353 million associated images, and 115 billion text tokens. We describe the dataset creation process, present comprehensive filtering rules, and provide an analysis of the dataset\u2019s content. To show the viability of OBELISC, we train an 80 billion parameters vision and language model on the dataset and obtain competitive performance on various multimodal benchmarks. We release the code to reproduce the dataset along with the dataset itself."),Qs.forEach(t),Ys.forEach(t),rt=m(o),te=s(o,"P",{});var yt=a(te);Bt=d(yt,"This model was contributed by "),we=s(yt,"A",{href:!0,rel:!0});var Ks=a(we);Dt=d(Ks,"HuggingFaceM4"),Ks.forEach(t),Lt=d(yt,". The original code can be found [here](<INSERT LINK TO GITHUB REPO HERE>). (TODO: don\u2019t have a public link yet)."),yt.forEach(t),it=m(o),T(ne.$$.fragment,o),dt=m(o),B=s(o,"H2",{class:!0});var Tt=a(B);se=s(Tt,"A",{id:!0,class:!0,href:!0});var ea=a(se);vo=s(ea,"SPAN",{});var oa=a(vo);T(Me.$$.fragment,oa),oa.forEach(t),ea.forEach(t),Ot=m(Tt),yo=s(Tt,"SPAN",{});var ta=a(yo);Ht=d(ta,"IdeficsConfig"),ta.forEach(t),Tt.forEach(t),lt=m(o),U=s(o,"DIV",{class:!0});var R=a(U);T(ke.$$.fragment,R),qt=m(R),$e=s(R,"P",{});var It=a($e);Gt=d(It,"This is the configuration class to store the configuration of a "),Ke=s(It,"A",{href:!0});var na=a(Ke);Xt=d(na,"IdeficsModel"),na.forEach(t),Yt=d(It,`. It is used to instantiate an
Idefics 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 Idefics-9B.`),It.forEach(t),Qt=m(R),eo=s(R,"P",{});var Os=a(eo);Kt=d(Os,"e.g. "),xe=s(Os,"A",{href:!0,rel:!0});var sa=a(xe);en=d(sa,"HuggingFaceM4/idefics-9b"),sa.forEach(t),Os.forEach(t),on=m(R),D=s(R,"P",{});var co=a(D);tn=d(co,"Configuration objects inherit from "),oo=s(co,"A",{href:!0});var aa=a(oo);nn=d(aa,"PretrainedConfig"),aa.forEach(t),sn=d(co,` and can be used to control the model outputs. Read the
documentation from `),to=s(co,"A",{href:!0});var ra=a(to);an=d(ra,"PretrainedConfig"),ra.forEach(t),rn=d(co," for more information."),co.forEach(t),dn=m(R),T(ae.$$.fragment,R),R.forEach(t),ct=m(o),L=s(o,"H2",{class:!0});var wt=a(L);re=s(wt,"A",{id:!0,class:!0,href:!0});var ia=a(re);To=s(ia,"SPAN",{});var da=a(To);T(ze.$$.fragment,da),da.forEach(t),ia.forEach(t),ln=m(wt),Io=s(wt,"SPAN",{});var la=a(Io);cn=d(la,"IdeficsModel"),la.forEach(t),wt.forEach(t),mt=m(o),P=s(o,"DIV",{class:!0});var V=a(P);T(Ee.$$.fragment,V),mn=m(V),Ce=s(V,"P",{});var Mt=a(Ce);pn=d(Mt,`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from `),no=s(Mt,"A",{href:!0});var ca=a(no);fn=d(ca,"PreTrainedModel"),ca.forEach(t),hn=d(Mt,`. 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.)`),Mt.forEach(t),gn=m(V),Ue=s(V,"P",{});var kt=a(Ue);un=d(kt,"This model is also a PyTorch "),Pe=s(kt,"A",{href:!0,rel:!0});var ma=a(Pe);_n=d(ma,"torch.nn.Module"),ma.forEach(t),bn=d(kt,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),kt.forEach(t),vn=m(V),ie=s(V,"P",{});var Ko=a(ie);yn=d(Ko,"Transformer decoder consisting of "),wo=s(Ko,"CODE",{});var pa=a(wo);Tn=d(pa,"config.num_hidden_layers"),pa.forEach(t),In=d(Ko," layers. Each layer is a "),Mo=s(Ko,"CODE",{});var fa=a(Mo);wn=d(fa,"IdeficsDecoderLayer"),fa.forEach(t),Ko.forEach(t),Mn=m(V),A=s(V,"DIV",{class:!0});var mo=a(A);T(Ne.$$.fragment,mo),kn=m(mo),O=s(mo,"P",{});var po=a(O);$n=d(po,"The "),so=s(po,"A",{href:!0});var ha=a(so);xn=d(ha,"IdeficsModel"),ha.forEach(t),zn=d(po," forward method, overrides the "),ko=s(po,"CODE",{});var ga=a(ko);En=d(ga,"__call__"),ga.forEach(t),Cn=d(po," special method."),po.forEach(t),Un=m(mo),T(de.$$.fragment,mo),mo.forEach(t),V.forEach(t),pt=m(o),H=s(o,"H2",{class:!0});var $t=a(H);le=s($t,"A",{id:!0,class:!0,href:!0});var ua=a(le);$o=s(ua,"SPAN",{});var _a=a($o);T(Je.$$.fragment,_a),_a.forEach(t),ua.forEach(t),Pn=m($t),xo=s($t,"SPAN",{});var ba=a(xo);Nn=d(ba,"IdeficsForVisionText2Text"),ba.forEach(t),$t.forEach(t),ft=m(o),q=s(o,"DIV",{class:!0});var xt=a(q);T(Fe.$$.fragment,xt),Jn=m(xt),j=s(xt,"DIV",{class:!0});var ve=a(j);T(We.$$.fragment,ve),Fn=m(ve),G=s(ve,"P",{});var fo=a(G);Wn=d(fo,"The "),ao=s(fo,"A",{href:!0});var va=a(ao);jn=d(va,"IdeficsForVisionText2Text"),va.forEach(t),Sn=d(fo," forward method, overrides the "),zo=s(fo,"CODE",{});var ya=a(zo);Zn=d(ya,"__call__"),ya.forEach(t),An=d(fo," special method."),fo.forEach(t),Rn=m(ve),T(ce.$$.fragment,ve),Vn=m(ve),T(me.$$.fragment,ve),ve.forEach(t),xt.forEach(t),ht=m(o),X=s(o,"H2",{class:!0});var zt=a(X);pe=s(zt,"A",{id:!0,class:!0,href:!0});var Ta=a(pe);Eo=s(Ta,"SPAN",{});var Ia=a(Eo);T(je.$$.fragment,Ia),Ia.forEach(t),Ta.forEach(t),Bn=m(zt),Co=s(zt,"SPAN",{});var wa=a(Co);Dn=d(wa,"IdeficsImageProcessor"),wa.forEach(t),zt.forEach(t),gt=m(o),S=s(o,"DIV",{class:!0});var ho=a(S);T(Se.$$.fragment,ho),Ln=m(ho),Uo=s(ho,"P",{});var Ma=a(Uo);On=d(Ma,"Constructs a Idefics image processor."),Ma.forEach(t),Hn=m(ho),fe=s(ho,"DIV",{class:!0});var Et=a(fe);T(Ze.$$.fragment,Et),qn=m(Et),Po=s(Et,"P",{});var ka=a(Po);Gn=d(ka,"Preprocess a batch of images."),ka.forEach(t),Et.forEach(t),ho.forEach(t),ut=m(o),Y=s(o,"H2",{class:!0});var Ct=a(Y);he=s(Ct,"A",{id:!0,class:!0,href:!0});var $a=a(he);No=s($a,"SPAN",{});var xa=a(No);T(Ae.$$.fragment,xa),xa.forEach(t),$a.forEach(t),Xn=m(Ct),Jo=s(Ct,"SPAN",{});var za=a(Jo);Yn=d(za,"IdeficsProcessor"),za.forEach(t),Ct.forEach(t),_t=m(o),F=s(o,"DIV",{class:!0});var ye=a(F);T(Re.$$.fragment,ye),Qn=m(ye),Fo=s(ye,"P",{});var Ea=a(Fo);Kn=d(Ea,"Constructs a IDEFICS processor which wraps a LLama tokenizer and IDEFICS image processor into a single processor."),Ea.forEach(t),es=m(ye),N=s(ye,"P",{});var Z=a(N);ro=s(Z,"A",{href:!0});var Ca=a(ro);os=d(Ca,"IdeficsProcessor"),Ca.forEach(t),ts=d(Z," offers all the functionalities of "),io=s(Z,"A",{href:!0});var Ua=a(io);ns=d(Ua,"IdeficsImageProcessor"),Ua.forEach(t),ss=d(Z," and "),lo=s(Z,"A",{href:!0});var Pa=a(lo);as=d(Pa,"LlamaTokenizerFast"),Pa.forEach(t),rs=d(Z,`. See
the docstring of `),Ve=s(Z,"A",{href:!0});var Hs=a(Ve);Wo=s(Hs,"STRONG",{});var Na=a(Wo);is=d(Na,"call"),Na.forEach(t),ds=d(Hs,"()"),Hs.forEach(t),ls=d(Z," and "),jo=s(Z,"CODE",{});var Ja=a(jo);cs=d(Ja,"decode()"),Ja.forEach(t),ms=d(Z," for more information."),Z.forEach(t),ps=m(ye),$=s(ye,"DIV",{class:!0});var x=a($);T(Be.$$.fragment,x),fs=m(x),So=s(x,"P",{});var Fa=a(So);hs=d(Fa,`This method takes batched or non-batched prompts made of text and images and converts them into prompts that
the model was trained on and prepares the image pixel values for the model to process.`),Fa.forEach(t),gs=m(x),Zo=s(x,"P",{});var Wa=a(Zo);us=d(Wa,"Detailed explanation:"),Wa.forEach(t),_s=m(x),De=s(x,"P",{});var Ut=a(De);bs=d(Ut,"Each entry in "),Ao=s(Ut,"CODE",{});var ja=a(Ao);vs=d(ja,"prompts"),ja.forEach(t),ys=d(Ut," is either a text to be passed as is or an image that will be processed."),Ut.forEach(t),Ts=m(x),Le=s(x,"P",{});var Pt=a(Le);Is=d(Pt,"An image can be either an image object ("),Ro=s(Pt,"CODE",{});var Sa=a(Ro);ws=d(Sa,"PIL.Image"),Sa.forEach(t),Ms=d(Pt,") or a url from which the image can be retrieved."),Pt.forEach(t),ks=m(x),Oe=s(x,"P",{});var Nt=a(Oe);$s=d(Nt,"When the processor encounters an image it\u2019ll inject "),Vo=s(Nt,"CODE",{});var Za=a(Vo);xs=d(Za,"<fake_token_around_image><image><fake_token_around_image>"),Za.forEach(t),zs=d(Nt,`
entry into the prompt.`),Nt.forEach(t),Es=m(x),T(ge.$$.fragment,x),Cs=m(x),T(ue.$$.fragment,x),Us=m(x),Q=s(x,"P",{});var go=a(Q);Ps=d(go,"and the two images will be massaged using "),_e=s(go,"A",{href:!0});var Jt=a(_e);Ns=d(Jt,"IdeficsImageProcessor."),Bo=s(Jt,"STRONG",{});var Aa=a(Bo);Js=d(Aa,"call"),Aa.forEach(t),Fs=d(Jt,"()"),Jt.forEach(t),Ws=d(go,` method and placed inside the
`),Do=s(go,"CODE",{});var Ra=a(Do);js=d(Ra,"pixel_values"),Ra.forEach(t),Ss=d(go," dict entry of the return value."),go.forEach(t),Zs=m(x),Lo=s(x,"P",{});var Va=a(Lo);As=d(Va,`This example also examplifies that images can be passed as objects or as text urls. It can be seen that the
first image is passed as object and the second one as a url.`),Va.forEach(t),Rs=m(x),T(be.$$.fragment,x),Vs=m(x),He=s(x,"P",{});var Ft=a(He);Bs=d(Ft,"In order to help debug prompt generation enable "),Oo=s(Ft,"CODE",{});var Ba=a(Oo);Ds=d(Ba,"debug=True"),Ba.forEach(t),Ls=d(Ft," which will show you what\u2019s happening."),Ft.forEach(t),x.forEach(t),ye.forEach(t),this.h()},h(){h(l,"name","hf:doc:metadata"),h(l,"content",JSON.stringify(sr)),h(f,"id","idefics"),h(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(f,"href","#idefics"),h(u,"class","relative group"),h(ee,"id","overview"),h(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(ee,"href","#overview"),h(W,"class","relative group"),h(Ie,"href","https://huggingface.co/papers/2306.16527"),h(Ie,"rel","nofollow"),h(we,"href","https://huggingface.co/HuggingFaceM4"),h(we,"rel","nofollow"),h(se,"id","transformers.IdeficsConfig"),h(se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(se,"href","#transformers.IdeficsConfig"),h(B,"class","relative group"),h(Ke,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsModel"),h(xe,"href","https://huggingface.co/HuggingFaceM4/idefics-9b"),h(xe,"rel","nofollow"),h(oo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(to,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(re,"id","transformers.IdeficsModel"),h(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(re,"href","#transformers.IdeficsModel"),h(L,"class","relative group"),h(no,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),h(Pe,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),h(Pe,"rel","nofollow"),h(so,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsModel"),h(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(le,"id","transformers.IdeficsForVisionText2Text"),h(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(le,"href","#transformers.IdeficsForVisionText2Text"),h(H,"class","relative group"),h(ao,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsForVisionText2Text"),h(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(pe,"id","transformers.IdeficsImageProcessor"),h(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(pe,"href","#transformers.IdeficsImageProcessor"),h(X,"class","relative group"),h(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(he,"id","transformers.IdeficsProcessor"),h(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),h(he,"href","#transformers.IdeficsProcessor"),h(Y,"class","relative group"),h(ro,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsProcessor"),h(io,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsImageProcessor"),h(lo,"href","/docs/transformers/main/en/model_doc/llama2#transformers.LlamaTokenizerFast"),h(Ve,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsProcessor.__call__"),h(_e,"href","/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__"),h($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,l),_(o,v,g),_(o,u,g),e(u,f),e(f,b),I(r,b,null),e(u,p),e(u,z),e(z,E),_(o,J,g),_(o,W,g),e(W,ee),e(ee,uo),I(Te,uo,null),e(W,Wt),e(W,_o),e(_o,jt),_(o,nt,g),_(o,oe,g),e(oe,St),e(oe,Ie),e(Ie,Zt),e(oe,At),_(o,st,g),_(o,Ye,g),e(Ye,Rt),_(o,at,g),_(o,Qe,g),e(Qe,bo),e(bo,Vt),_(o,rt,g),_(o,te,g),e(te,Bt),e(te,we),e(we,Dt),e(te,Lt),_(o,it,g),I(ne,o,g),_(o,dt,g),_(o,B,g),e(B,se),e(se,vo),I(Me,vo,null),e(B,Ot),e(B,yo),e(yo,Ht),_(o,lt,g),_(o,U,g),I(ke,U,null),e(U,qt),e(U,$e),e($e,Gt),e($e,Ke),e(Ke,Xt),e($e,Yt),e(U,Qt),e(U,eo),e(eo,Kt),e(eo,xe),e(xe,en),e(U,on),e(U,D),e(D,tn),e(D,oo),e(oo,nn),e(D,sn),e(D,to),e(to,an),e(D,rn),e(U,dn),I(ae,U,null),_(o,ct,g),_(o,L,g),e(L,re),e(re,To),I(ze,To,null),e(L,ln),e(L,Io),e(Io,cn),_(o,mt,g),_(o,P,g),I(Ee,P,null),e(P,mn),e(P,Ce),e(Ce,pn),e(Ce,no),e(no,fn),e(Ce,hn),e(P,gn),e(P,Ue),e(Ue,un),e(Ue,Pe),e(Pe,_n),e(Ue,bn),e(P,vn),e(P,ie),e(ie,yn),e(ie,wo),e(wo,Tn),e(ie,In),e(ie,Mo),e(Mo,wn),e(P,Mn),e(P,A),I(Ne,A,null),e(A,kn),e(A,O),e(O,$n),e(O,so),e(so,xn),e(O,zn),e(O,ko),e(ko,En),e(O,Cn),e(A,Un),I(de,A,null),_(o,pt,g),_(o,H,g),e(H,le),e(le,$o),I(Je,$o,null),e(H,Pn),e(H,xo),e(xo,Nn),_(o,ft,g),_(o,q,g),I(Fe,q,null),e(q,Jn),e(q,j),I(We,j,null),e(j,Fn),e(j,G),e(G,Wn),e(G,ao),e(ao,jn),e(G,Sn),e(G,zo),e(zo,Zn),e(G,An),e(j,Rn),I(ce,j,null),e(j,Vn),I(me,j,null),_(o,ht,g),_(o,X,g),e(X,pe),e(pe,Eo),I(je,Eo,null),e(X,Bn),e(X,Co),e(Co,Dn),_(o,gt,g),_(o,S,g),I(Se,S,null),e(S,Ln),e(S,Uo),e(Uo,On),e(S,Hn),e(S,fe),I(Ze,fe,null),e(fe,qn),e(fe,Po),e(Po,Gn),_(o,ut,g),_(o,Y,g),e(Y,he),e(he,No),I(Ae,No,null),e(Y,Xn),e(Y,Jo),e(Jo,Yn),_(o,_t,g),_(o,F,g),I(Re,F,null),e(F,Qn),e(F,Fo),e(Fo,Kn),e(F,es),e(F,N),e(N,ro),e(ro,os),e(N,ts),e(N,io),e(io,ns),e(N,ss),e(N,lo),e(lo,as),e(N,rs),e(N,Ve),e(Ve,Wo),e(Wo,is),e(Ve,ds),e(N,ls),e(N,jo),e(jo,cs),e(N,ms),e(F,ps),e(F,$),I(Be,$,null),e($,fs),e($,So),e(So,hs),e($,gs),e($,Zo),e(Zo,us),e($,_s),e($,De),e(De,bs),e(De,Ao),e(Ao,vs),e(De,ys),e($,Ts),e($,Le),e(Le,Is),e(Le,Ro),e(Ro,ws),e(Le,Ms),e($,ks),e($,Oe),e(Oe,$s),e(Oe,Vo),e(Vo,xs),e(Oe,zs),e($,Es),I(ge,$,null),e($,Cs),I(ue,$,null),e($,Us),e($,Q),e(Q,Ps),e(Q,_e),e(_e,Ns),e(_e,Bo),e(Bo,Js),e(_e,Fs),e(Q,Ws),e(Q,Do),e(Do,js),e(Q,Ss),e($,Zs),e($,Lo),e(Lo,As),e($,Rs),I(be,$,null),e($,Vs),e($,He),e(He,Bs),e(He,Oo),e(Oo,Ds),e(He,Ls),bt=!0},p(o,[g]){const qe={};g&2&&(qe.$$scope={dirty:g,ctx:o}),ne.$set(qe);const Ho={};g&2&&(Ho.$$scope={dirty:g,ctx:o}),ae.$set(Ho);const qo={};g&2&&(qo.$$scope={dirty:g,ctx:o}),de.$set(qo);const Go={};g&2&&(Go.$$scope={dirty:g,ctx:o}),ce.$set(Go);const Ge={};g&2&&(Ge.$$scope={dirty:g,ctx:o}),me.$set(Ge);const Xo={};g&2&&(Xo.$$scope={dirty:g,ctx:o}),ge.$set(Xo);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:o}),ue.$set(Yo);const Qo={};g&2&&(Qo.$$scope={dirty:g,ctx:o}),be.$set(Qo)},i(o){bt||(w(r.$$.fragment,o),w(Te.$$.fragment,o),w(ne.$$.fragment,o),w(Me.$$.fragment,o),w(ke.$$.fragment,o),w(ae.$$.fragment,o),w(ze.$$.fragment,o),w(Ee.$$.fragment,o),w(Ne.$$.fragment,o),w(de.$$.fragment,o),w(Je.$$.fragment,o),w(Fe.$$.fragment,o),w(We.$$.fragment,o),w(ce.$$.fragment,o),w(me.$$.fragment,o),w(je.$$.fragment,o),w(Se.$$.fragment,o),w(Ze.$$.fragment,o),w(Ae.$$.fragment,o),w(Re.$$.fragment,o),w(Be.$$.fragment,o),w(ge.$$.fragment,o),w(ue.$$.fragment,o),w(be.$$.fragment,o),bt=!0)},o(o){M(r.$$.fragment,o),M(Te.$$.fragment,o),M(ne.$$.fragment,o),M(Me.$$.fragment,o),M(ke.$$.fragment,o),M(ae.$$.fragment,o),M(ze.$$.fragment,o),M(Ee.$$.fragment,o),M(Ne.$$.fragment,o),M(de.$$.fragment,o),M(Je.$$.fragment,o),M(Fe.$$.fragment,o),M(We.$$.fragment,o),M(ce.$$.fragment,o),M(me.$$.fragment,o),M(je.$$.fragment,o),M(Se.$$.fragment,o),M(Ze.$$.fragment,o),M(Ae.$$.fragment,o),M(Re.$$.fragment,o),M(Be.$$.fragment,o),M(ge.$$.fragment,o),M(ue.$$.fragment,o),M(be.$$.fragment,o),bt=!1},d(o){t(l),o&&t(v),o&&t(u),k(r),o&&t(J),o&&t(W),k(Te),o&&t(nt),o&&t(oe),o&&t(st),o&&t(Ye),o&&t(at),o&&t(Qe),o&&t(rt),o&&t(te),o&&t(it),k(ne,o),o&&t(dt),o&&t(B),k(Me),o&&t(lt),o&&t(U),k(ke),k(ae),o&&t(ct),o&&t(L),k(ze),o&&t(mt),o&&t(P),k(Ee),k(Ne),k(de),o&&t(pt),o&&t(H),k(Je),o&&t(ft),o&&t(q),k(Fe),k(We),k(ce),k(me),o&&t(ht),o&&t(X),k(je),o&&t(gt),o&&t(S),k(Se),k(Ze),o&&t(ut),o&&t(Y),k(Ae),o&&t(_t),o&&t(F),k(Re),k(Be),k(ge),k(ue),k(be)}}}const sr={local:"idefics",sections:[{local:"overview",title:"Overview"},{local:"transformers.IdeficsConfig",title:"IdeficsConfig"},{local:"transformers.IdeficsModel",title:"IdeficsModel"},{local:"transformers.IdeficsForVisionText2Text",title:"IdeficsForVisionText2Text"},{local:"transformers.IdeficsImageProcessor",title:"IdeficsImageProcessor"},{local:"transformers.IdeficsProcessor",title:"IdeficsProcessor"}],title:"IDEFICS"};function ar(C){return qa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pr extends Da{constructor(l){super();La(this,l,ar,nr,Oa,{})}}export{pr as default,sr as metadata};
