import{S as Ha,i as Ga,s as Xa,e as n,k as c,w as y,t as i,M as Ya,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 nt}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ys}from"../../chunks/Tip-hf-doc-builder.js";import{D as ee}from"../../chunks/Docstring-hf-doc-builder.js";import{C as st}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Xe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as tt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ka(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 er(C){let l,v,u,f,b;return f=new st({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:nt,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;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 tr(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 nr(C){let l,v,u,f,b;return f=new st({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBJZGVmaWNzRm9yVmlzaW9uVGV4dDJUZXh0JTBBJTBBbW9kZWwlMjAlM0QlMjBJZGVmaWNzRm9yVmlzaW9uVGV4dDJUZXh0LmZyb21fcHJldHJhaW5lZChQQVRIX1RPX0NPTlZFUlRFRF9XRUlHSFRTKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKFBBVEhfVE9fQ09OVkVSVEVEX1RPS0VOSVpFUiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJIZXklMkMlMjBhcmUlMjB5b3UlMjBjb25zY2lvdXJzJTNGJTIwQ2FuJTIweW91JTIwdGFsayUyMHRvJTIwbWUlM0YlMjIlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocHJvbXB0JTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEElMjMlMjBHZW5lcmF0ZSUwQWdlbmVyYXRlX2lkcyUyMCUzRCUyMG1vZGVsLmdlbmVyYXRlKGlucHV0cy5pbnB1dF9pZHMlMkMlMjBtYXhfbGVuZ3RoJTNEMzApJTBBdG9rZW5pemVyLmJhdGNoX2RlY29kZShnZW5lcmF0ZV9pZHMlMkMlMjBza2lwX3NwZWNpYWxfdG9rZW5zJTNEVHJ1ZSUyQyUyMGNsZWFuX3VwX3Rva2VuaXphdGlvbl9zcGFjZXMlM0RGYWxzZSklNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, IdeficsForVisionText2Text

<span class="hljs-meta">&gt;&gt;&gt; </span>model = IdeficsForVisionText2Text.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:nt,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 sr(C){let l,v,u,f,b;return f=new st({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:nt,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 ar(C){let l,v,u,f,b,r,p,z;return p=new st({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 N=a(l);v=d(N,"In this example the "),u=s(N,"CODE",{});var W=a(u);f=d(W,"prompts"),W.forEach(t),b=d(N," will be converted into:"),N.forEach(t),r=m(E),T(p.$$.fragment,E)},m(E,N){_(E,l,N),e(l,v),e(l,u),e(u,f),e(l,b),_(E,r,N),I(p,E,N),z=!0},p:nt,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 rr(C){let l,v,u,f,b;return f=new st({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:nt,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 ir(C){let l,v,u,f,b,r,p,z,E,N,W,oe,bo,Te,jt,vo,St,at,te,Zt,Ie,At,Vt,rt,Ye,Rt,it,Qe,yo,Bt,dt,A,Dt,we,Lt,Ot,Ke,qt,Ht,lt,ne,ct,D,se,To,Me,Gt,Io,Xt,mt,U,ke,Yt,$e,Qt,eo,Kt,en,on,oo,tn,xe,nn,sn,L,an,to,rn,dn,no,ln,cn,mn,ae,pt,O,re,wo,ze,pn,Mo,fn,ft,P,Ee,hn,Ce,gn,so,un,_n,bn,Ue,vn,Pe,yn,Tn,In,ie,wn,ko,Mn,kn,$o,$n,xn,V,Je,zn,q,En,ao,Cn,Un,xo,Pn,Jn,Nn,de,ht,H,le,zo,Ne,Fn,Eo,Wn,gt,G,Fe,jn,j,We,Sn,X,Zn,ro,An,Vn,Co,Rn,Bn,Dn,ce,Ln,me,ut,Y,pe,Uo,je,On,Po,qn,_t,S,Se,Hn,Jo,Gn,Xn,fe,Ze,Yn,No,Qn,bt,Q,he,Fo,Ae,Kn,Wo,es,vt,F,Ve,os,jo,ts,ns,J,io,ss,as,lo,rs,is,co,ds,ls,Re,So,cs,ms,ps,Zo,fs,hs,gs,$,Be,us,Ao,_s,bs,Vo,vs,ys,De,Ts,Ro,Is,ws,Ms,Le,ks,Bo,$s,xs,zs,Oe,Es,Do,Cs,Us,Ps,ge,Js,ue,Ns,K,Fs,_e,Ws,Lo,js,Ss,Zs,Oo,As,Vs,Rs,qo,Bs,Ds,be,Ls,qe,Os,Ho,qs,Hs,yt;return r=new Xe({}),Te=new Xe({}),ne=new Ys({props:{warning:!0,$$slots:{default:[Ka]},$$scope:{ctx:C}}}),Me=new Xe({}),ke=new ee({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 tt({props:{anchor:"transformers.IdeficsConfig.example",$$slots:{default:[er]},$$scope:{ctx:C}}}),ze=new Xe({}),Ee=new ee({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"}}),Je=new ee({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 Ys({props:{$$slots:{default:[or]},$$scope:{ctx:C}}}),Ne=new Xe({}),Fe=new ee({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 ee({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 Ys({props:{$$slots:{default:[tr]},$$scope:{ctx:C}}}),me=new tt({props:{anchor:"transformers.IdeficsForVisionText2Text.forward.example",$$slots:{default:[nr]},$$scope:{ctx:C}}}),je=new Xe({}),Se=new ee({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 ee({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({}),Ve=new ee({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 ee({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 tt({props:{anchor:"transformers.IdeficsProcessor.__call__.example",$$slots:{default:[sr]},$$scope:{ctx:C}}}),ue=new tt({props:{anchor:"transformers.IdeficsProcessor.__call__.example-2",$$slots:{default:[ar]},$$scope:{ctx:C}}}),be=new tt({props:{anchor:"transformers.IdeficsProcessor.__call__.example-3",$$slots:{default:[rr]},$$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"),N=c(),W=n("h2"),oe=n("a"),bo=n("span"),y(Te.$$.fragment),jt=c(),vo=n("span"),St=i("Overview"),at=c(),te=n("p"),Zt=i("The IDEFICS model was proposed in "),Ie=n("a"),At=i("OBELICS: An Open Web-Scale Filtered Dataset of Interleaved Image-Text Documents"),Vt=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"),rt=c(),Ye=n("p"),Rt=i("The abstract from the paper is the following:"),it=c(),Qe=n("p"),yo=n("em"),Bt=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."),dt=c(),A=n("p"),Dt=i("This model was contributed by "),we=n("a"),Lt=i("HuggingFaceM4"),Ot=i(". The original code can be found "),Ke=n("a"),qt=i("here"),Ht=i(". (TODO: don\u2019t have a public link yet)."),lt=c(),y(ne.$$.fragment),ct=c(),D=n("h2"),se=n("a"),To=n("span"),y(Me.$$.fragment),Gt=c(),Io=n("span"),Xt=i("IdeficsConfig"),mt=c(),U=n("div"),y(ke.$$.fragment),Yt=c(),$e=n("p"),Qt=i("This is the configuration class to store the configuration of a "),eo=n("a"),Kt=i("IdeficsModel"),en=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.`),on=c(),oo=n("p"),tn=i("e.g. "),xe=n("a"),nn=i("HuggingFaceM4/idefics-9b"),sn=c(),L=n("p"),an=i("Configuration objects inherit from "),to=n("a"),rn=i("PretrainedConfig"),dn=i(` and can be used to control the model outputs. Read the
documentation from `),no=n("a"),ln=i("PretrainedConfig"),cn=i(" for more information."),mn=c(),y(ae.$$.fragment),pt=c(),O=n("h2"),re=n("a"),wo=n("span"),y(ze.$$.fragment),pn=c(),Mo=n("span"),fn=i("IdeficsModel"),ft=c(),P=n("div"),y(Ee.$$.fragment),hn=c(),Ce=n("p"),gn=i(`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from `),so=n("a"),un=i("PreTrainedModel"),_n=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.)`),bn=c(),Ue=n("p"),vn=i("This model is also a PyTorch "),Pe=n("a"),yn=i("torch.nn.Module"),Tn=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),In=c(),ie=n("p"),wn=i("Transformer decoder consisting of "),ko=n("code"),Mn=i("config.num_hidden_layers"),kn=i(" layers. Each layer is a "),$o=n("code"),$n=i("IdeficsDecoderLayer"),xn=c(),V=n("div"),y(Je.$$.fragment),zn=c(),q=n("p"),En=i("The "),ao=n("a"),Cn=i("IdeficsModel"),Un=i(" forward method, overrides the "),xo=n("code"),Pn=i("__call__"),Jn=i(" special method."),Nn=c(),y(de.$$.fragment),ht=c(),H=n("h2"),le=n("a"),zo=n("span"),y(Ne.$$.fragment),Fn=c(),Eo=n("span"),Wn=i("IdeficsForVisionText2Text"),gt=c(),G=n("div"),y(Fe.$$.fragment),jn=c(),j=n("div"),y(We.$$.fragment),Sn=c(),X=n("p"),Zn=i("The "),ro=n("a"),An=i("IdeficsForVisionText2Text"),Vn=i(" forward method, overrides the "),Co=n("code"),Rn=i("__call__"),Bn=i(" special method."),Dn=c(),y(ce.$$.fragment),Ln=c(),y(me.$$.fragment),ut=c(),Y=n("h2"),pe=n("a"),Uo=n("span"),y(je.$$.fragment),On=c(),Po=n("span"),qn=i("IdeficsImageProcessor"),_t=c(),S=n("div"),y(Se.$$.fragment),Hn=c(),Jo=n("p"),Gn=i("Constructs a Idefics image processor."),Xn=c(),fe=n("div"),y(Ze.$$.fragment),Yn=c(),No=n("p"),Qn=i("Preprocess a batch of images."),bt=c(),Q=n("h2"),he=n("a"),Fo=n("span"),y(Ae.$$.fragment),Kn=c(),Wo=n("span"),es=i("IdeficsProcessor"),vt=c(),F=n("div"),y(Ve.$$.fragment),os=c(),jo=n("p"),ts=i("Constructs a IDEFICS processor which wraps a LLama tokenizer and IDEFICS image processor into a single processor."),ns=c(),J=n("p"),io=n("a"),ss=i("IdeficsProcessor"),as=i(" offers all the functionalities of "),lo=n("a"),rs=i("IdeficsImageProcessor"),is=i(" and "),co=n("a"),ds=i("LlamaTokenizerFast"),ls=i(`. See
the docstring of `),Re=n("a"),So=n("strong"),cs=i("call"),ms=i("()"),ps=i(" and "),Zo=n("code"),fs=i("decode()"),hs=i(" for more information."),gs=c(),$=n("div"),y(Be.$$.fragment),us=c(),Ao=n("p"),_s=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.`),bs=c(),Vo=n("p"),vs=i("Detailed explanation:"),ys=c(),De=n("p"),Ts=i("Each entry in "),Ro=n("code"),Is=i("prompts"),ws=i(" is either a text to be passed as is or an image that will be processed."),Ms=c(),Le=n("p"),ks=i("An image can be either an image object ("),Bo=n("code"),$s=i("PIL.Image"),xs=i(") or a url from which the image can be retrieved."),zs=c(),Oe=n("p"),Es=i("When the processor encounters an image it\u2019ll inject "),Do=n("code"),Cs=i("<fake_token_around_image><image><fake_token_around_image>"),Us=i(`
entry into the prompt.`),Ps=c(),y(ge.$$.fragment),Js=c(),y(ue.$$.fragment),Ns=c(),K=n("p"),Fs=i("and the two images will be massaged using "),_e=n("a"),Ws=i("IdeficsImageProcessor."),Lo=n("strong"),js=i("call"),Ss=i("()"),Zs=i(` method and placed inside the
`),Oo=n("code"),As=i("pixel_values"),Vs=i(" dict entry of the return value."),Rs=c(),qo=n("p"),Bs=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.`),Ds=c(),y(be.$$.fragment),Ls=c(),qe=n("p"),Os=i("In order to help debug prompt generation enable "),Ho=n("code"),qs=i("debug=True"),Hs=i(" which will show you what\u2019s happening."),this.h()},l(o){const g=Ya('[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 He=a(u);f=s(He,"A",{id:!0,class:!0,href:!0});var Go=a(f);b=s(Go,"SPAN",{});var Xo=a(b);T(r.$$.fragment,Xo),Xo.forEach(t),Go.forEach(t),p=m(He),z=s(He,"SPAN",{});var Yo=a(z);E=d(Yo,"IDEFICS"),Yo.forEach(t),He.forEach(t),N=m(o),W=s(o,"H2",{class:!0});var Ge=a(W);oe=s(Ge,"A",{id:!0,class:!0,href:!0});var Qo=a(oe);bo=s(Qo,"SPAN",{});var Ko=a(bo);T(Te.$$.fragment,Ko),Ko.forEach(t),Qo.forEach(t),jt=m(Ge),vo=s(Ge,"SPAN",{});var et=a(vo);St=d(et,"Overview"),et.forEach(t),Ge.forEach(t),at=m(o),te=s(o,"P",{});var Tt=a(te);Zt=d(Tt,"The IDEFICS model was proposed in "),Ie=s(Tt,"A",{href:!0,rel:!0});var Qs=a(Ie);At=d(Qs,"OBELICS: An Open Web-Scale Filtered Dataset of Interleaved Image-Text Documents"),Qs.forEach(t),Vt=d(Tt," 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"),Tt.forEach(t),rt=m(o),Ye=s(o,"P",{});var Ks=a(Ye);Rt=d(Ks,"The abstract from the paper is the following:"),Ks.forEach(t),it=m(o),Qe=s(o,"P",{});var ea=a(Qe);yo=s(ea,"EM",{});var oa=a(yo);Bt=d(oa,"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."),oa.forEach(t),ea.forEach(t),dt=m(o),A=s(o,"P",{});var mo=a(A);Dt=d(mo,"This model was contributed by "),we=s(mo,"A",{href:!0,rel:!0});var ta=a(we);Lt=d(ta,"HuggingFaceM4"),ta.forEach(t),Ot=d(mo,". The original code can be found "),Ke=s(mo,"A",{href:!0});var na=a(Ke);qt=d(na,"here"),na.forEach(t),Ht=d(mo,". (TODO: don\u2019t have a public link yet)."),mo.forEach(t),lt=m(o),T(ne.$$.fragment,o),ct=m(o),D=s(o,"H2",{class:!0});var It=a(D);se=s(It,"A",{id:!0,class:!0,href:!0});var sa=a(se);To=s(sa,"SPAN",{});var aa=a(To);T(Me.$$.fragment,aa),aa.forEach(t),sa.forEach(t),Gt=m(It),Io=s(It,"SPAN",{});var ra=a(Io);Xt=d(ra,"IdeficsConfig"),ra.forEach(t),It.forEach(t),mt=m(o),U=s(o,"DIV",{class:!0});var R=a(U);T(ke.$$.fragment,R),Yt=m(R),$e=s(R,"P",{});var wt=a($e);Qt=d(wt,"This is the configuration class to store the configuration of a "),eo=s(wt,"A",{href:!0});var ia=a(eo);Kt=d(ia,"IdeficsModel"),ia.forEach(t),en=d(wt,`. 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.`),wt.forEach(t),on=m(R),oo=s(R,"P",{});var Gs=a(oo);tn=d(Gs,"e.g. "),xe=s(Gs,"A",{href:!0,rel:!0});var da=a(xe);nn=d(da,"HuggingFaceM4/idefics-9b"),da.forEach(t),Gs.forEach(t),sn=m(R),L=s(R,"P",{});var po=a(L);an=d(po,"Configuration objects inherit from "),to=s(po,"A",{href:!0});var la=a(to);rn=d(la,"PretrainedConfig"),la.forEach(t),dn=d(po,` and can be used to control the model outputs. Read the
documentation from `),no=s(po,"A",{href:!0});var ca=a(no);ln=d(ca,"PretrainedConfig"),ca.forEach(t),cn=d(po," for more information."),po.forEach(t),mn=m(R),T(ae.$$.fragment,R),R.forEach(t),pt=m(o),O=s(o,"H2",{class:!0});var Mt=a(O);re=s(Mt,"A",{id:!0,class:!0,href:!0});var ma=a(re);wo=s(ma,"SPAN",{});var pa=a(wo);T(ze.$$.fragment,pa),pa.forEach(t),ma.forEach(t),pn=m(Mt),Mo=s(Mt,"SPAN",{});var fa=a(Mo);fn=d(fa,"IdeficsModel"),fa.forEach(t),Mt.forEach(t),ft=m(o),P=s(o,"DIV",{class:!0});var B=a(P);T(Ee.$$.fragment,B),hn=m(B),Ce=s(B,"P",{});var kt=a(Ce);gn=d(kt,`The bare LLaMA Model outputting raw hidden-states without any specific head on top.
This model inherits from `),so=s(kt,"A",{href:!0});var ha=a(so);un=d(ha,"PreTrainedModel"),ha.forEach(t),_n=d(kt,`. 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.)`),kt.forEach(t),bn=m(B),Ue=s(B,"P",{});var $t=a(Ue);vn=d($t,"This model is also a PyTorch "),Pe=s($t,"A",{href:!0,rel:!0});var ga=a(Pe);yn=d(ga,"torch.nn.Module"),ga.forEach(t),Tn=d($t,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$t.forEach(t),In=m(B),ie=s(B,"P",{});var ot=a(ie);wn=d(ot,"Transformer decoder consisting of "),ko=s(ot,"CODE",{});var ua=a(ko);Mn=d(ua,"config.num_hidden_layers"),ua.forEach(t),kn=d(ot," layers. Each layer is a "),$o=s(ot,"CODE",{});var _a=a($o);$n=d(_a,"IdeficsDecoderLayer"),_a.forEach(t),ot.forEach(t),xn=m(B),V=s(B,"DIV",{class:!0});var fo=a(V);T(Je.$$.fragment,fo),zn=m(fo),q=s(fo,"P",{});var ho=a(q);En=d(ho,"The "),ao=s(ho,"A",{href:!0});var ba=a(ao);Cn=d(ba,"IdeficsModel"),ba.forEach(t),Un=d(ho," forward method, overrides the "),xo=s(ho,"CODE",{});var va=a(xo);Pn=d(va,"__call__"),va.forEach(t),Jn=d(ho," special method."),ho.forEach(t),Nn=m(fo),T(de.$$.fragment,fo),fo.forEach(t),B.forEach(t),ht=m(o),H=s(o,"H2",{class:!0});var xt=a(H);le=s(xt,"A",{id:!0,class:!0,href:!0});var ya=a(le);zo=s(ya,"SPAN",{});var Ta=a(zo);T(Ne.$$.fragment,Ta),Ta.forEach(t),ya.forEach(t),Fn=m(xt),Eo=s(xt,"SPAN",{});var Ia=a(Eo);Wn=d(Ia,"IdeficsForVisionText2Text"),Ia.forEach(t),xt.forEach(t),gt=m(o),G=s(o,"DIV",{class:!0});var zt=a(G);T(Fe.$$.fragment,zt),jn=m(zt),j=s(zt,"DIV",{class:!0});var ve=a(j);T(We.$$.fragment,ve),Sn=m(ve),X=s(ve,"P",{});var go=a(X);Zn=d(go,"The "),ro=s(go,"A",{href:!0});var wa=a(ro);An=d(wa,"IdeficsForVisionText2Text"),wa.forEach(t),Vn=d(go," forward method, overrides the "),Co=s(go,"CODE",{});var Ma=a(Co);Rn=d(Ma,"__call__"),Ma.forEach(t),Bn=d(go," special method."),go.forEach(t),Dn=m(ve),T(ce.$$.fragment,ve),Ln=m(ve),T(me.$$.fragment,ve),ve.forEach(t),zt.forEach(t),ut=m(o),Y=s(o,"H2",{class:!0});var Et=a(Y);pe=s(Et,"A",{id:!0,class:!0,href:!0});var ka=a(pe);Uo=s(ka,"SPAN",{});var $a=a(Uo);T(je.$$.fragment,$a),$a.forEach(t),ka.forEach(t),On=m(Et),Po=s(Et,"SPAN",{});var xa=a(Po);qn=d(xa,"IdeficsImageProcessor"),xa.forEach(t),Et.forEach(t),_t=m(o),S=s(o,"DIV",{class:!0});var uo=a(S);T(Se.$$.fragment,uo),Hn=m(uo),Jo=s(uo,"P",{});var za=a(Jo);Gn=d(za,"Constructs a Idefics image processor."),za.forEach(t),Xn=m(uo),fe=s(uo,"DIV",{class:!0});var Ct=a(fe);T(Ze.$$.fragment,Ct),Yn=m(Ct),No=s(Ct,"P",{});var Ea=a(No);Qn=d(Ea,"Preprocess a batch of images."),Ea.forEach(t),Ct.forEach(t),uo.forEach(t),bt=m(o),Q=s(o,"H2",{class:!0});var Ut=a(Q);he=s(Ut,"A",{id:!0,class:!0,href:!0});var Ca=a(he);Fo=s(Ca,"SPAN",{});var Ua=a(Fo);T(Ae.$$.fragment,Ua),Ua.forEach(t),Ca.forEach(t),Kn=m(Ut),Wo=s(Ut,"SPAN",{});var Pa=a(Wo);es=d(Pa,"IdeficsProcessor"),Pa.forEach(t),Ut.forEach(t),vt=m(o),F=s(o,"DIV",{class:!0});var ye=a(F);T(Ve.$$.fragment,ye),os=m(ye),jo=s(ye,"P",{});var Ja=a(jo);ts=d(Ja,"Constructs a IDEFICS processor which wraps a LLama tokenizer and IDEFICS image processor into a single processor."),Ja.forEach(t),ns=m(ye),J=s(ye,"P",{});var Z=a(J);io=s(Z,"A",{href:!0});var Na=a(io);ss=d(Na,"IdeficsProcessor"),Na.forEach(t),as=d(Z," offers all the functionalities of "),lo=s(Z,"A",{href:!0});var Fa=a(lo);rs=d(Fa,"IdeficsImageProcessor"),Fa.forEach(t),is=d(Z," and "),co=s(Z,"A",{href:!0});var Wa=a(co);ds=d(Wa,"LlamaTokenizerFast"),Wa.forEach(t),ls=d(Z,`. See
the docstring of `),Re=s(Z,"A",{href:!0});var Xs=a(Re);So=s(Xs,"STRONG",{});var ja=a(So);cs=d(ja,"call"),ja.forEach(t),ms=d(Xs,"()"),Xs.forEach(t),ps=d(Z," and "),Zo=s(Z,"CODE",{});var Sa=a(Zo);fs=d(Sa,"decode()"),Sa.forEach(t),hs=d(Z," for more information."),Z.forEach(t),gs=m(ye),$=s(ye,"DIV",{class:!0});var x=a($);T(Be.$$.fragment,x),us=m(x),Ao=s(x,"P",{});var Za=a(Ao);_s=d(Za,`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.`),Za.forEach(t),bs=m(x),Vo=s(x,"P",{});var Aa=a(Vo);vs=d(Aa,"Detailed explanation:"),Aa.forEach(t),ys=m(x),De=s(x,"P",{});var Pt=a(De);Ts=d(Pt,"Each entry in "),Ro=s(Pt,"CODE",{});var Va=a(Ro);Is=d(Va,"prompts"),Va.forEach(t),ws=d(Pt," is either a text to be passed as is or an image that will be processed."),Pt.forEach(t),Ms=m(x),Le=s(x,"P",{});var Jt=a(Le);ks=d(Jt,"An image can be either an image object ("),Bo=s(Jt,"CODE",{});var Ra=a(Bo);$s=d(Ra,"PIL.Image"),Ra.forEach(t),xs=d(Jt,") or a url from which the image can be retrieved."),Jt.forEach(t),zs=m(x),Oe=s(x,"P",{});var Nt=a(Oe);Es=d(Nt,"When the processor encounters an image it\u2019ll inject "),Do=s(Nt,"CODE",{});var Ba=a(Do);Cs=d(Ba,"<fake_token_around_image><image><fake_token_around_image>"),Ba.forEach(t),Us=d(Nt,`
entry into the prompt.`),Nt.forEach(t),Ps=m(x),T(ge.$$.fragment,x),Js=m(x),T(ue.$$.fragment,x),Ns=m(x),K=s(x,"P",{});var _o=a(K);Fs=d(_o,"and the two images will be massaged using "),_e=s(_o,"A",{href:!0});var Ft=a(_e);Ws=d(Ft,"IdeficsImageProcessor."),Lo=s(Ft,"STRONG",{});var Da=a(Lo);js=d(Da,"call"),Da.forEach(t),Ss=d(Ft,"()"),Ft.forEach(t),Zs=d(_o,` method and placed inside the
`),Oo=s(_o,"CODE",{});var La=a(Oo);As=d(La,"pixel_values"),La.forEach(t),Vs=d(_o," dict entry of the return value."),_o.forEach(t),Rs=m(x),qo=s(x,"P",{});var Oa=a(qo);Bs=d(Oa,`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.`),Oa.forEach(t),Ds=m(x),T(be.$$.fragment,x),Ls=m(x),qe=s(x,"P",{});var Wt=a(qe);Os=d(Wt,"In order to help debug prompt generation enable "),Ho=s(Wt,"CODE",{});var qa=a(Ho);qs=d(qa,"debug=True"),qa.forEach(t),Hs=d(Wt," which will show you what\u2019s happening."),Wt.forEach(t),x.forEach(t),ye.forEach(t),this.h()},h(){h(l,"name","hf:doc:metadata"),h(l,"content",JSON.stringify(dr)),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(oe,"id","overview"),h(oe,"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(oe,"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(Ke,"href","INSERT%20LINK%20TO%20GITHUB%20REPO%20HERE"),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(D,"class","relative group"),h(eo,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsModel"),h(xe,"href","https://huggingface.co/HuggingFaceM4/idefics-9b"),h(xe,"rel","nofollow"),h(to,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),h(no,"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(O,"class","relative group"),h(so,"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(ao,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsModel"),h(V,"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(ro,"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(G,"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(Y,"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(Q,"class","relative group"),h(io,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsProcessor"),h(lo,"href","/docs/transformers/main/en/model_doc/idefics#transformers.IdeficsImageProcessor"),h(co,"href","/docs/transformers/main/en/model_doc/llama2#transformers.LlamaTokenizerFast"),h(Re,"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,N,g),_(o,W,g),e(W,oe),e(oe,bo),I(Te,bo,null),e(W,jt),e(W,vo),e(vo,St),_(o,at,g),_(o,te,g),e(te,Zt),e(te,Ie),e(Ie,At),e(te,Vt),_(o,rt,g),_(o,Ye,g),e(Ye,Rt),_(o,it,g),_(o,Qe,g),e(Qe,yo),e(yo,Bt),_(o,dt,g),_(o,A,g),e(A,Dt),e(A,we),e(we,Lt),e(A,Ot),e(A,Ke),e(Ke,qt),e(A,Ht),_(o,lt,g),I(ne,o,g),_(o,ct,g),_(o,D,g),e(D,se),e(se,To),I(Me,To,null),e(D,Gt),e(D,Io),e(Io,Xt),_(o,mt,g),_(o,U,g),I(ke,U,null),e(U,Yt),e(U,$e),e($e,Qt),e($e,eo),e(eo,Kt),e($e,en),e(U,on),e(U,oo),e(oo,tn),e(oo,xe),e(xe,nn),e(U,sn),e(U,L),e(L,an),e(L,to),e(to,rn),e(L,dn),e(L,no),e(no,ln),e(L,cn),e(U,mn),I(ae,U,null),_(o,pt,g),_(o,O,g),e(O,re),e(re,wo),I(ze,wo,null),e(O,pn),e(O,Mo),e(Mo,fn),_(o,ft,g),_(o,P,g),I(Ee,P,null),e(P,hn),e(P,Ce),e(Ce,gn),e(Ce,so),e(so,un),e(Ce,_n),e(P,bn),e(P,Ue),e(Ue,vn),e(Ue,Pe),e(Pe,yn),e(Ue,Tn),e(P,In),e(P,ie),e(ie,wn),e(ie,ko),e(ko,Mn),e(ie,kn),e(ie,$o),e($o,$n),e(P,xn),e(P,V),I(Je,V,null),e(V,zn),e(V,q),e(q,En),e(q,ao),e(ao,Cn),e(q,Un),e(q,xo),e(xo,Pn),e(q,Jn),e(V,Nn),I(de,V,null),_(o,ht,g),_(o,H,g),e(H,le),e(le,zo),I(Ne,zo,null),e(H,Fn),e(H,Eo),e(Eo,Wn),_(o,gt,g),_(o,G,g),I(Fe,G,null),e(G,jn),e(G,j),I(We,j,null),e(j,Sn),e(j,X),e(X,Zn),e(X,ro),e(ro,An),e(X,Vn),e(X,Co),e(Co,Rn),e(X,Bn),e(j,Dn),I(ce,j,null),e(j,Ln),I(me,j,null),_(o,ut,g),_(o,Y,g),e(Y,pe),e(pe,Uo),I(je,Uo,null),e(Y,On),e(Y,Po),e(Po,qn),_(o,_t,g),_(o,S,g),I(Se,S,null),e(S,Hn),e(S,Jo),e(Jo,Gn),e(S,Xn),e(S,fe),I(Ze,fe,null),e(fe,Yn),e(fe,No),e(No,Qn),_(o,bt,g),_(o,Q,g),e(Q,he),e(he,Fo),I(Ae,Fo,null),e(Q,Kn),e(Q,Wo),e(Wo,es),_(o,vt,g),_(o,F,g),I(Ve,F,null),e(F,os),e(F,jo),e(jo,ts),e(F,ns),e(F,J),e(J,io),e(io,ss),e(J,as),e(J,lo),e(lo,rs),e(J,is),e(J,co),e(co,ds),e(J,ls),e(J,Re),e(Re,So),e(So,cs),e(Re,ms),e(J,ps),e(J,Zo),e(Zo,fs),e(J,hs),e(F,gs),e(F,$),I(Be,$,null),e($,us),e($,Ao),e(Ao,_s),e($,bs),e($,Vo),e(Vo,vs),e($,ys),e($,De),e(De,Ts),e(De,Ro),e(Ro,Is),e(De,ws),e($,Ms),e($,Le),e(Le,ks),e(Le,Bo),e(Bo,$s),e(Le,xs),e($,zs),e($,Oe),e(Oe,Es),e(Oe,Do),e(Do,Cs),e(Oe,Us),e($,Ps),I(ge,$,null),e($,Js),I(ue,$,null),e($,Ns),e($,K),e(K,Fs),e(K,_e),e(_e,Ws),e(_e,Lo),e(Lo,js),e(_e,Ss),e(K,Zs),e(K,Oo),e(Oo,As),e(K,Vs),e($,Rs),e($,qo),e(qo,Bs),e($,Ds),I(be,$,null),e($,Ls),e($,qe),e(qe,Os),e(qe,Ho),e(Ho,qs),e(qe,Hs),yt=!0},p(o,[g]){const He={};g&2&&(He.$$scope={dirty:g,ctx:o}),ne.$set(He);const Go={};g&2&&(Go.$$scope={dirty:g,ctx:o}),ae.$set(Go);const Xo={};g&2&&(Xo.$$scope={dirty:g,ctx:o}),de.$set(Xo);const Yo={};g&2&&(Yo.$$scope={dirty:g,ctx:o}),ce.$set(Yo);const Ge={};g&2&&(Ge.$$scope={dirty:g,ctx:o}),me.$set(Ge);const Qo={};g&2&&(Qo.$$scope={dirty:g,ctx:o}),ge.$set(Qo);const Ko={};g&2&&(Ko.$$scope={dirty:g,ctx:o}),ue.$set(Ko);const et={};g&2&&(et.$$scope={dirty:g,ctx:o}),be.$set(et)},i(o){yt||(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(Je.$$.fragment,o),w(de.$$.fragment,o),w(Ne.$$.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(Ve.$$.fragment,o),w(Be.$$.fragment,o),w(ge.$$.fragment,o),w(ue.$$.fragment,o),w(be.$$.fragment,o),yt=!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(Je.$$.fragment,o),M(de.$$.fragment,o),M(Ne.$$.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(Ve.$$.fragment,o),M(Be.$$.fragment,o),M(ge.$$.fragment,o),M(ue.$$.fragment,o),M(be.$$.fragment,o),yt=!1},d(o){t(l),o&&t(v),o&&t(u),k(r),o&&t(N),o&&t(W),k(Te),o&&t(at),o&&t(te),o&&t(rt),o&&t(Ye),o&&t(it),o&&t(Qe),o&&t(dt),o&&t(A),o&&t(lt),k(ne,o),o&&t(ct),o&&t(D),k(Me),o&&t(mt),o&&t(U),k(ke),k(ae),o&&t(pt),o&&t(O),k(ze),o&&t(ft),o&&t(P),k(Ee),k(Je),k(de),o&&t(ht),o&&t(H),k(Ne),o&&t(gt),o&&t(G),k(Fe),k(We),k(ce),k(me),o&&t(ut),o&&t(Y),k(je),o&&t(_t),o&&t(S),k(Se),k(Ze),o&&t(bt),o&&t(Q),k(Ae),o&&t(vt),o&&t(F),k(Ve),k(Be),k(ge),k(ue),k(be)}}}const dr={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 lr(C){return Qa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ur extends Ha{constructor(l){super();Ga(this,l,lr,ir,Xa,{})}}export{ur as default,dr as metadata};
