import{S as uv,i as gv,s as _v,e as s,k as m,w as T,t as i,M as bv,c as a,d as o,m as h,a as r,x as v,h as l,b as f,G as e,g as b,y as M,q as w,o as I,B as C,v as yv,L as V}from"../../chunks/vendor-hf-doc-builder.js";import{T as S}from"../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../chunks/Docstring-hf-doc-builder.js";import{C as U}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as J}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as W}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Tv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBDb25maWclMkMlMjBDTElQTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUENvbmZpZyUyMHdpdGglMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ0xJUENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENMSVBNb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBDTElQTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmlnJTBBJTBBJTIzJTIwV2UlMjBjYW4lMjBhbHNvJTIwaW5pdGlhbGl6ZSUyMGElMjBDTElQQ29uZmlnJTIwZnJvbSUyMGElMjBDTElQVGV4dENvbmZpZyUyMGFuZCUyMGElMjBDTElQVmlzaW9uQ29uZmlnJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUZXh0Q29uZmlnJTJDJTIwQ0xJUFZpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQVGV4dCUyMGFuZCUyMENMSVBWaXNpb24lMjBjb25maWd1cmF0aW9uJTBBY29uZmlnX3RleHQlMjAlM0QlMjBDTElQVGV4dENvbmZpZygpJTBBY29uZmlnX3Zpc2lvbiUyMCUzRCUyMENMSVBWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMENMSVBDb25maWcuZnJvbV90ZXh0X3Zpc2lvbl9jb25maWdzKGNvbmZpZ190ZXh0JTJDJTIwY29uZmlnX3Zpc2lvbik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPConfig, CLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPConfig with openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPModel (with random weights) from the openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel(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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We can also initialize a CLIPConfig from a CLIPTextConfig and a CLIPVisionConfig</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTextConfig, CLIPVisionConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPText and CLIPVision configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = CLIPTextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = CLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = CLIPConfig.from_text_vision_configs(config_text, config_vision)`}}),{c(){d=s("p"),y=i("Example:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Example:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function vv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUZXh0Q29uZmlnJTJDJTIwQ0xJUFRleHRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQVGV4dENvbmZpZyUyMHdpdGglMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ0xJUFRleHRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQVGV4dE1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMENMSVBUZXh0TW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTextConfig, CLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPTextConfig with openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPTextModel (with random weights) from the openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPTextModel(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(){d=s("p"),y=i("Example:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Example:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Mv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBWaXNpb25Db25maWclMkMlMjBDTElQVmlzaW9uTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFZpc2lvbkNvbmZpZyUyMHdpdGglMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ0xJUFZpc2lvbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENMSVBWaXNpb25Nb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBDTElQVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPVisionConfig, CLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPVisionConfig with openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = CLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a CLIPVisionModel (with random weights) from the openai/clip-vit-base-patch32 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPVisionModel(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(){d=s("p"),y=i("Example:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Example:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function wv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Iv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlJTBBKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwbG9naXRzX3Blcl9pbWFnZS5zb2Z0bWF4KGRpbSUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Cv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Pv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMENMSVBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXRleHRfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfdGV4dF9mZWF0dXJlcygqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function $v(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function kv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQWltYWdlX2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X2ltYWdlX2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function xv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Lv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDTElQVGV4dE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBDTElQVGV4dE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQXBvb2xlZF9vdXRwdXQlMjAlM0QlMjBvdXRwdXRzLnBvb2xlcl9vdXRwdXQlMjAlMjAlMjMlMjBwb29sZWQlMjAoRU9TJTIwdG9rZW4pJTIwc3RhdGVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPTextModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function jv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Jv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDTElQVGV4dE1vZGVsV2l0aFByb2plY3Rpb24lMEElMEFtb2RlbCUyMCUzRCUyMENMSVBUZXh0TW9kZWxXaXRoUHJvamVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEF0ZXh0X2VtYmVkcyUyMCUzRCUyMG91dHB1dHMudGV4dF9lbWJlZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, CLIPTextModelWithProjection

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPTextModelWithProjection.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_embeds = outputs.text_embeds`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Ev(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function zv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBWaXNpb25Nb2RlbFdpdGhQcm9qZWN0aW9uJTBBJTBBbW9kZWwlMjAlM0QlMjBDTElQVmlzaW9uTW9kZWxXaXRoUHJvamVjdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBaW1hZ2VfZW1iZWRzJTIwJTNEJTIwb3V0cHV0cy5pbWFnZV9lbWJlZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPVisionModelWithProjection

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPVisionModelWithProjection.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_embeds = outputs.image_embeds`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Uv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Fv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENMSVBWaXNpb25Nb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQ0xJUFZpc2lvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwQ0xTJTIwc3RhdGVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, CLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Wv(P){let d,y,u,p,_,n,c,$,Sn,oo,D,pe,Ge,j,Dn,Ue,Yn,no,te,Hn,Fe,tt,Qn,so,me,On,ao,he,ot,Kn,nt,F,N,st,re,es,at,rt,ro,Re,fe,io,oe,ts,Xe,it,os,lo,L,ns,ue,ss,co,Y,as,We,qe,rs;return{c(){d=s("p"),y=i("TensorFlow models and layers in "),u=s("code"),p=i("transformers"),_=i(" accept two formats as input:"),n=m(),c=s("ul"),$=s("li"),Sn=i("having all inputs as keyword arguments (like PyTorch models), or"),oo=m(),D=s("li"),pe=i("having all inputs as a list, tuple or dict in the first positional argument."),Ge=m(),j=s("p"),Dn=i(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Ue=s("code"),Yn=i("model.fit()"),no=i(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),te=s("code"),Hn=i("model.fit()"),Fe=i(` supports! If, however, you want to use the second
format outside of Keras methods like `),tt=s("code"),Qn=i("fit()"),so=i(" and "),me=s("code"),On=i("predict()"),ao=i(`, such as when creating your own layers or models with
the Keras `),he=s("code"),ot=i("Functional"),Kn=i(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),nt=m(),F=s("ul"),N=s("li"),st=i("a single Tensor with "),re=s("code"),es=i("input_ids"),at=i(" only and nothing else: "),rt=s("code"),ro=i("model(input_ids)"),Re=m(),fe=s("li"),io=i(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=s("code"),ts=i("model([input_ids, attention_mask])"),Xe=i(" or "),it=s("code"),os=i("model([input_ids, attention_mask, token_type_ids])"),lo=m(),L=s("li"),ns=i(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=s("code"),ss=i('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),co=m(),Y=s("p"),as=i(`Note that when creating models and layers with
`),We=s("a"),qe=i("subclassing"),rs=i(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(x){d=a(x,"P",{});var E=r(d);y=l(E,"TensorFlow models and layers in "),u=a(E,"CODE",{});var ur=r(u);p=l(ur,"transformers"),ur.forEach(o),_=l(E," accept two formats as input:"),E.forEach(o),n=h(x),c=a(x,"UL",{});var po=r(c);$=a(po,"LI",{});var lt=r($);Sn=l(lt,"having all inputs as keyword arguments (like PyTorch models), or"),lt.forEach(o),oo=h(po),D=a(po,"LI",{});var gr=r(D);pe=l(gr,"having all inputs as a list, tuple or dict in the first positional argument."),gr.forEach(o),po.forEach(o),Ge=h(x),j=a(x,"P",{});var X=r(j);Dn=l(X,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),Ue=a(X,"CODE",{});var dt=r(Ue);Yn=l(dt,"model.fit()"),dt.forEach(o),no=l(X,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),te=a(X,"CODE",{});var _r=r(te);Hn=l(_r,"model.fit()"),_r.forEach(o),Fe=l(X,` supports! If, however, you want to use the second
format outside of Keras methods like `),tt=a(X,"CODE",{});var br=r(tt);Qn=l(br,"fit()"),br.forEach(o),so=l(X," and "),me=a(X,"CODE",{});var is=r(me);On=l(is,"predict()"),is.forEach(o),ao=l(X,`, such as when creating your own layers or models with
the Keras `),he=a(X,"CODE",{});var Ae=r(he);ot=l(Ae,"Functional"),Ae.forEach(o),Kn=l(X,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),X.forEach(o),nt=h(x),F=a(x,"UL",{});var Ve=r(F);N=a(Ve,"LI",{});var q=r(N);st=l(q,"a single Tensor with "),re=a(q,"CODE",{});var yr=r(re);es=l(yr,"input_ids"),yr.forEach(o),at=l(q," only and nothing else: "),rt=a(q,"CODE",{});var Se=r(rt);ro=l(Se,"model(input_ids)"),Se.forEach(o),q.forEach(o),Re=h(Ve),fe=a(Ve,"LI",{});var ct=r(fe);io=l(ct,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=a(ct,"CODE",{});var Tr=r(oe);ts=l(Tr,"model([input_ids, attention_mask])"),Tr.forEach(o),Xe=l(ct," or "),it=a(ct,"CODE",{});var De=r(it);os=l(De,"model([input_ids, attention_mask, token_type_ids])"),De.forEach(o),ct.forEach(o),lo=h(Ve),L=a(Ve,"LI",{});var ls=r(L);ns=l(ls,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=a(ls,"CODE",{});var vr=r(ue);ss=l(vr,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),vr.forEach(o),ls.forEach(o),Ve.forEach(o),co=h(x),Y=a(x,"P",{});var pt=r(Y);as=l(pt,`Note that when creating models and layers with
`),We=a(pt,"A",{href:!0,rel:!0});var ge=r(We);qe=l(ge,"subclassing"),ge.forEach(o),rs=l(pt,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),pt.forEach(o),this.h()},h(){f(We,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(We,"rel","nofollow")},m(x,E){b(x,d,E),e(d,y),e(d,u),e(u,p),e(d,_),b(x,n,E),b(x,c,E),e(c,$),e($,Sn),e(c,oo),e(c,D),e(D,pe),b(x,Ge,E),b(x,j,E),e(j,Dn),e(j,Ue),e(Ue,Yn),e(j,no),e(j,te),e(te,Hn),e(j,Fe),e(j,tt),e(tt,Qn),e(j,so),e(j,me),e(me,On),e(j,ao),e(j,he),e(he,ot),e(j,Kn),b(x,nt,E),b(x,F,E),e(F,N),e(N,st),e(N,re),e(re,es),e(N,at),e(N,rt),e(rt,ro),e(F,Re),e(F,fe),e(fe,io),e(fe,oe),e(oe,ts),e(fe,Xe),e(fe,it),e(it,os),e(F,lo),e(F,L),e(L,ns),e(L,ue),e(ue,ss),b(x,co,E),b(x,Y,E),e(Y,as),e(Y,We),e(We,qe),e(Y,rs)},d(x){x&&o(d),x&&o(n),x&&o(c),x&&o(Ge),x&&o(j),x&&o(nt),x&&o(F),x&&o(co),x&&o(Y)}}}function Vv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Zv(P){let d,y,u,p,_;return p=new U({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBdXRvUHJvY2Vzc29yJTJDJTIwVEZDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMFRGQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IoJTBBJTIwJTIwJTIwJTIwdGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiUyQyUyMHBhZGRpbmclM0RUcnVlJTBBKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwdGYubm4uc29mdG1heChsb2dpdHNfcGVyX2ltYWdlJTJDJTIwYXhpcyUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = tf.nn.softmax(logits_per_image, axis=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Bv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Nv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkNMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwVEZDTElQTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEF0ZXh0X2ZlYXR1cmVzJTIwJTNEJTIwbW9kZWwuZ2V0X3RleHRfZmVhdHVyZXMoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Gv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Rv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQ0xJUE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBURkNMSVBNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF9pbWFnZV9mZWF0dXJlcygqKmlucHV0cyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Xv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function qv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBURkNMSVBUZXh0TW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMFRGQ0xJUFRleHRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwcGFkZGluZyUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsYXN0X2hpZGRlbl9zdGF0ZSUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFwb29sZWRfb3V0cHV0JTIwJTNEJTIwb3V0cHV0cy5wb29sZXJfb3V0cHV0JTIwJTIwJTIzJTIwcG9vbGVkJTIwKEVPUyUyMHRva2VuKSUyMHN0YXRlcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFCLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPTextModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Av(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Sv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMFRGQ0xJUFZpc2lvbk1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBURkNMSVBWaXNpb25Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQXByb2Nlc3NvciUyMCUzRCUyMEF1dG9Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVkX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMENMUyUyMHN0YXRlcw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, TFCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFCLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooled_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Dv(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Yv(P){let d,y,u,p,_;return p=new U({props:{code:"aW1wb3J0JTIwamF4JTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXhDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhDTElQTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvciglMEElMjAlMjAlMjAlMjB0ZXh0JTNEJTVCJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwY2F0JTIyJTJDJTIwJTIyYSUyMHBob3RvJTIwb2YlMjBhJTIwZG9nJTIyJTVEJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMm5wJTIyJTJDJTIwcGFkZGluZyUzRFRydWUlMEEpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBqYXgubm4uc29mdG1heChsb2dpdHNfcGVyX2ltYWdlJTJDJTIwYXhpcyUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, FlaxCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(
<span class="hljs-meta">... </span>    text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>, padding=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = jax.nn.softmax(logits_per_image, axis=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),{c(){d=s("p"),y=i("Example:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Example:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Hv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4Q0xJUE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBGbGF4Q0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBjYXQlMjIlMkMlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBdGV4dF9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF90ZXh0X2ZlYXR1cmVzKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = model.get_text_features(**inputs)`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Qv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXhDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhDTElQTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBJTBBaW1hZ2VfZmVhdHVyZXMlMjAlM0QlMjBtb2RlbC5nZXRfaW1hZ2VfZmVhdHVyZXMoKippbnB1dHMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, FlaxCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = model.get_image_features(**inputs)`}}),{c(){d=s("p"),y=i("Examples:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Examples:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function Ov(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function Kv(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBGbGF4Q0xJUFRleHRNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwRmxheENMSVBUZXh0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVyX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMChFT1MlMjB0b2tlbiklMjBzdGF0ZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, FlaxCLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPTextModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], padding=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooler_output = outputs.pooler_output  <span class="hljs-comment"># pooled (EOS token) states</span>`}}),{c(){d=s("p"),y=i("Example:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Example:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function eM(P){let d,y,u,p,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),p=i("Module"),_=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(n){d=a(n,"P",{});var c=r(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a(c,"CODE",{});var $=r(u);p=l($,"Module"),$.forEach(o),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(o)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function tM(P){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEZsYXhDTElQVmlzaW9uTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEZsYXhDTElQVmlzaW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm9wZW5haSUyRmNsaXAtdml0LWJhc2UtcGF0Y2gzMiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQXBvb2xlcl9vdXRwdXQlMjAlM0QlMjBvdXRwdXRzLnBvb2xlcl9vdXRwdXQlMjAlMjAlMjMlMjBwb29sZWQlMjBDTFMlMjBzdGF0ZXM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, FlaxCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxCLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>pooler_output = outputs.pooler_output  <span class="hljs-comment"># pooled CLS states</span>`}}),{c(){d=s("p"),y=i("Example:"),u=m(),T(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Example:"),c.forEach(o),u=h(n),v(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),C(p,n)}}}function oM(P){let d,y,u,p,_,n,c,$,Sn,oo,D,pe,Ge,j,Dn,Ue,Yn,no,te,Hn,Fe,tt,Qn,so,me,On,ao,he,ot,Kn,nt,F,N,st,re,es,at,rt,ro,Re,fe,io,oe,ts,Xe,it,os,lo,L,ns,ue,ss,co,Y,as,We,qe,rs,x,E,ur,po,lt,gr,X,dt,_r,br,is,Ae,Ve,q,yr,Se,ct,Tr,De,ls,vr,pt,ge,mo,Ji,ds,Mp,Ei,wp,Ed,Mr,Ip,zd,ho,cs,Cp,ps,Pp,$p,kp,ms,xp,hs,Lp,jp,Ud,wr,Jp,Fd,mt,fo,zi,fs,Ep,Ui,zp,Wd,H,us,Up,Ye,Ir,Fp,Wp,Cr,Vp,Zp,gs,Bp,Np,Gp,ht,Rp,Pr,Xp,qp,$r,Ap,Sp,Dp,uo,Yp,go,_s,Hp,bs,Qp,kr,Op,Kp,Vd,ft,_o,Fi,ys,em,Wi,tm,Zd,ie,Ts,om,ut,nm,xr,sm,am,vs,rm,im,lm,gt,dm,Lr,cm,pm,jr,mm,hm,fm,bo,Bd,_t,yo,Vi,Ms,um,Zi,gm,Nd,le,ws,_m,bt,bm,Jr,ym,Tm,Is,vm,Mm,wm,yt,Im,Er,Cm,Pm,zr,$m,km,xm,To,Gd,Tt,vo,Bi,Cs,Lm,Ni,jm,Rd,Z,Ps,Jm,Gi,Em,zm,$s,Um,Ur,Fm,Wm,Vm,_e,ks,Zm,Ri,Bm,Nm,Xi,Fr,Gm,qi,Rm,Xm,Ai,qm,Am,Mo,xs,Sm,Ls,Dm,Si,Ym,Hm,Qm,wo,js,Om,Di,Km,eh,Wr,Js,Xd,vt,Io,Yi,Es,th,Hi,oh,qd,Q,zs,nh,Us,sh,Qi,ah,rh,ih,Fs,lh,Vr,dh,ch,ph,be,Ws,mh,Oi,hh,fh,Ki,Zr,uh,el,gh,_h,tl,bh,yh,Co,Vs,Th,ol,vh,Ad,Mt,Po,nl,Zs,Mh,sl,wh,Sd,Ze,Bs,Ih,al,Ch,Ph,$o,Ns,$h,rl,kh,Dd,wt,ko,il,Gs,xh,ll,Lh,Yd,Rs,Xs,Hd,It,xo,dl,qs,jh,cl,Jh,Qd,O,As,Eh,pl,zh,Uh,ne,Br,Fh,Wh,Nr,Vh,Zh,Gr,Bh,Nh,ml,Gh,Rh,Rr,Xh,qh,Ah,Lo,Ss,Sh,Ds,Dh,Xr,Yh,Hh,Qh,jo,Ys,Oh,Hs,Kh,qr,ef,tf,Od,Ct,Jo,hl,Qs,of,fl,nf,Kd,G,Os,sf,Ks,af,Ar,rf,lf,df,ea,cf,ta,pf,mf,hf,ye,oa,ff,Pt,uf,Sr,gf,_f,ul,bf,yf,Tf,Eo,vf,zo,Mf,Te,na,wf,$t,If,Dr,Cf,Pf,gl,$f,kf,xf,Uo,Lf,Fo,jf,ve,sa,Jf,kt,Ef,Yr,zf,Uf,_l,Ff,Wf,Vf,Wo,Zf,Vo,ec,xt,Zo,bl,aa,Bf,yl,Nf,tc,de,ra,Gf,ia,Rf,Hr,Xf,qf,Af,la,Sf,da,Df,Yf,Hf,Me,ca,Qf,Lt,Of,Qr,Kf,eu,Tl,tu,ou,nu,Bo,su,No,oc,jt,Go,vl,pa,au,Ml,ru,nc,K,ma,iu,wl,lu,du,ha,cu,Or,pu,mu,hu,fa,fu,ua,uu,gu,_u,we,ga,bu,Jt,yu,Kr,Tu,vu,Il,Mu,wu,Iu,Ro,Cu,Xo,sc,Et,qo,Cl,_a,Pu,Pl,$u,ac,ee,ba,ku,$l,xu,Lu,ya,ju,ei,Ju,Eu,zu,Ta,Uu,va,Fu,Wu,Vu,Ie,Ma,Zu,zt,Bu,ti,Nu,Gu,kl,Ru,Xu,qu,Ao,Au,So,rc,Ut,Do,xl,wa,Su,Ll,Du,ic,ce,Ia,Yu,Ca,Hu,oi,Qu,Ou,Ku,Pa,eg,$a,tg,og,ng,Ce,ka,sg,Ft,ag,ni,rg,ig,jl,lg,dg,cg,Yo,pg,Ho,lc,Wt,Qo,Jl,xa,mg,El,hg,dc,B,La,fg,ja,ug,si,gg,_g,bg,Ja,yg,Ea,Tg,vg,Mg,Oo,wg,Pe,za,Ig,Vt,Cg,ai,Pg,$g,zl,kg,xg,Lg,Ko,jg,en,Jg,$e,Ua,Eg,Zt,zg,ri,Ug,Fg,Ul,Wg,Vg,Zg,tn,Bg,on,Ng,ke,Fa,Gg,Bt,Rg,ii,Xg,qg,Fl,Ag,Sg,Dg,nn,Yg,sn,cc,Nt,an,Wl,Wa,Hg,Vl,Qg,pc,Gt,Va,Og,xe,Za,Kg,Rt,e_,li,t_,o_,Zl,n_,s_,a_,rn,r_,ln,mc,Xt,dn,Bl,Ba,i_,Nl,l_,hc,qt,Na,d_,Le,Ga,c_,At,p_,di,m_,h_,Gl,f_,u_,g_,cn,__,pn,fc,St,mn,Rl,Ra,b_,Xl,y_,uc,z,Xa,T_,qa,v_,ci,M_,w_,I_,Aa,C_,Sa,P_,$_,k_,ql,x_,L_,Be,Al,Da,j_,J_,Sl,Ya,E_,z_,Dl,Ha,U_,F_,Yl,Qa,W_,V_,je,Oa,Z_,Dt,B_,Hl,N_,G_,Ql,R_,X_,q_,hn,A_,fn,S_,un,Ka,D_,gn,Y_,_n,er,H_,bn,gc,Yt,yn,Ol,tr,Q_,Kl,O_,_c,Ht,or,K_,Je,nr,eb,Qt,tb,ed,ob,nb,td,sb,ab,rb,Tn,ib,vn,bc,Ot,Mn,od,sr,lb,nd,db,yc,Kt,ar,cb,Ee,rr,pb,eo,mb,sd,hb,fb,ad,ub,gb,_b,wn,bb,In,Tc;return n=new J({}),j=new J({}),re=new J({}),Ae=new U({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQ0xJUFByb2Nlc3NvciUyQyUyMENMSVBNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQ0xJUFByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRCU1QiUyMmElMjBwaG90byUyMG9mJTIwYSUyMGNhdCUyMiUyQyUyMCUyMmElMjBwaG90byUyMG9mJTIwYSUyMGRvZyUyMiU1RCUyQyUyMGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEFsb2dpdHNfcGVyX2ltYWdlJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHNfcGVyX2ltYWdlJTIwJTIwJTIzJTIwdGhpcyUyMGlzJTIwdGhlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZSUwQXByb2JzJTIwJTNEJTIwbG9naXRzX3Blcl9pbWFnZS5zb2Z0bWF4KGRpbSUzRDEpJTIwJTIwJTIzJTIwd2UlMjBjYW4lMjB0YWtlJTIwdGhlJTIwc29mdG1heCUyMHRvJTIwZ2V0JTIwdGhlJTIwbGFiZWwlMjBwcm9iYWJpbGl0aWVz",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPProcessor, CLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = CLIPModel.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = CLIPProcessor.from_pretrained(<span class="hljs-string">&quot;openai/clip-vit-base-patch32&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=[<span class="hljs-string">&quot;a photo of a cat&quot;</span>, <span class="hljs-string">&quot;a photo of a dog&quot;</span>], images=image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits_per_image = outputs.logits_per_image  <span class="hljs-comment"># this is the image-text similarity score</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>probs = logits_per_image.softmax(dim=<span class="hljs-number">1</span>)  <span class="hljs-comment"># we can take the softmax to get the label probabilities</span>`}}),ds=new J({}),fs=new J({}),us=new k({props:{name:"class transformers.CLIPConfig",anchor:"transformers.CLIPConfig",parameters:[{name:"text_config",val:" = None"},{name:"vision_config",val:" = None"},{name:"projection_dim",val:" = 512"},{name:"logit_scale_init_value",val:" = 2.6592"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextConfig">CLIPTextConfig</a>.`,name:"text_config"},{anchor:"transformers.CLIPConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionConfig">CLIPVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.CLIPConfig.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimentionality of text and vision projection layers.`,name:"projection_dim"},{anchor:"transformers.CLIPConfig.logit_scale_init_value",description:`<strong>logit_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 2.6592) &#x2014;
The inital value of the <em>logit_scale</em> paramter. Default is used as per the original CLIP implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.CLIPConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/configuration_clip.py#L253"}}),uo=new W({props:{anchor:"transformers.CLIPConfig.example",$$slots:{default:[Tv]},$$scope:{ctx:P}}}),_s=new k({props:{name:"from_text_vision_configs",anchor:"transformers.CLIPConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": CLIPTextConfig"},{name:"vision_config",val:": CLIPVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/configuration_clip.py#L389",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig"
>CLIPConfig</a></p>
`}}),ys=new J({}),Ts=new k({props:{name:"class transformers.CLIPTextConfig",anchor:"transformers.CLIPTextConfig",parameters:[{name:"vocab_size",val:" = 49408"},{name:"hidden_size",val:" = 512"},{name:"intermediate_size",val:" = 2048"},{name:"projection_dim",val:" = 512"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 8"},{name:"max_position_embeddings",val:" = 77"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 49406"},{name:"eos_token_id",val:" = 49407"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 49408) &#x2014;
Vocabulary size of the CLIP text 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/clip#transformers.CLIPModel">CLIPModel</a>.`,name:"vocab_size"},{anchor:"transformers.CLIPTextConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.CLIPTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.CLIPTextConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPTextConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 77) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.CLIPTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> <code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPTextConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.CLIPTextConfig.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.CLIPTextConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/configuration_clip.py#L39"}}),bo=new W({props:{anchor:"transformers.CLIPTextConfig.example",$$slots:{default:[vv]},$$scope:{ctx:P}}}),Ms=new J({}),ws=new k({props:{name:"class transformers.CLIPVisionConfig",anchor:"transformers.CLIPVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{name:"projection_dim",val:" = 512"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"num_channels",val:" = 3"},{name:"image_size",val:" = 224"},{name:"patch_size",val:" = 32"},{name:"hidden_act",val:" = 'quick_gelu'"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"attention_dropout",val:" = 0.0"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPVisionConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.CLIPVisionConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.CLIPVisionConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.CLIPVisionConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.CLIPVisionConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 224) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.CLIPVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.CLIPVisionConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;quick_gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> \`<code>&quot;quick_gelu&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.CLIPVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.CLIPVisionConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_dropout"},{anchor:"transformers.CLIPVisionConfig.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.CLIPVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/configuration_clip.py#L148"}}),To=new W({props:{anchor:"transformers.CLIPVisionConfig.example",$$slots:{default:[Mv]},$$scope:{ctx:P}}}),Cs=new J({}),Ps=new k({props:{name:"class transformers.CLIPTokenizer",anchor:"transformers.CLIPTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"errors",val:" = 'replace'"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|startoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = '<|endoftext|>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CLIPTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CLIPTokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.CLIPTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.CLIPTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|startoftext|&gt;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.CLIPTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/tokenization_clip.py#L272"}}),ks=new k({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.CLIPTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CLIPTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/tokenization_clip.py#L358",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),xs=new k({props:{name:"get_special_tokens_mask",anchor:"transformers.CLIPTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.CLIPTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.CLIPTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/tokenization_clip.py#L385",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),js=new k({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.CLIPTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CLIPTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/tokenization_clip.py#L413",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Js=new k({props:{name:"save_vocabulary",anchor:"transformers.CLIPTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/tokenization_clip.py#L508"}}),Es=new J({}),zs=new k({props:{name:"class transformers.CLIPTokenizerFast",anchor:"transformers.CLIPTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|startoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = '<|endoftext|>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.CLIPTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.CLIPTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.CLIPTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|startoftext|&gt;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.CLIPTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;|endoftext|&gt;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/tokenization_clip_fast.py#L50"}}),Ws=new k({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.CLIPTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CLIPTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/tokenization_clip_fast.py#L123",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Vs=new k({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.CLIPTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.CLIPTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.CLIPTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/tokenization_clip_fast.py#L150",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Zs=new J({}),Bs=new k({props:{name:"class transformers.CLIPImageProcessor",anchor:"transformers.CLIPImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.CLIPImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;shortest_edge&quot; -- 224}</code>):
Size of the image after resizing. The shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio. Can be overridden by <code>size</code> in the <code>preprocess</code>
method.`,name:"size"},{anchor:"transformers.CLIPImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BICUBIC</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in the <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.CLIPImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the
<code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.CLIPImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to 224) &#x2014;
Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code>
method.`,name:"crop_size"},{anchor:"transformers.CLIPImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by <code>do_rescale</code> in
the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.CLIPImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by <code>rescale_factor</code> in the <code>preprocess</code>
method.
do_normalize &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.CLIPImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.48145466, 0.4578275, 0.40821073]</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.CLIPImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>[0.26862954, 0.26130258, 0.27577711]</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.CLIPImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</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.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/image_processing_clip.py#L49"}}),Ns=new k({props:{name:"preprocess",anchor:"transformers.CLIPImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[transformers.image_utils.ChannelDimension, str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.CLIPImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.CLIPImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after resizing. Shortest edge of the image is resized to size[&#x201C;shortest_edge&#x201D;], with
the longest edge resized to keep the input aspect ratio.`,name:"size"},{anchor:"transformers.CLIPImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
Resampling filter to use if resizing the image. This can be one of the enum <code>PILImageResampling</code>. Only
has an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.CLIPImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.CLIPImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.CLIPImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.CLIPImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.CLIPImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.CLIPImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean to use for normalization. Only has an effect if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.CLIPImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation to use for normalization. Only has an effect if <code>do_normalize</code> is set to
<code>True</code>.`,name:"image_std"},{anchor:"transformers.CLIPImageProcessor.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_convert_rgb</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.CLIPImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li>Unset: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.CLIPImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.CLIPImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/image_processing_clip.py#L162"}}),Gs=new J({}),Xs=new k({props:{name:"class transformers.CLIPFeatureExtractor",anchor:"transformers.CLIPFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/feature_extraction_clip.py#L26"}}),qs=new J({}),As=new k({props:{name:"class transformers.CLIPProcessor",anchor:"transformers.CLIPProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CLIPProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor">CLIPImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.CLIPProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/processing_clip.py#L25"}}),Ss=new k({props:{name:"batch_decode",anchor:"transformers.CLIPProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/processing_clip.py#L113"}}),Ys=new k({props:{name:"decode",anchor:"transformers.CLIPProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/processing_clip.py#L120"}}),Qs=new J({}),Os=new k({props:{name:"class transformers.CLIPModel",anchor:"transformers.CLIPModel",parameters:[{name:"config",val:": CLIPConfig"}],parametersDescription:[{anchor:"transformers.CLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_clip.py#L967"}}),oa=new k({props:{name:"forward",anchor:"transformers.CLIPModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"return_loss",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.CLIPModel.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.CLIPModel.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>`,name:"attention_mask"},{anchor:"transformers.CLIPModel.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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPModel.forward.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.CLIPModel.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.CLIPModel.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.CLIPModel.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/clip/modeling_clip.py#L1098",returnDescription:`
<p>A <code>transformers.models.clip.modeling_clip.CLIPOutput</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 (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>torch.FloatTensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>torch.FloatTensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_clip.CLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Eo=new S({props:{$$slots:{default:[wv]},$$scope:{ctx:P}}}),zo=new W({props:{anchor:"transformers.CLIPModel.forward.example",$$slots:{default:[Iv]},$$scope:{ctx:P}}}),na=new k({props:{name:"get_text_features",anchor:"transformers.CLIPModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = 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.CLIPModel.get_text_features.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.CLIPModel.get_text_features.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>`,name:"attention_mask"},{anchor:"transformers.CLIPModel.get_text_features.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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPModel.get_text_features.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.CLIPModel.get_text_features.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.CLIPModel.get_text_features.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/clip/modeling_clip.py#L1002",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel"
>CLIPTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Uo=new S({props:{$$slots:{default:[Cv]},$$scope:{ctx:P}}}),Fo=new W({props:{anchor:"transformers.CLIPModel.get_text_features.example",$$slots:{default:[Pv]},$$scope:{ctx:P}}}),sa=new k({props:{name:"get_image_features",anchor:"transformers.CLIPModel.get_image_features",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = 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.CLIPModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPModel.get_image_features.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.CLIPModel.get_image_features.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.CLIPModel.get_image_features.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/clip/modeling_clip.py#L1049",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModel"
>CLIPVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Wo=new S({props:{$$slots:{default:[$v]},$$scope:{ctx:P}}}),Vo=new W({props:{anchor:"transformers.CLIPModel.get_image_features.example",$$slots:{default:[kv]},$$scope:{ctx:P}}}),aa=new J({}),ra=new k({props:{name:"class transformers.CLIPTextModel",anchor:"transformers.CLIPTextModel",parameters:[{name:"config",val:": CLIPTextConfig"}],parametersDescription:[{anchor:"transformers.CLIPTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_clip.py#L793"}}),ca=new k({props:{name:"forward",anchor:"transformers.CLIPTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = 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.CLIPTextModel.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.CLIPTextModel.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>`,name:"attention_mask"},{anchor:"transformers.CLIPTextModel.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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPTextModel.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.CLIPTextModel.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.CLIPTextModel.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/clip/modeling_clip.py#L810",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Bo=new S({props:{$$slots:{default:[xv]},$$scope:{ctx:P}}}),No=new W({props:{anchor:"transformers.CLIPTextModel.forward.example",$$slots:{default:[Lv]},$$scope:{ctx:P}}}),pa=new J({}),ma=new k({props:{name:"class transformers.CLIPTextModelWithProjection",anchor:"transformers.CLIPTextModelWithProjection",parameters:[{name:"config",val:": CLIPTextConfig"}],parametersDescription:[{anchor:"transformers.CLIPTextModelWithProjection.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_clip.py#L1198"}}),ga=new k({props:{name:"forward",anchor:"transformers.CLIPTextModelWithProjection.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = 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.CLIPTextModelWithProjection.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.CLIPTextModelWithProjection.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>`,name:"attention_mask"},{anchor:"transformers.CLIPTextModelWithProjection.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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.CLIPTextModelWithProjection.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.CLIPTextModelWithProjection.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.CLIPTextModelWithProjection.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/clip/modeling_clip.py#L1219",returnDescription:`
<p>A <code>transformers.models.clip.modeling_clip.CLIPTextModelOutput</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 (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>text_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code> <em>optional</em> returned when model is initialized with <code>with_projection=True</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</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>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_clip.CLIPTextModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ro=new S({props:{$$slots:{default:[jv]},$$scope:{ctx:P}}}),Xo=new W({props:{anchor:"transformers.CLIPTextModelWithProjection.forward.example",$$slots:{default:[Jv]},$$scope:{ctx:P}}}),_a=new J({}),ba=new k({props:{name:"class transformers.CLIPVisionModelWithProjection",anchor:"transformers.CLIPVisionModelWithProjection",parameters:[{name:"config",val:": CLIPVisionConfig"}],parametersDescription:[{anchor:"transformers.CLIPVisionModelWithProjection.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_clip.py#L1279"}}),Ma=new k({props:{name:"forward",anchor:"transformers.CLIPVisionModelWithProjection.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = 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.CLIPVisionModelWithProjection.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPVisionModelWithProjection.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.CLIPVisionModelWithProjection.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.CLIPVisionModelWithProjection.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/clip/modeling_clip.py#L1296",returnDescription:`
<p>A <code>transformers.models.clip.modeling_clip.CLIPVisionModelOutput</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 (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>image_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim)</code> <em>optional</em> returned when model is initialized with <code>with_projection=True</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooler_output.</p>
</li>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</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>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_clip.CLIPVisionModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ao=new S({props:{$$slots:{default:[Ev]},$$scope:{ctx:P}}}),So=new W({props:{anchor:"transformers.CLIPVisionModelWithProjection.forward.example",$$slots:{default:[zv]},$$scope:{ctx:P}}}),wa=new J({}),Ia=new k({props:{name:"class transformers.CLIPVisionModel",anchor:"transformers.CLIPVisionModel",parameters:[{name:"config",val:": CLIPVisionConfig"}],parametersDescription:[{anchor:"transformers.CLIPVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_clip.py#L912"}}),ka=new k({props:{name:"forward",anchor:"transformers.CLIPVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = 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.CLIPVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.CLIPVisionModel.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.CLIPVisionModel.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.CLIPVisionModel.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/clip/modeling_clip.py#L925",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Yo=new S({props:{$$slots:{default:[Uv]},$$scope:{ctx:P}}}),Ho=new W({props:{anchor:"transformers.CLIPVisionModel.forward.example",$$slots:{default:[Fv]},$$scope:{ctx:P}}}),xa=new J({}),La=new k({props:{name:"class transformers.TFCLIPModel",anchor:"transformers.TFCLIPModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFCLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</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.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_tf_clip.py#L1167"}}),Oo=new S({props:{$$slots:{default:[Wv]},$$scope:{ctx:P}}}),za=new k({props:{name:"call",anchor:"transformers.TFCLIPModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"return_loss",val:": Optional[bool] = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFCLIPModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</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.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCLIPModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> <code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFCLIPModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.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>`,name:"attention_mask"},{anchor:"transformers.TFCLIPModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFCLIPModel.call.return_loss",description:`<strong>return_loss</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the contrastive loss.`,name:"return_loss"},{anchor:"transformers.TFCLIPModel.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFCLIPModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPModel.call.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. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_tf_clip.py#L1257",returnDescription:`
<p>A <code>transformers.models.clip.modeling_tf_clip.TFCLIPOutput</code> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>return_loss</code> is <code>True</code>) \u2014 Contrastive loss for image-text similarity.</li>
<li><strong>logits_per_image:(<code>tf.Tensor</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>tf.Tensor</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>tf.Tensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>tf.Tensor</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>~modeling_tf_utils.TFBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>~modeling_tf_utils.TFBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_tf_clip.TFCLIPOutput</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Ko=new S({props:{$$slots:{default:[Vv]},$$scope:{ctx:P}}}),en=new W({props:{anchor:"transformers.TFCLIPModel.call.example",$$slots:{default:[Zv]},$$scope:{ctx:P}}}),Ua=new k({props:{name:"get_text_features",anchor:"transformers.TFCLIPModel.get_text_features",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFCLIPModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</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.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCLIPModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.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>`,name:"attention_mask"},{anchor:"transformers.TFCLIPModel.get_text_features.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFCLIPModel.get_text_features.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFCLIPModel.get_text_features.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPModel.get_text_features.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. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPModel.get_text_features.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_tf_clip.py#L1175",returnDescription:`
<p>The text embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPTextModel"
>TFCLIPTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),tn=new S({props:{$$slots:{default:[Bv]},$$scope:{ctx:P}}}),on=new W({props:{anchor:"transformers.TFCLIPModel.get_text_features.example",$$slots:{default:[Nv]},$$scope:{ctx:P}}}),Fa=new k({props:{name:"get_image_features",anchor:"transformers.TFCLIPModel.get_image_features",parameters:[{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFCLIPModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details. output_attentions (<code>bool</code>, <em>optional</em>): Whether or not to
return the attentions tensors of all attention layers. See <code>attentions</code> under returned tensors for more
detail. This argument can be used only in eager mode, in graph mode the value in the config will be used
instead.`,name:"pixel_values"},{anchor:"transformers.TFCLIPModel.get_image_features.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPModel.get_image_features.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. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPModel.get_image_features.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_tf_clip.py#L1215",returnDescription:`
<p>The image embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPVisionModel"
>TFCLIPVisionModel</a>.</p>
`,returnType:`
<p>image_features (<code>tf.Tensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),nn=new S({props:{$$slots:{default:[Gv]},$$scope:{ctx:P}}}),sn=new W({props:{anchor:"transformers.TFCLIPModel.get_image_features.example",$$slots:{default:[Rv]},$$scope:{ctx:P}}}),Wa=new J({}),Va=new k({props:{name:"class transformers.TFCLIPTextModel",anchor:"transformers.TFCLIPTextModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_tf_clip.py#L1060"}}),Za=new k({props:{name:"call",anchor:"transformers.TFCLIPTextModel.call",parameters:[{name:"input_ids",val:": TFModelInputType | None = None"},{name:"attention_mask",val:": np.ndarray | tf.Tensor | None = None"},{name:"position_ids",val:": np.ndarray | tf.Tensor | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCLIPTextModel.call.input_ids",description:`<strong>input_ids</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</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.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFCLIPTextModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>np.ndarray</code> or <code>tf.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>`,name:"attention_mask"},{anchor:"transformers.TFCLIPTextModel.call.position_ids",description:`<strong>position_ids</strong> (<code>np.ndarray</code> or <code>tf.Tensor</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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFCLIPTextModel.call.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. This argument can be used only in eager mode, in graph mode the value in the
config will be used instead.`,name:"output_attentions"},{anchor:"transformers.TFCLIPTextModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPTextModel.call.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. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPTextModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_tf_clip.py#L1068",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),rn=new S({props:{$$slots:{default:[Xv]},$$scope:{ctx:P}}}),ln=new W({props:{anchor:"transformers.TFCLIPTextModel.call.example",$$slots:{default:[qv]},$$scope:{ctx:P}}}),Ba=new J({}),Na=new k({props:{name:"class transformers.TFCLIPVisionModel",anchor:"transformers.TFCLIPVisionModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_tf_clip.py#L1112"}}),Ga=new k({props:{name:"call",anchor:"transformers.TFCLIPVisionModel.call",parameters:[{name:"pixel_values",val:": TFModelInputType | None = None"},{name:"output_attentions",val:": Optional[bool] = None"},{name:"output_hidden_states",val:": Optional[bool] = None"},{name:"return_dict",val:": Optional[bool] = None"},{name:"training",val:": Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFCLIPVisionModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>np.ndarray</code>, <code>tf.Tensor</code>, <code>List[tf.Tensor]</code> \`<code>Dict[str, tf.Tensor]</code> or <code>Dict[str, np.ndarray]</code> and each example must have the shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details. output_attentions (<code>bool</code>, <em>optional</em>): Whether or not to
return the attentions tensors of all attention layers. See <code>attentions</code> under returned tensors for more
detail. This argument can be used only in eager mode, in graph mode the value in the config will be used
instead.`,name:"pixel_values"},{anchor:"transformers.TFCLIPVisionModel.call.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. This argument can be used only in eager mode, in graph mode the value in the config will be
used instead.`,name:"output_hidden_states"},{anchor:"transformers.TFCLIPVisionModel.call.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. This argument can be used in
eager mode, in graph mode the value will always be set to True.`,name:"return_dict"},{anchor:"transformers.TFCLIPVisionModel.call.training",description:`<strong>training</strong> (<code>bool</code>, <em>optional</em>, defaults to \`False&#x201C;) &#x2014;
Whether or not to use the model in training mode (some modules like dropout modules have different
behaviors between training and evaluation).`,name:"training"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_tf_clip.py#L1121",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),cn=new S({props:{$$slots:{default:[Av]},$$scope:{ctx:P}}}),pn=new W({props:{anchor:"transformers.TFCLIPVisionModel.call.example",$$slots:{default:[Sv]},$$scope:{ctx:P}}}),Ra=new J({}),Xa=new k({props:{name:"class transformers.FlaxCLIPModel",anchor:"transformers.FlaxCLIPModel",parameters:[{name:"config",val:": CLIPConfig"},{name:"input_shape",val:": typing.Optional[typing.Tuple] = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxCLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig">CLIPConfig</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.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxCLIPModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_flax_clip.py#L1160"}}),Oa=new k({props:{name:"__call__",anchor:"transformers.FlaxCLIPModel.__call__",parameters:[{name:"input_ids",val:""},{name:"pixel_values",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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.FlaxCLIPModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxCLIPModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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>`,name:"attention_mask"},{anchor:"transformers.FlaxCLIPModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.FlaxCLIPModel.__call__.pixel_values",description:`<strong>pixel_values</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlaxCLIPModel.__call__.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.FlaxCLIPModel.__call__.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.FlaxCLIPModel.__call__.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/clip/modeling_flax_clip.py#L789",returnDescription:`
<p>A <code>transformers.models.clip.modeling_flax_clip.FlaxCLIPOutput</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 (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>logits_per_image:(<code>jnp.ndarray</code></strong> of shape <code>(image_batch_size, text_batch_size)</code>) \u2014 The scaled dot product scores between <code>image_embeds</code> and <code>text_embeds</code>. This represents the image-text
similarity scores.</li>
<li><strong>logits_per_text:(<code>jnp.ndarray</code></strong> of shape <code>(text_batch_size, image_batch_size)</code>) \u2014 The scaled dot product scores between <code>text_embeds</code> and <code>image_embeds</code>. This represents the text-image
similarity scores.</li>
<li><strong>text_embeds(<code>jnp.ndarray</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The text embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>jnp.ndarray</code></strong> of shape <code>(batch_size, output_dim</code>) \u2014 The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>FlaxBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>FlaxBaseModelOutputWithPooling</code>):</strong>
The output of the <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.clip.modeling_flax_clip.FlaxCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),hn=new S({props:{$$slots:{default:[Dv]},$$scope:{ctx:P}}}),fn=new W({props:{anchor:"transformers.FlaxCLIPModel.__call__.example",$$slots:{default:[Yv]},$$scope:{ctx:P}}}),Ka=new k({props:{name:"get_text_features",anchor:"transformers.FlaxCLIPModel.get_text_features",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:" = False"}],parametersDescription:[{anchor:"transformers.FlaxCLIPModel.get_text_features.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_flax_clip.py#L834",returnDescription:`
<p>The text embeddings obtained by applying
the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPTextModel"
>FlaxCLIPTextModel</a>.</p>
`,returnType:`
<p>text_features (<code>jnp.ndarray</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),gn=new W({props:{anchor:"transformers.FlaxCLIPModel.get_text_features.example",$$slots:{default:[Hv]},$$scope:{ctx:P}}}),er=new k({props:{name:"get_image_features",anchor:"transformers.FlaxCLIPModel.get_image_features",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:" = False"}],parametersDescription:[{anchor:"transformers.FlaxCLIPModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained
using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_flax_clip.py#L901",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the pooled output of <a
  href="/docs/transformers/main/en/model_doc/clip#transformers.FlaxCLIPVisionModel"
>FlaxCLIPVisionModel</a></p>
`,returnType:`
<p>image_features (<code>jnp.ndarray</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),bn=new W({props:{anchor:"transformers.FlaxCLIPModel.get_image_features.example",$$slots:{default:[Qv]},$$scope:{ctx:P}}}),tr=new J({}),or=new k({props:{name:"class transformers.FlaxCLIPTextModel",anchor:"transformers.FlaxCLIPTextModel",parameters:[{name:"config",val:": CLIPTextConfig"},{name:"input_shape",val:" = (1, 1)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_flax_clip.py#L981"}}),nr=new k({props:{name:"__call__",anchor:"transformers.FlaxCLIPTextModel.__call__",parameters:[{name:"input_ids",val:""},{name:"attention_mask",val:" = None"},{name:"position_ids",val:" = None"},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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.FlaxCLIPTextModel.__call__.input_ids",description:`<strong>input_ids</strong> (<code>numpy.ndarray</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.FlaxCLIPTextModel.__call__.attention_mask",description:`<strong>attention_mask</strong> (<code>numpy.ndarray</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>`,name:"attention_mask"},{anchor:"transformers.FlaxCLIPTextModel.__call__.position_ids",description:`<strong>position_ids</strong> (<code>numpy.ndarray</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.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.FlaxCLIPTextModel.__call__.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.FlaxCLIPTextModel.__call__.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.FlaxCLIPTextModel.__call__.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/clip/modeling_flax_clip.py#L634",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPTextConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Tn=new S({props:{$$slots:{default:[Ov]},$$scope:{ctx:P}}}),vn=new W({props:{anchor:"transformers.FlaxCLIPTextModel.__call__.example",$$slots:{default:[Kv]},$$scope:{ctx:P}}}),sr=new J({}),ar=new k({props:{name:"class transformers.FlaxCLIPVisionModel",anchor:"transformers.FlaxCLIPVisionModel",parameters:[{name:"config",val:": CLIPVisionConfig"},{name:"input_shape",val:": typing.Optional[typing.Tuple] = None"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_flax_clip.py#L1034"}}),rr=new k({props:{name:"__call__",anchor:"transformers.FlaxCLIPVisionModel.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"dropout_rng",val:": PRNGKey = None"},{name:"train",val:": bool = False"},{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.FlaxCLIPVisionModel.__call__.pixel_values",description:`<strong>pixel_values</strong> (<code>numpy.ndarray</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.FlaxCLIPVisionModel.__call__.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.FlaxCLIPVisionModel.__call__.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.FlaxCLIPVisionModel.__call__.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/clip/modeling_flax_clip.py#L714",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.clip.configuration_clip.CLIPVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(jnp.ndarray)</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>jnp.ndarray</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),wn=new S({props:{$$slots:{default:[eM]},$$scope:{ctx:P}}}),In=new W({props:{anchor:"transformers.FlaxCLIPVisionModel.__call__.example",$$slots:{default:[tM]},$$scope:{ctx:P}}}),{c(){d=s("meta"),y=m(),u=s("h1"),p=s("a"),_=s("span"),T(n.$$.fragment),c=m(),$=s("span"),Sn=i("CLIP"),oo=m(),D=s("h2"),pe=s("a"),Ge=s("span"),T(j.$$.fragment),Dn=m(),Ue=s("span"),Yn=i("Overview"),no=m(),te=s("p"),Hn=i("The CLIP model was proposed in "),Fe=s("a"),tt=i("Learning Transferable Visual Models From Natural Language Supervision"),Qn=i(` by Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh,
Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever. CLIP
(Contrastive Language-Image Pre-Training) is a neural network trained on a variety of (image, text) pairs. It can be
instructed in natural language to predict the most relevant text snippet, given an image, without directly optimizing
for the task, similarly to the zero-shot capabilities of GPT-2 and 3.`),so=m(),me=s("p"),On=i("The abstract from the paper is the following:"),ao=m(),he=s("p"),ot=s("em"),Kn=i(`State-of-the-art computer vision systems are trained to predict a fixed set of predetermined object categories. This
restricted form of supervision limits their generality and usability since additional labeled data is needed to specify
any other visual concept. Learning directly from raw text about images is a promising alternative which leverages a
much broader source of supervision. We demonstrate that the simple pre-training task of predicting which caption goes
with which image is an efficient and scalable way to learn SOTA image representations from scratch on a dataset of 400
million (image, text) pairs collected from the internet. After pre-training, natural language is used to reference
learned visual concepts (or describe new ones) enabling zero-shot transfer of the model to downstream tasks. We study
the performance of this approach by benchmarking on over 30 different existing computer vision datasets, spanning tasks
such as OCR, action recognition in videos, geo-localization, and many types of fine-grained object classification. The
model transfers non-trivially to most tasks and is often competitive with a fully supervised baseline without the need
for any dataset specific training. For instance, we match the accuracy of the original ResNet-50 on ImageNet zero-shot
without needing to use any of the 1.28 million training examples it was trained on. We release our code and pre-trained
model weights at this https URL.`),nt=m(),F=s("h2"),N=s("a"),st=s("span"),T(re.$$.fragment),es=m(),at=s("span"),rt=i("Usage"),ro=m(),Re=s("p"),fe=i(`CLIP is a multi-modal vision and language model. It can be used for image-text similarity and for zero-shot image
classification. CLIP uses a ViT like transformer to get visual features and a causal language model to get the text
features. Both the text and visual features are then projected to a latent space with identical dimension. The dot
product between the projected image and text features is then used as a similar score.`),io=m(),oe=s("p"),ts=i(`To feed images to the Transformer encoder, each image is split into a sequence of fixed-size non-overlapping patches,
which are then linearly embedded. A [CLS] token is added to serve as representation of an entire image. The authors
also add absolute position embeddings, and feed the resulting sequence of vectors to a standard Transformer encoder.
The `),Xe=s("a"),it=i("CLIPImageProcessor"),os=i(" can be used to resize (or rescale) and normalize images for the model."),lo=m(),L=s("p"),ns=i("The "),ue=s("a"),ss=i("CLIPTokenizer"),co=i(" is used to encode the text. The "),Y=s("a"),as=i("CLIPProcessor"),We=i(` wraps
`),qe=s("a"),rs=i("CLIPImageProcessor"),x=i(" and "),E=s("a"),ur=i("CLIPTokenizer"),po=i(` into a single instance to both
encode the text and prepare the images. The following example shows how to get the image-text similarity scores using
`),lt=s("a"),gr=i("CLIPProcessor"),X=i(" and "),dt=s("a"),_r=i("CLIPModel"),br=i("."),is=m(),T(Ae.$$.fragment),Ve=m(),q=s("p"),yr=i("This model was contributed by "),Se=s("a"),ct=i("valhalla"),Tr=i(". The original code can be found "),De=s("a"),ls=i("here"),vr=i("."),pt=m(),ge=s("h2"),mo=s("a"),Ji=s("span"),T(ds.$$.fragment),Mp=m(),Ei=s("span"),wp=i("Resources"),Ed=m(),Mr=s("p"),Ip=i("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with CLIP."),zd=m(),ho=s("ul"),cs=s("li"),Cp=i("A blog post on "),ps=s("a"),Pp=i("How to fine-tune CLIP on 10,000 image-text pairs"),$p=i("."),kp=m(),ms=s("li"),xp=i("CLIP is supported by this "),hs=s("a"),Lp=i("example script"),jp=i("."),Ud=m(),wr=s("p"),Jp=i(`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),Fd=m(),mt=s("h2"),fo=s("a"),zi=s("span"),T(fs.$$.fragment),Ep=m(),Ui=s("span"),zp=i("CLIPConfig"),Wd=m(),H=s("div"),T(us.$$.fragment),Up=m(),Ye=s("p"),Ir=s("a"),Fp=i("CLIPConfig"),Wp=i(" is the configuration class to store the configuration of a "),Cr=s("a"),Vp=i("CLIPModel"),Zp=i(`. It is used to instantiate
a CLIP model according to the specified arguments, defining the text model and vision model configs. Instantiating
a configuration with the defaults will yield a similar configuration to that of the CLIP
`),gs=s("a"),Bp=i("openai/clip-vit-base-patch32"),Np=i(" architecture."),Gp=m(),ht=s("p"),Rp=i("Configuration objects inherit from "),Pr=s("a"),Xp=i("PretrainedConfig"),qp=i(` and can be used to control the model outputs. Read the
documentation from `),$r=s("a"),Ap=i("PretrainedConfig"),Sp=i(" for more information."),Dp=m(),T(uo.$$.fragment),Yp=m(),go=s("div"),T(_s.$$.fragment),Hp=m(),bs=s("p"),Qp=i("Instantiate a "),kr=s("a"),Op=i("CLIPConfig"),Kp=i(` (or a derived class) from clip text model configuration and clip vision model
configuration.`),Vd=m(),ft=s("h2"),_o=s("a"),Fi=s("span"),T(ys.$$.fragment),em=m(),Wi=s("span"),tm=i("CLIPTextConfig"),Zd=m(),ie=s("div"),T(Ts.$$.fragment),om=m(),ut=s("p"),nm=i("This is the configuration class to store the configuration of a "),xr=s("a"),sm=i("CLIPTextModel"),am=i(`. It is used to instantiate a CLIP
text encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the text encoder of the CLIP
`),vs=s("a"),rm=i("openai/clip-vit-base-patch32"),im=i(" architecture."),lm=m(),gt=s("p"),dm=i("Configuration objects inherit from "),Lr=s("a"),cm=i("PretrainedConfig"),pm=i(` and can be used to control the model outputs. Read the
documentation from `),jr=s("a"),mm=i("PretrainedConfig"),hm=i(" for more information."),fm=m(),T(bo.$$.fragment),Bd=m(),_t=s("h2"),yo=s("a"),Vi=s("span"),T(Ms.$$.fragment),um=m(),Zi=s("span"),gm=i("CLIPVisionConfig"),Nd=m(),le=s("div"),T(ws.$$.fragment),_m=m(),bt=s("p"),bm=i("This is the configuration class to store the configuration of a "),Jr=s("a"),ym=i("CLIPVisionModel"),Tm=i(`. It is used to instantiate a
CLIP vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the CLIP
`),Is=s("a"),vm=i("openai/clip-vit-base-patch32"),Mm=i(" architecture."),wm=m(),yt=s("p"),Im=i("Configuration objects inherit from "),Er=s("a"),Cm=i("PretrainedConfig"),Pm=i(` and can be used to control the model outputs. Read the
documentation from `),zr=s("a"),$m=i("PretrainedConfig"),km=i(" for more information."),xm=m(),T(To.$$.fragment),Gd=m(),Tt=s("h2"),vo=s("a"),Bi=s("span"),T(Cs.$$.fragment),Lm=m(),Ni=s("span"),jm=i("CLIPTokenizer"),Rd=m(),Z=s("div"),T(Ps.$$.fragment),Jm=m(),Gi=s("p"),Em=i("Construct a CLIP tokenizer. Based on byte-level Byte-Pair-Encoding."),zm=m(),$s=s("p"),Um=i("This tokenizer inherits from "),Ur=s("a"),Fm=i("PreTrainedTokenizer"),Wm=i(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Vm=m(),_e=s("div"),T(ks.$$.fragment),Zm=m(),Ri=s("p"),Bm=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:`),Nm=m(),Xi=s("ul"),Fr=s("li"),Gm=i("single sequence: "),qi=s("code"),Rm=i("<|startoftext|> X <|endoftext|>"),Xm=m(),Ai=s("p"),qm=i("Pairs of sequences are not the expected use case, but they will be handled without a separator."),Am=m(),Mo=s("div"),T(xs.$$.fragment),Sm=m(),Ls=s("p"),Dm=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Si=s("code"),Ym=i("prepare_for_model"),Hm=i(" method."),Qm=m(),wo=s("div"),T(js.$$.fragment),Om=m(),Di=s("p"),Km=i(`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),eh=m(),Wr=s("div"),T(Js.$$.fragment),Xd=m(),vt=s("h2"),Io=s("a"),Yi=s("span"),T(Es.$$.fragment),th=m(),Hi=s("span"),oh=i("CLIPTokenizerFast"),qd=m(),Q=s("div"),T(zs.$$.fragment),nh=m(),Us=s("p"),sh=i("Construct a \u201Cfast\u201D CLIP tokenizer (backed by HuggingFace\u2019s "),Qi=s("em"),ah=i("tokenizers"),rh=i(` library). Based on byte-level
Byte-Pair-Encoding.`),ih=m(),Fs=s("p"),lh=i("This tokenizer inherits from "),Vr=s("a"),dh=i("PreTrainedTokenizerFast"),ch=i(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),ph=m(),be=s("div"),T(Ws.$$.fragment),mh=m(),Oi=s("p"),hh=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:`),fh=m(),Ki=s("ul"),Zr=s("li"),uh=i("single sequence: "),el=s("code"),gh=i("<|startoftext|> X <|endoftext|>"),_h=m(),tl=s("p"),bh=i("Pairs of sequences are not the expected use case, but they will be handled without a separator."),yh=m(),Co=s("div"),T(Vs.$$.fragment),Th=m(),ol=s("p"),vh=i(`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),Ad=m(),Mt=s("h2"),Po=s("a"),nl=s("span"),T(Zs.$$.fragment),Mh=m(),sl=s("span"),wh=i("CLIPImageProcessor"),Sd=m(),Ze=s("div"),T(Bs.$$.fragment),Ih=m(),al=s("p"),Ch=i("Constructs a CLIP image processor."),Ph=m(),$o=s("div"),T(Ns.$$.fragment),$h=m(),rl=s("p"),kh=i("Preprocess an image or batch of images."),Dd=m(),wt=s("h2"),ko=s("a"),il=s("span"),T(Gs.$$.fragment),xh=m(),ll=s("span"),Lh=i("CLIPFeatureExtractor"),Yd=m(),Rs=s("div"),T(Xs.$$.fragment),Hd=m(),It=s("h2"),xo=s("a"),dl=s("span"),T(qs.$$.fragment),jh=m(),cl=s("span"),Jh=i("CLIPProcessor"),Qd=m(),O=s("div"),T(As.$$.fragment),Eh=m(),pl=s("p"),zh=i("Constructs a CLIP processor which wraps a CLIP image processor and a CLIP tokenizer into a single processor."),Uh=m(),ne=s("p"),Br=s("a"),Fh=i("CLIPProcessor"),Wh=i(" offers all the functionalities of "),Nr=s("a"),Vh=i("CLIPImageProcessor"),Zh=i(" and "),Gr=s("a"),Bh=i("CLIPTokenizerFast"),Nh=i(`. See the
`),ml=s("code"),Gh=i("__call__()"),Rh=i(" and "),Rr=s("a"),Xh=i("decode()"),qh=i(" for more information."),Ah=m(),Lo=s("div"),T(Ss.$$.fragment),Sh=m(),Ds=s("p"),Dh=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Xr=s("a"),Yh=i("batch_decode()"),Hh=i(`. Please
refer to the docstring of this method for more information.`),Qh=m(),jo=s("div"),T(Ys.$$.fragment),Oh=m(),Hs=s("p"),Kh=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),qr=s("a"),ef=i("decode()"),tf=i(`. Please refer to
the docstring of this method for more information.`),Od=m(),Ct=s("h2"),Jo=s("a"),hl=s("span"),T(Qs.$$.fragment),of=m(),fl=s("span"),nf=i("CLIPModel"),Kd=m(),G=s("div"),T(Os.$$.fragment),sf=m(),Ks=s("p"),af=i("This model inherits from "),Ar=s("a"),rf=i("PreTrainedModel"),lf=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.)`),df=m(),ea=s("p"),cf=i("This model is also a PyTorch "),ta=s("a"),pf=i("torch.nn.Module"),mf=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hf=m(),ye=s("div"),T(oa.$$.fragment),ff=m(),Pt=s("p"),uf=i("The "),Sr=s("a"),gf=i("CLIPModel"),_f=i(" forward method, overrides the "),ul=s("code"),bf=i("__call__"),yf=i(" special method."),Tf=m(),T(Eo.$$.fragment),vf=m(),T(zo.$$.fragment),Mf=m(),Te=s("div"),T(na.$$.fragment),wf=m(),$t=s("p"),If=i("The "),Dr=s("a"),Cf=i("CLIPModel"),Pf=i(" forward method, overrides the "),gl=s("code"),$f=i("__call__"),kf=i(" special method."),xf=m(),T(Uo.$$.fragment),Lf=m(),T(Fo.$$.fragment),jf=m(),ve=s("div"),T(sa.$$.fragment),Jf=m(),kt=s("p"),Ef=i("The "),Yr=s("a"),zf=i("CLIPModel"),Uf=i(" forward method, overrides the "),_l=s("code"),Ff=i("__call__"),Wf=i(" special method."),Vf=m(),T(Wo.$$.fragment),Zf=m(),T(Vo.$$.fragment),ec=m(),xt=s("h2"),Zo=s("a"),bl=s("span"),T(aa.$$.fragment),Bf=m(),yl=s("span"),Nf=i("CLIPTextModel"),tc=m(),de=s("div"),T(ra.$$.fragment),Gf=m(),ia=s("p"),Rf=i(`The text model from CLIP without any head or projection on top.
This model inherits from `),Hr=s("a"),Xf=i("PreTrainedModel"),qf=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.)`),Af=m(),la=s("p"),Sf=i("This model is also a PyTorch "),da=s("a"),Df=i("torch.nn.Module"),Yf=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hf=m(),Me=s("div"),T(ca.$$.fragment),Qf=m(),Lt=s("p"),Of=i("The "),Qr=s("a"),Kf=i("CLIPTextModel"),eu=i(" forward method, overrides the "),Tl=s("code"),tu=i("__call__"),ou=i(" special method."),nu=m(),T(Bo.$$.fragment),su=m(),T(No.$$.fragment),oc=m(),jt=s("h2"),Go=s("a"),vl=s("span"),T(pa.$$.fragment),au=m(),Ml=s("span"),ru=i("CLIPTextModelWithProjection"),nc=m(),K=s("div"),T(ma.$$.fragment),iu=m(),wl=s("p"),lu=i("CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)."),du=m(),ha=s("p"),cu=i("This model inherits from "),Or=s("a"),pu=i("PreTrainedModel"),mu=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.)`),hu=m(),fa=s("p"),fu=i("This model is also a PyTorch "),ua=s("a"),uu=i("torch.nn.Module"),gu=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_u=m(),we=s("div"),T(ga.$$.fragment),bu=m(),Jt=s("p"),yu=i("The "),Kr=s("a"),Tu=i("CLIPTextModelWithProjection"),vu=i(" forward method, overrides the "),Il=s("code"),Mu=i("__call__"),wu=i(" special method."),Iu=m(),T(Ro.$$.fragment),Cu=m(),T(Xo.$$.fragment),sc=m(),Et=s("h2"),qo=s("a"),Cl=s("span"),T(_a.$$.fragment),Pu=m(),Pl=s("span"),$u=i("CLIPVisionModelWithProjection"),ac=m(),ee=s("div"),T(ba.$$.fragment),ku=m(),$l=s("p"),xu=i("CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)."),Lu=m(),ya=s("p"),ju=i("This model inherits from "),ei=s("a"),Ju=i("PreTrainedModel"),Eu=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.)`),zu=m(),Ta=s("p"),Uu=i("This model is also a PyTorch "),va=s("a"),Fu=i("torch.nn.Module"),Wu=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vu=m(),Ie=s("div"),T(Ma.$$.fragment),Zu=m(),zt=s("p"),Bu=i("The "),ti=s("a"),Nu=i("CLIPVisionModelWithProjection"),Gu=i(" forward method, overrides the "),kl=s("code"),Ru=i("__call__"),Xu=i(" special method."),qu=m(),T(Ao.$$.fragment),Au=m(),T(So.$$.fragment),rc=m(),Ut=s("h2"),Do=s("a"),xl=s("span"),T(wa.$$.fragment),Su=m(),Ll=s("span"),Du=i("CLIPVisionModel"),ic=m(),ce=s("div"),T(Ia.$$.fragment),Yu=m(),Ca=s("p"),Hu=i(`The vision model from CLIP without any head or projection on top.
This model inherits from `),oi=s("a"),Qu=i("PreTrainedModel"),Ou=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.)`),Ku=m(),Pa=s("p"),eg=i("This model is also a PyTorch "),$a=s("a"),tg=i("torch.nn.Module"),og=i(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ng=m(),Ce=s("div"),T(ka.$$.fragment),sg=m(),Ft=s("p"),ag=i("The "),ni=s("a"),rg=i("CLIPVisionModel"),ig=i(" forward method, overrides the "),jl=s("code"),lg=i("__call__"),dg=i(" special method."),cg=m(),T(Yo.$$.fragment),pg=m(),T(Ho.$$.fragment),lc=m(),Wt=s("h2"),Qo=s("a"),Jl=s("span"),T(xa.$$.fragment),mg=m(),El=s("span"),hg=i("TFCLIPModel"),dc=m(),B=s("div"),T(La.$$.fragment),fg=m(),ja=s("p"),ug=i("This model inherits from "),si=s("a"),gg=i("TFPreTrainedModel"),_g=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.)`),bg=m(),Ja=s("p"),yg=i("This model is also a "),Ea=s("a"),Tg=i("tf.keras.Model"),vg=i(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Mg=m(),T(Oo.$$.fragment),wg=m(),Pe=s("div"),T(za.$$.fragment),Ig=m(),Vt=s("p"),Cg=i("The "),ai=s("a"),Pg=i("TFCLIPModel"),$g=i(" forward method, overrides the "),zl=s("code"),kg=i("__call__"),xg=i(" special method."),Lg=m(),T(Ko.$$.fragment),jg=m(),T(en.$$.fragment),Jg=m(),$e=s("div"),T(Ua.$$.fragment),Eg=m(),Zt=s("p"),zg=i("The "),ri=s("a"),Ug=i("TFCLIPModel"),Fg=i(" forward method, overrides the "),Ul=s("code"),Wg=i("__call__"),Vg=i(" special method."),Zg=m(),T(tn.$$.fragment),Bg=m(),T(on.$$.fragment),Ng=m(),ke=s("div"),T(Fa.$$.fragment),Gg=m(),Bt=s("p"),Rg=i("The "),ii=s("a"),Xg=i("TFCLIPModel"),qg=i(" forward method, overrides the "),Fl=s("code"),Ag=i("__call__"),Sg=i(" special method."),Dg=m(),T(nn.$$.fragment),Yg=m(),T(sn.$$.fragment),cc=m(),Nt=s("h2"),an=s("a"),Wl=s("span"),T(Wa.$$.fragment),Hg=m(),Vl=s("span"),Qg=i("TFCLIPTextModel"),pc=m(),Gt=s("div"),T(Va.$$.fragment),Og=m(),xe=s("div"),T(Za.$$.fragment),Kg=m(),Rt=s("p"),e_=i("The "),li=s("a"),t_=i("TFCLIPTextModel"),o_=i(" forward method, overrides the "),Zl=s("code"),n_=i("__call__"),s_=i(" special method."),a_=m(),T(rn.$$.fragment),r_=m(),T(ln.$$.fragment),mc=m(),Xt=s("h2"),dn=s("a"),Bl=s("span"),T(Ba.$$.fragment),i_=m(),Nl=s("span"),l_=i("TFCLIPVisionModel"),hc=m(),qt=s("div"),T(Na.$$.fragment),d_=m(),Le=s("div"),T(Ga.$$.fragment),c_=m(),At=s("p"),p_=i("The "),di=s("a"),m_=i("TFCLIPVisionModel"),h_=i(" forward method, overrides the "),Gl=s("code"),f_=i("__call__"),u_=i(" special method."),g_=m(),T(cn.$$.fragment),__=m(),T(pn.$$.fragment),fc=m(),St=s("h2"),mn=s("a"),Rl=s("span"),T(Ra.$$.fragment),b_=m(),Xl=s("span"),y_=i("FlaxCLIPModel"),uc=m(),z=s("div"),T(Xa.$$.fragment),T_=m(),qa=s("p"),v_=i("This model inherits from "),ci=s("a"),M_=i("FlaxPreTrainedModel"),w_=i(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),I_=m(),Aa=s("p"),C_=i("This model is also a Flax Linen "),Sa=s("a"),P_=i("flax.linen.Module"),$_=i(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),k_=m(),ql=s("p"),x_=i("Finally, this model supports inherent JAX features such as:"),L_=m(),Be=s("ul"),Al=s("li"),Da=s("a"),j_=i("Just-In-Time (JIT) compilation"),J_=m(),Sl=s("li"),Ya=s("a"),E_=i("Automatic Differentiation"),z_=m(),Dl=s("li"),Ha=s("a"),U_=i("Vectorization"),F_=m(),Yl=s("li"),Qa=s("a"),W_=i("Parallelization"),V_=m(),je=s("div"),T(Oa.$$.fragment),Z_=m(),Dt=s("p"),B_=i("The "),Hl=s("code"),N_=i("FlaxCLIPPreTrainedModel"),G_=i(" forward method, overrides the "),Ql=s("code"),R_=i("__call__"),X_=i(" special method."),q_=m(),T(hn.$$.fragment),A_=m(),T(fn.$$.fragment),S_=m(),un=s("div"),T(Ka.$$.fragment),D_=m(),T(gn.$$.fragment),Y_=m(),_n=s("div"),T(er.$$.fragment),H_=m(),T(bn.$$.fragment),gc=m(),Yt=s("h2"),yn=s("a"),Ol=s("span"),T(tr.$$.fragment),Q_=m(),Kl=s("span"),O_=i("FlaxCLIPTextModel"),_c=m(),Ht=s("div"),T(or.$$.fragment),K_=m(),Je=s("div"),T(nr.$$.fragment),eb=m(),Qt=s("p"),tb=i("The "),ed=s("code"),ob=i("FlaxCLIPTextPreTrainedModel"),nb=i(" forward method, overrides the "),td=s("code"),sb=i("__call__"),ab=i(" special method."),rb=m(),T(Tn.$$.fragment),ib=m(),T(vn.$$.fragment),bc=m(),Ot=s("h2"),Mn=s("a"),od=s("span"),T(sr.$$.fragment),lb=m(),nd=s("span"),db=i("FlaxCLIPVisionModel"),yc=m(),Kt=s("div"),T(ar.$$.fragment),cb=m(),Ee=s("div"),T(rr.$$.fragment),pb=m(),eo=s("p"),mb=i("The "),sd=s("code"),hb=i("FlaxCLIPVisionPreTrainedModel"),fb=i(" forward method, overrides the "),ad=s("code"),ub=i("__call__"),gb=i(" special method."),_b=m(),T(wn.$$.fragment),bb=m(),T(In.$$.fragment),this.h()},l(t){const g=bv('[data-svelte="svelte-1phssyn"]',document.head);d=a(g,"META",{name:!0,content:!0}),g.forEach(o),y=h(t),u=a(t,"H1",{class:!0});var ir=r(u);p=a(ir,"A",{id:!0,class:!0,href:!0});var rd=r(p);_=a(rd,"SPAN",{});var id=r(_);v(n.$$.fragment,id),id.forEach(o),rd.forEach(o),c=h(ir),$=a(ir,"SPAN",{});var ld=r($);Sn=l(ld,"CLIP"),ld.forEach(o),ir.forEach(o),oo=h(t),D=a(t,"H2",{class:!0});var lr=r(D);pe=a(lr,"A",{id:!0,class:!0,href:!0});var dd=r(pe);Ge=a(dd,"SPAN",{});var cd=r(Ge);v(j.$$.fragment,cd),cd.forEach(o),dd.forEach(o),Dn=h(lr),Ue=a(lr,"SPAN",{});var pd=r(Ue);Yn=l(pd,"Overview"),pd.forEach(o),lr.forEach(o),no=h(t),te=a(t,"P",{});var dr=r(te);Hn=l(dr,"The CLIP model was proposed in "),Fe=a(dr,"A",{href:!0,rel:!0});var md=r(Fe);tt=l(md,"Learning Transferable Visual Models From Natural Language Supervision"),md.forEach(o),Qn=l(dr,` by Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh,
Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever. CLIP
(Contrastive Language-Image Pre-Training) is a neural network trained on a variety of (image, text) pairs. It can be
instructed in natural language to predict the most relevant text snippet, given an image, without directly optimizing
for the task, similarly to the zero-shot capabilities of GPT-2 and 3.`),dr.forEach(o),so=h(t),me=a(t,"P",{});var hd=r(me);On=l(hd,"The abstract from the paper is the following:"),hd.forEach(o),ao=h(t),he=a(t,"P",{});var fd=r(he);ot=a(fd,"EM",{});var ud=r(ot);Kn=l(ud,`State-of-the-art computer vision systems are trained to predict a fixed set of predetermined object categories. This
restricted form of supervision limits their generality and usability since additional labeled data is needed to specify
any other visual concept. Learning directly from raw text about images is a promising alternative which leverages a
much broader source of supervision. We demonstrate that the simple pre-training task of predicting which caption goes
with which image is an efficient and scalable way to learn SOTA image representations from scratch on a dataset of 400
million (image, text) pairs collected from the internet. After pre-training, natural language is used to reference
learned visual concepts (or describe new ones) enabling zero-shot transfer of the model to downstream tasks. We study
the performance of this approach by benchmarking on over 30 different existing computer vision datasets, spanning tasks
such as OCR, action recognition in videos, geo-localization, and many types of fine-grained object classification. The
model transfers non-trivially to most tasks and is often competitive with a fully supervised baseline without the need
for any dataset specific training. For instance, we match the accuracy of the original ResNet-50 on ImageNet zero-shot
without needing to use any of the 1.28 million training examples it was trained on. We release our code and pre-trained
model weights at this https URL.`),ud.forEach(o),fd.forEach(o),nt=h(t),F=a(t,"H2",{class:!0});var cr=r(F);N=a(cr,"A",{id:!0,class:!0,href:!0});var gd=r(N);st=a(gd,"SPAN",{});var _d=r(st);v(re.$$.fragment,_d),_d.forEach(o),gd.forEach(o),es=h(cr),at=a(cr,"SPAN",{});var bd=r(at);rt=l(bd,"Usage"),bd.forEach(o),cr.forEach(o),ro=h(t),Re=a(t,"P",{});var yd=r(Re);fe=l(yd,`CLIP is a multi-modal vision and language model. It can be used for image-text similarity and for zero-shot image
classification. CLIP uses a ViT like transformer to get visual features and a causal language model to get the text
features. Both the text and visual features are then projected to a latent space with identical dimension. The dot
product between the projected image and text features is then used as a similar score.`),yd.forEach(o),io=h(t),oe=a(t,"P",{});var pr=r(oe);ts=l(pr,`To feed images to the Transformer encoder, each image is split into a sequence of fixed-size non-overlapping patches,
which are then linearly embedded. A [CLS] token is added to serve as representation of an entire image. The authors
also add absolute position embeddings, and feed the resulting sequence of vectors to a standard Transformer encoder.
The `),Xe=a(pr,"A",{href:!0});var Td=r(Xe);it=l(Td,"CLIPImageProcessor"),Td.forEach(o),os=l(pr," can be used to resize (or rescale) and normalize images for the model."),pr.forEach(o),lo=h(t),L=a(t,"P",{});var R=r(L);ns=l(R,"The "),ue=a(R,"A",{href:!0});var vd=r(ue);ss=l(vd,"CLIPTokenizer"),vd.forEach(o),co=l(R," is used to encode the text. The "),Y=a(R,"A",{href:!0});var Md=r(Y);as=l(Md,"CLIPProcessor"),Md.forEach(o),We=l(R,` wraps
`),qe=a(R,"A",{href:!0});var wd=r(qe);rs=l(wd,"CLIPImageProcessor"),wd.forEach(o),x=l(R," and "),E=a(R,"A",{href:!0});var Id=r(E);ur=l(Id,"CLIPTokenizer"),Id.forEach(o),po=l(R,` into a single instance to both
encode the text and prepare the images. The following example shows how to get the image-text similarity scores using
`),lt=a(R,"A",{href:!0});var Cd=r(lt);gr=l(Cd,"CLIPProcessor"),Cd.forEach(o),X=l(R," and "),dt=a(R,"A",{href:!0});var Pd=r(dt);_r=l(Pd,"CLIPModel"),Pd.forEach(o),br=l(R,"."),R.forEach(o),is=h(t),v(Ae.$$.fragment,t),Ve=h(t),q=a(t,"P",{});var to=r(q);yr=l(to,"This model was contributed by "),Se=a(to,"A",{href:!0,rel:!0});var $d=r(Se);ct=l($d,"valhalla"),$d.forEach(o),Tr=l(to,". The original code can be found "),De=a(to,"A",{href:!0,rel:!0});var kd=r(De);ls=l(kd,"here"),kd.forEach(o),vr=l(to,"."),to.forEach(o),pt=h(t),ge=a(t,"H2",{class:!0});var mr=r(ge);mo=a(mr,"A",{id:!0,class:!0,href:!0});var xd=r(mo);Ji=a(xd,"SPAN",{});var Ld=r(Ji);v(ds.$$.fragment,Ld),Ld.forEach(o),xd.forEach(o),Mp=h(mr),Ei=a(mr,"SPAN",{});var jd=r(Ei);wp=l(jd,"Resources"),jd.forEach(o),mr.forEach(o),Ed=h(t),Mr=a(t,"P",{});var Jd=r(Mr);Ip=l(Jd,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with CLIP."),Jd.forEach(o),zd=h(t),ho=a(t,"UL",{});var hr=r(ho);cs=a(hr,"LI",{});var vc=r(cs);Cp=l(vc,"A blog post on "),ps=a(vc,"A",{href:!0,rel:!0});var vb=r(ps);Pp=l(vb,"How to fine-tune CLIP on 10,000 image-text pairs"),vb.forEach(o),$p=l(vc,"."),vc.forEach(o),kp=h(hr),ms=a(hr,"LI",{});var Mc=r(ms);xp=l(Mc,"CLIP is supported by this "),hs=a(Mc,"A",{href:!0,rel:!0});var Mb=r(hs);Lp=l(Mb,"example script"),Mb.forEach(o),jp=l(Mc,"."),Mc.forEach(o),hr.forEach(o),Ud=h(t),wr=a(t,"P",{});var wb=r(wr);Jp=l(wb,`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),wb.forEach(o),Fd=h(t),mt=a(t,"H2",{class:!0});var wc=r(mt);fo=a(wc,"A",{id:!0,class:!0,href:!0});var Ib=r(fo);zi=a(Ib,"SPAN",{});var Cb=r(zi);v(fs.$$.fragment,Cb),Cb.forEach(o),Ib.forEach(o),Ep=h(wc),Ui=a(wc,"SPAN",{});var Pb=r(Ui);zp=l(Pb,"CLIPConfig"),Pb.forEach(o),wc.forEach(o),Wd=h(t),H=a(t,"DIV",{class:!0});var He=r(H);v(us.$$.fragment,He),Up=h(He),Ye=a(He,"P",{});var fr=r(Ye);Ir=a(fr,"A",{href:!0});var $b=r(Ir);Fp=l($b,"CLIPConfig"),$b.forEach(o),Wp=l(fr," is the configuration class to store the configuration of a "),Cr=a(fr,"A",{href:!0});var kb=r(Cr);Vp=l(kb,"CLIPModel"),kb.forEach(o),Zp=l(fr,`. It is used to instantiate
a CLIP model according to the specified arguments, defining the text model and vision model configs. Instantiating
a configuration with the defaults will yield a similar configuration to that of the CLIP
`),gs=a(fr,"A",{href:!0,rel:!0});var xb=r(gs);Bp=l(xb,"openai/clip-vit-base-patch32"),xb.forEach(o),Np=l(fr," architecture."),fr.forEach(o),Gp=h(He),ht=a(He,"P",{});var pi=r(ht);Rp=l(pi,"Configuration objects inherit from "),Pr=a(pi,"A",{href:!0});var Lb=r(Pr);Xp=l(Lb,"PretrainedConfig"),Lb.forEach(o),qp=l(pi,` and can be used to control the model outputs. Read the
documentation from `),$r=a(pi,"A",{href:!0});var jb=r($r);Ap=l(jb,"PretrainedConfig"),jb.forEach(o),Sp=l(pi," for more information."),pi.forEach(o),Dp=h(He),v(uo.$$.fragment,He),Yp=h(He),go=a(He,"DIV",{class:!0});var Ic=r(go);v(_s.$$.fragment,Ic),Hp=h(Ic),bs=a(Ic,"P",{});var Cc=r(bs);Qp=l(Cc,"Instantiate a "),kr=a(Cc,"A",{href:!0});var Jb=r(kr);Op=l(Jb,"CLIPConfig"),Jb.forEach(o),Kp=l(Cc,` (or a derived class) from clip text model configuration and clip vision model
configuration.`),Cc.forEach(o),Ic.forEach(o),He.forEach(o),Vd=h(t),ft=a(t,"H2",{class:!0});var Pc=r(ft);_o=a(Pc,"A",{id:!0,class:!0,href:!0});var Eb=r(_o);Fi=a(Eb,"SPAN",{});var zb=r(Fi);v(ys.$$.fragment,zb),zb.forEach(o),Eb.forEach(o),em=h(Pc),Wi=a(Pc,"SPAN",{});var Ub=r(Wi);tm=l(Ub,"CLIPTextConfig"),Ub.forEach(o),Pc.forEach(o),Zd=h(t),ie=a(t,"DIV",{class:!0});var Cn=r(ie);v(Ts.$$.fragment,Cn),om=h(Cn),ut=a(Cn,"P",{});var mi=r(ut);nm=l(mi,"This is the configuration class to store the configuration of a "),xr=a(mi,"A",{href:!0});var Fb=r(xr);sm=l(Fb,"CLIPTextModel"),Fb.forEach(o),am=l(mi,`. It is used to instantiate a CLIP
text encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the text encoder of the CLIP
`),vs=a(mi,"A",{href:!0,rel:!0});var Wb=r(vs);rm=l(Wb,"openai/clip-vit-base-patch32"),Wb.forEach(o),im=l(mi," architecture."),mi.forEach(o),lm=h(Cn),gt=a(Cn,"P",{});var hi=r(gt);dm=l(hi,"Configuration objects inherit from "),Lr=a(hi,"A",{href:!0});var Vb=r(Lr);cm=l(Vb,"PretrainedConfig"),Vb.forEach(o),pm=l(hi,` and can be used to control the model outputs. Read the
documentation from `),jr=a(hi,"A",{href:!0});var Zb=r(jr);mm=l(Zb,"PretrainedConfig"),Zb.forEach(o),hm=l(hi," for more information."),hi.forEach(o),fm=h(Cn),v(bo.$$.fragment,Cn),Cn.forEach(o),Bd=h(t),_t=a(t,"H2",{class:!0});var $c=r(_t);yo=a($c,"A",{id:!0,class:!0,href:!0});var Bb=r(yo);Vi=a(Bb,"SPAN",{});var Nb=r(Vi);v(Ms.$$.fragment,Nb),Nb.forEach(o),Bb.forEach(o),um=h($c),Zi=a($c,"SPAN",{});var Gb=r(Zi);gm=l(Gb,"CLIPVisionConfig"),Gb.forEach(o),$c.forEach(o),Nd=h(t),le=a(t,"DIV",{class:!0});var Pn=r(le);v(ws.$$.fragment,Pn),_m=h(Pn),bt=a(Pn,"P",{});var fi=r(bt);bm=l(fi,"This is the configuration class to store the configuration of a "),Jr=a(fi,"A",{href:!0});var Rb=r(Jr);ym=l(Rb,"CLIPVisionModel"),Rb.forEach(o),Tm=l(fi,`. It is used to instantiate a
CLIP vision encoder according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the vision encoder of the CLIP
`),Is=a(fi,"A",{href:!0,rel:!0});var Xb=r(Is);vm=l(Xb,"openai/clip-vit-base-patch32"),Xb.forEach(o),Mm=l(fi," architecture."),fi.forEach(o),wm=h(Pn),yt=a(Pn,"P",{});var ui=r(yt);Im=l(ui,"Configuration objects inherit from "),Er=a(ui,"A",{href:!0});var qb=r(Er);Cm=l(qb,"PretrainedConfig"),qb.forEach(o),Pm=l(ui,` and can be used to control the model outputs. Read the
documentation from `),zr=a(ui,"A",{href:!0});var Ab=r(zr);$m=l(Ab,"PretrainedConfig"),Ab.forEach(o),km=l(ui," for more information."),ui.forEach(o),xm=h(Pn),v(To.$$.fragment,Pn),Pn.forEach(o),Gd=h(t),Tt=a(t,"H2",{class:!0});var kc=r(Tt);vo=a(kc,"A",{id:!0,class:!0,href:!0});var Sb=r(vo);Bi=a(Sb,"SPAN",{});var Db=r(Bi);v(Cs.$$.fragment,Db),Db.forEach(o),Sb.forEach(o),Lm=h(kc),Ni=a(kc,"SPAN",{});var Yb=r(Ni);jm=l(Yb,"CLIPTokenizer"),Yb.forEach(o),kc.forEach(o),Rd=h(t),Z=a(t,"DIV",{class:!0});var se=r(Z);v(Ps.$$.fragment,se),Jm=h(se),Gi=a(se,"P",{});var Hb=r(Gi);Em=l(Hb,"Construct a CLIP tokenizer. Based on byte-level Byte-Pair-Encoding."),Hb.forEach(o),zm=h(se),$s=a(se,"P",{});var xc=r($s);Um=l(xc,"This tokenizer inherits from "),Ur=a(xc,"A",{href:!0});var Qb=r(Ur);Fm=l(Qb,"PreTrainedTokenizer"),Qb.forEach(o),Wm=l(xc,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),xc.forEach(o),Vm=h(se),_e=a(se,"DIV",{class:!0});var $n=r(_e);v(ks.$$.fragment,$n),Zm=h($n),Ri=a($n,"P",{});var Ob=r(Ri);Bm=l(Ob,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:`),Ob.forEach(o),Nm=h($n),Xi=a($n,"UL",{});var Kb=r(Xi);Fr=a(Kb,"LI",{});var yb=r(Fr);Gm=l(yb,"single sequence: "),qi=a(yb,"CODE",{});var ey=r(qi);Rm=l(ey,"<|startoftext|> X <|endoftext|>"),ey.forEach(o),yb.forEach(o),Kb.forEach(o),Xm=h($n),Ai=a($n,"P",{});var ty=r(Ai);qm=l(ty,"Pairs of sequences are not the expected use case, but they will be handled without a separator."),ty.forEach(o),$n.forEach(o),Am=h(se),Mo=a(se,"DIV",{class:!0});var Lc=r(Mo);v(xs.$$.fragment,Lc),Sm=h(Lc),Ls=a(Lc,"P",{});var jc=r(Ls);Dm=l(jc,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Si=a(jc,"CODE",{});var oy=r(Si);Ym=l(oy,"prepare_for_model"),oy.forEach(o),Hm=l(jc," method."),jc.forEach(o),Lc.forEach(o),Qm=h(se),wo=a(se,"DIV",{class:!0});var Jc=r(wo);v(js.$$.fragment,Jc),Om=h(Jc),Di=a(Jc,"P",{});var ny=r(Di);Km=l(ny,`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),ny.forEach(o),Jc.forEach(o),eh=h(se),Wr=a(se,"DIV",{class:!0});var sy=r(Wr);v(Js.$$.fragment,sy),sy.forEach(o),se.forEach(o),Xd=h(t),vt=a(t,"H2",{class:!0});var Ec=r(vt);Io=a(Ec,"A",{id:!0,class:!0,href:!0});var ay=r(Io);Yi=a(ay,"SPAN",{});var ry=r(Yi);v(Es.$$.fragment,ry),ry.forEach(o),ay.forEach(o),th=h(Ec),Hi=a(Ec,"SPAN",{});var iy=r(Hi);oh=l(iy,"CLIPTokenizerFast"),iy.forEach(o),Ec.forEach(o),qd=h(t),Q=a(t,"DIV",{class:!0});var Qe=r(Q);v(zs.$$.fragment,Qe),nh=h(Qe),Us=a(Qe,"P",{});var zc=r(Us);sh=l(zc,"Construct a \u201Cfast\u201D CLIP tokenizer (backed by HuggingFace\u2019s "),Qi=a(zc,"EM",{});var ly=r(Qi);ah=l(ly,"tokenizers"),ly.forEach(o),rh=l(zc,` library). Based on byte-level
Byte-Pair-Encoding.`),zc.forEach(o),ih=h(Qe),Fs=a(Qe,"P",{});var Uc=r(Fs);lh=l(Uc,"This tokenizer inherits from "),Vr=a(Uc,"A",{href:!0});var dy=r(Vr);dh=l(dy,"PreTrainedTokenizerFast"),dy.forEach(o),ch=l(Uc,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Uc.forEach(o),ph=h(Qe),be=a(Qe,"DIV",{class:!0});var kn=r(be);v(Ws.$$.fragment,kn),mh=h(kn),Oi=a(kn,"P",{});var cy=r(Oi);hh=l(cy,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:`),cy.forEach(o),fh=h(kn),Ki=a(kn,"UL",{});var py=r(Ki);Zr=a(py,"LI",{});var Tb=r(Zr);uh=l(Tb,"single sequence: "),el=a(Tb,"CODE",{});var my=r(el);gh=l(my,"<|startoftext|> X <|endoftext|>"),my.forEach(o),Tb.forEach(o),py.forEach(o),_h=h(kn),tl=a(kn,"P",{});var hy=r(tl);bh=l(hy,"Pairs of sequences are not the expected use case, but they will be handled without a separator."),hy.forEach(o),kn.forEach(o),yh=h(Qe),Co=a(Qe,"DIV",{class:!0});var Fc=r(Co);v(Vs.$$.fragment,Fc),Th=h(Fc),ol=a(Fc,"P",{});var fy=r(ol);vh=l(fy,`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),fy.forEach(o),Fc.forEach(o),Qe.forEach(o),Ad=h(t),Mt=a(t,"H2",{class:!0});var Wc=r(Mt);Po=a(Wc,"A",{id:!0,class:!0,href:!0});var uy=r(Po);nl=a(uy,"SPAN",{});var gy=r(nl);v(Zs.$$.fragment,gy),gy.forEach(o),uy.forEach(o),Mh=h(Wc),sl=a(Wc,"SPAN",{});var _y=r(sl);wh=l(_y,"CLIPImageProcessor"),_y.forEach(o),Wc.forEach(o),Sd=h(t),Ze=a(t,"DIV",{class:!0});var gi=r(Ze);v(Bs.$$.fragment,gi),Ih=h(gi),al=a(gi,"P",{});var by=r(al);Ch=l(by,"Constructs a CLIP image processor."),by.forEach(o),Ph=h(gi),$o=a(gi,"DIV",{class:!0});var Vc=r($o);v(Ns.$$.fragment,Vc),$h=h(Vc),rl=a(Vc,"P",{});var yy=r(rl);kh=l(yy,"Preprocess an image or batch of images."),yy.forEach(o),Vc.forEach(o),gi.forEach(o),Dd=h(t),wt=a(t,"H2",{class:!0});var Zc=r(wt);ko=a(Zc,"A",{id:!0,class:!0,href:!0});var Ty=r(ko);il=a(Ty,"SPAN",{});var vy=r(il);v(Gs.$$.fragment,vy),vy.forEach(o),Ty.forEach(o),xh=h(Zc),ll=a(Zc,"SPAN",{});var My=r(ll);Lh=l(My,"CLIPFeatureExtractor"),My.forEach(o),Zc.forEach(o),Yd=h(t),Rs=a(t,"DIV",{class:!0});var wy=r(Rs);v(Xs.$$.fragment,wy),wy.forEach(o),Hd=h(t),It=a(t,"H2",{class:!0});var Bc=r(It);xo=a(Bc,"A",{id:!0,class:!0,href:!0});var Iy=r(xo);dl=a(Iy,"SPAN",{});var Cy=r(dl);v(qs.$$.fragment,Cy),Cy.forEach(o),Iy.forEach(o),jh=h(Bc),cl=a(Bc,"SPAN",{});var Py=r(cl);Jh=l(Py,"CLIPProcessor"),Py.forEach(o),Bc.forEach(o),Qd=h(t),O=a(t,"DIV",{class:!0});var Oe=r(O);v(As.$$.fragment,Oe),Eh=h(Oe),pl=a(Oe,"P",{});var $y=r(pl);zh=l($y,"Constructs a CLIP processor which wraps a CLIP image processor and a CLIP tokenizer into a single processor."),$y.forEach(o),Uh=h(Oe),ne=a(Oe,"P",{});var Ne=r(ne);Br=a(Ne,"A",{href:!0});var ky=r(Br);Fh=l(ky,"CLIPProcessor"),ky.forEach(o),Wh=l(Ne," offers all the functionalities of "),Nr=a(Ne,"A",{href:!0});var xy=r(Nr);Vh=l(xy,"CLIPImageProcessor"),xy.forEach(o),Zh=l(Ne," and "),Gr=a(Ne,"A",{href:!0});var Ly=r(Gr);Bh=l(Ly,"CLIPTokenizerFast"),Ly.forEach(o),Nh=l(Ne,`. See the
`),ml=a(Ne,"CODE",{});var jy=r(ml);Gh=l(jy,"__call__()"),jy.forEach(o),Rh=l(Ne," and "),Rr=a(Ne,"A",{href:!0});var Jy=r(Rr);Xh=l(Jy,"decode()"),Jy.forEach(o),qh=l(Ne," for more information."),Ne.forEach(o),Ah=h(Oe),Lo=a(Oe,"DIV",{class:!0});var Nc=r(Lo);v(Ss.$$.fragment,Nc),Sh=h(Nc),Ds=a(Nc,"P",{});var Gc=r(Ds);Dh=l(Gc,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Xr=a(Gc,"A",{href:!0});var Ey=r(Xr);Yh=l(Ey,"batch_decode()"),Ey.forEach(o),Hh=l(Gc,`. Please
refer to the docstring of this method for more information.`),Gc.forEach(o),Nc.forEach(o),Qh=h(Oe),jo=a(Oe,"DIV",{class:!0});var Rc=r(jo);v(Ys.$$.fragment,Rc),Oh=h(Rc),Hs=a(Rc,"P",{});var Xc=r(Hs);Kh=l(Xc,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),qr=a(Xc,"A",{href:!0});var zy=r(qr);ef=l(zy,"decode()"),zy.forEach(o),tf=l(Xc,`. Please refer to
the docstring of this method for more information.`),Xc.forEach(o),Rc.forEach(o),Oe.forEach(o),Od=h(t),Ct=a(t,"H2",{class:!0});var qc=r(Ct);Jo=a(qc,"A",{id:!0,class:!0,href:!0});var Uy=r(Jo);hl=a(Uy,"SPAN",{});var Fy=r(hl);v(Qs.$$.fragment,Fy),Fy.forEach(o),Uy.forEach(o),of=h(qc),fl=a(qc,"SPAN",{});var Wy=r(fl);nf=l(Wy,"CLIPModel"),Wy.forEach(o),qc.forEach(o),Kd=h(t),G=a(t,"DIV",{class:!0});var ze=r(G);v(Os.$$.fragment,ze),sf=h(ze),Ks=a(ze,"P",{});var Ac=r(Ks);af=l(Ac,"This model inherits from "),Ar=a(Ac,"A",{href:!0});var Vy=r(Ar);rf=l(Vy,"PreTrainedModel"),Vy.forEach(o),lf=l(Ac,`. 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.)`),Ac.forEach(o),df=h(ze),ea=a(ze,"P",{});var Sc=r(ea);cf=l(Sc,"This model is also a PyTorch "),ta=a(Sc,"A",{href:!0,rel:!0});var Zy=r(ta);pf=l(Zy,"torch.nn.Module"),Zy.forEach(o),mf=l(Sc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sc.forEach(o),hf=h(ze),ye=a(ze,"DIV",{class:!0});var xn=r(ye);v(oa.$$.fragment,xn),ff=h(xn),Pt=a(xn,"P",{});var _i=r(Pt);uf=l(_i,"The "),Sr=a(_i,"A",{href:!0});var By=r(Sr);gf=l(By,"CLIPModel"),By.forEach(o),_f=l(_i," forward method, overrides the "),ul=a(_i,"CODE",{});var Ny=r(ul);bf=l(Ny,"__call__"),Ny.forEach(o),yf=l(_i," special method."),_i.forEach(o),Tf=h(xn),v(Eo.$$.fragment,xn),vf=h(xn),v(zo.$$.fragment,xn),xn.forEach(o),Mf=h(ze),Te=a(ze,"DIV",{class:!0});var Ln=r(Te);v(na.$$.fragment,Ln),wf=h(Ln),$t=a(Ln,"P",{});var bi=r($t);If=l(bi,"The "),Dr=a(bi,"A",{href:!0});var Gy=r(Dr);Cf=l(Gy,"CLIPModel"),Gy.forEach(o),Pf=l(bi," forward method, overrides the "),gl=a(bi,"CODE",{});var Ry=r(gl);$f=l(Ry,"__call__"),Ry.forEach(o),kf=l(bi," special method."),bi.forEach(o),xf=h(Ln),v(Uo.$$.fragment,Ln),Lf=h(Ln),v(Fo.$$.fragment,Ln),Ln.forEach(o),jf=h(ze),ve=a(ze,"DIV",{class:!0});var jn=r(ve);v(sa.$$.fragment,jn),Jf=h(jn),kt=a(jn,"P",{});var yi=r(kt);Ef=l(yi,"The "),Yr=a(yi,"A",{href:!0});var Xy=r(Yr);zf=l(Xy,"CLIPModel"),Xy.forEach(o),Uf=l(yi," forward method, overrides the "),_l=a(yi,"CODE",{});var qy=r(_l);Ff=l(qy,"__call__"),qy.forEach(o),Wf=l(yi," special method."),yi.forEach(o),Vf=h(jn),v(Wo.$$.fragment,jn),Zf=h(jn),v(Vo.$$.fragment,jn),jn.forEach(o),ze.forEach(o),ec=h(t),xt=a(t,"H2",{class:!0});var Dc=r(xt);Zo=a(Dc,"A",{id:!0,class:!0,href:!0});var Ay=r(Zo);bl=a(Ay,"SPAN",{});var Sy=r(bl);v(aa.$$.fragment,Sy),Sy.forEach(o),Ay.forEach(o),Bf=h(Dc),yl=a(Dc,"SPAN",{});var Dy=r(yl);Nf=l(Dy,"CLIPTextModel"),Dy.forEach(o),Dc.forEach(o),tc=h(t),de=a(t,"DIV",{class:!0});var Jn=r(de);v(ra.$$.fragment,Jn),Gf=h(Jn),ia=a(Jn,"P",{});var Yc=r(ia);Rf=l(Yc,`The text model from CLIP without any head or projection on top.
This model inherits from `),Hr=a(Yc,"A",{href:!0});var Yy=r(Hr);Xf=l(Yy,"PreTrainedModel"),Yy.forEach(o),qf=l(Yc,`. 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.)`),Yc.forEach(o),Af=h(Jn),la=a(Jn,"P",{});var Hc=r(la);Sf=l(Hc,"This model is also a PyTorch "),da=a(Hc,"A",{href:!0,rel:!0});var Hy=r(da);Df=l(Hy,"torch.nn.Module"),Hy.forEach(o),Yf=l(Hc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Hc.forEach(o),Hf=h(Jn),Me=a(Jn,"DIV",{class:!0});var En=r(Me);v(ca.$$.fragment,En),Qf=h(En),Lt=a(En,"P",{});var Ti=r(Lt);Of=l(Ti,"The "),Qr=a(Ti,"A",{href:!0});var Qy=r(Qr);Kf=l(Qy,"CLIPTextModel"),Qy.forEach(o),eu=l(Ti," forward method, overrides the "),Tl=a(Ti,"CODE",{});var Oy=r(Tl);tu=l(Oy,"__call__"),Oy.forEach(o),ou=l(Ti," special method."),Ti.forEach(o),nu=h(En),v(Bo.$$.fragment,En),su=h(En),v(No.$$.fragment,En),En.forEach(o),Jn.forEach(o),oc=h(t),jt=a(t,"H2",{class:!0});var Qc=r(jt);Go=a(Qc,"A",{id:!0,class:!0,href:!0});var Ky=r(Go);vl=a(Ky,"SPAN",{});var eT=r(vl);v(pa.$$.fragment,eT),eT.forEach(o),Ky.forEach(o),au=h(Qc),Ml=a(Qc,"SPAN",{});var tT=r(Ml);ru=l(tT,"CLIPTextModelWithProjection"),tT.forEach(o),Qc.forEach(o),nc=h(t),K=a(t,"DIV",{class:!0});var Ke=r(K);v(ma.$$.fragment,Ke),iu=h(Ke),wl=a(Ke,"P",{});var oT=r(wl);lu=l(oT,"CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)."),oT.forEach(o),du=h(Ke),ha=a(Ke,"P",{});var Oc=r(ha);cu=l(Oc,"This model inherits from "),Or=a(Oc,"A",{href:!0});var nT=r(Or);pu=l(nT,"PreTrainedModel"),nT.forEach(o),mu=l(Oc,`. 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.)`),Oc.forEach(o),hu=h(Ke),fa=a(Ke,"P",{});var Kc=r(fa);fu=l(Kc,"This model is also a PyTorch "),ua=a(Kc,"A",{href:!0,rel:!0});var sT=r(ua);uu=l(sT,"torch.nn.Module"),sT.forEach(o),gu=l(Kc,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kc.forEach(o),_u=h(Ke),we=a(Ke,"DIV",{class:!0});var zn=r(we);v(ga.$$.fragment,zn),bu=h(zn),Jt=a(zn,"P",{});var vi=r(Jt);yu=l(vi,"The "),Kr=a(vi,"A",{href:!0});var aT=r(Kr);Tu=l(aT,"CLIPTextModelWithProjection"),aT.forEach(o),vu=l(vi," forward method, overrides the "),Il=a(vi,"CODE",{});var rT=r(Il);Mu=l(rT,"__call__"),rT.forEach(o),wu=l(vi," special method."),vi.forEach(o),Iu=h(zn),v(Ro.$$.fragment,zn),Cu=h(zn),v(Xo.$$.fragment,zn),zn.forEach(o),Ke.forEach(o),sc=h(t),Et=a(t,"H2",{class:!0});var ep=r(Et);qo=a(ep,"A",{id:!0,class:!0,href:!0});var iT=r(qo);Cl=a(iT,"SPAN",{});var lT=r(Cl);v(_a.$$.fragment,lT),lT.forEach(o),iT.forEach(o),Pu=h(ep),Pl=a(ep,"SPAN",{});var dT=r(Pl);$u=l(dT,"CLIPVisionModelWithProjection"),dT.forEach(o),ep.forEach(o),ac=h(t),ee=a(t,"DIV",{class:!0});var et=r(ee);v(ba.$$.fragment,et),ku=h(et),$l=a(et,"P",{});var cT=r($l);xu=l(cT,"CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)."),cT.forEach(o),Lu=h(et),ya=a(et,"P",{});var tp=r(ya);ju=l(tp,"This model inherits from "),ei=a(tp,"A",{href:!0});var pT=r(ei);Ju=l(pT,"PreTrainedModel"),pT.forEach(o),Eu=l(tp,`. 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.)`),tp.forEach(o),zu=h(et),Ta=a(et,"P",{});var op=r(Ta);Uu=l(op,"This model is also a PyTorch "),va=a(op,"A",{href:!0,rel:!0});var mT=r(va);Fu=l(mT,"torch.nn.Module"),mT.forEach(o),Wu=l(op,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),op.forEach(o),Vu=h(et),Ie=a(et,"DIV",{class:!0});var Un=r(Ie);v(Ma.$$.fragment,Un),Zu=h(Un),zt=a(Un,"P",{});var Mi=r(zt);Bu=l(Mi,"The "),ti=a(Mi,"A",{href:!0});var hT=r(ti);Nu=l(hT,"CLIPVisionModelWithProjection"),hT.forEach(o),Gu=l(Mi," forward method, overrides the "),kl=a(Mi,"CODE",{});var fT=r(kl);Ru=l(fT,"__call__"),fT.forEach(o),Xu=l(Mi," special method."),Mi.forEach(o),qu=h(Un),v(Ao.$$.fragment,Un),Au=h(Un),v(So.$$.fragment,Un),Un.forEach(o),et.forEach(o),rc=h(t),Ut=a(t,"H2",{class:!0});var np=r(Ut);Do=a(np,"A",{id:!0,class:!0,href:!0});var uT=r(Do);xl=a(uT,"SPAN",{});var gT=r(xl);v(wa.$$.fragment,gT),gT.forEach(o),uT.forEach(o),Su=h(np),Ll=a(np,"SPAN",{});var _T=r(Ll);Du=l(_T,"CLIPVisionModel"),_T.forEach(o),np.forEach(o),ic=h(t),ce=a(t,"DIV",{class:!0});var Fn=r(ce);v(Ia.$$.fragment,Fn),Yu=h(Fn),Ca=a(Fn,"P",{});var sp=r(Ca);Hu=l(sp,`The vision model from CLIP without any head or projection on top.
This model inherits from `),oi=a(sp,"A",{href:!0});var bT=r(oi);Qu=l(bT,"PreTrainedModel"),bT.forEach(o),Ou=l(sp,`. 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.)`),sp.forEach(o),Ku=h(Fn),Pa=a(Fn,"P",{});var ap=r(Pa);eg=l(ap,"This model is also a PyTorch "),$a=a(ap,"A",{href:!0,rel:!0});var yT=r($a);tg=l(yT,"torch.nn.Module"),yT.forEach(o),og=l(ap,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ap.forEach(o),ng=h(Fn),Ce=a(Fn,"DIV",{class:!0});var Wn=r(Ce);v(ka.$$.fragment,Wn),sg=h(Wn),Ft=a(Wn,"P",{});var wi=r(Ft);ag=l(wi,"The "),ni=a(wi,"A",{href:!0});var TT=r(ni);rg=l(TT,"CLIPVisionModel"),TT.forEach(o),ig=l(wi," forward method, overrides the "),jl=a(wi,"CODE",{});var vT=r(jl);lg=l(vT,"__call__"),vT.forEach(o),dg=l(wi," special method."),wi.forEach(o),cg=h(Wn),v(Yo.$$.fragment,Wn),pg=h(Wn),v(Ho.$$.fragment,Wn),Wn.forEach(o),Fn.forEach(o),lc=h(t),Wt=a(t,"H2",{class:!0});var rp=r(Wt);Qo=a(rp,"A",{id:!0,class:!0,href:!0});var MT=r(Qo);Jl=a(MT,"SPAN",{});var wT=r(Jl);v(xa.$$.fragment,wT),wT.forEach(o),MT.forEach(o),mg=h(rp),El=a(rp,"SPAN",{});var IT=r(El);hg=l(IT,"TFCLIPModel"),IT.forEach(o),rp.forEach(o),dc=h(t),B=a(t,"DIV",{class:!0});var ae=r(B);v(La.$$.fragment,ae),fg=h(ae),ja=a(ae,"P",{});var ip=r(ja);ug=l(ip,"This model inherits from "),si=a(ip,"A",{href:!0});var CT=r(si);gg=l(CT,"TFPreTrainedModel"),CT.forEach(o),_g=l(ip,`. 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.)`),ip.forEach(o),bg=h(ae),Ja=a(ae,"P",{});var lp=r(Ja);yg=l(lp,"This model is also a "),Ea=a(lp,"A",{href:!0,rel:!0});var PT=r(Ea);Tg=l(PT,"tf.keras.Model"),PT.forEach(o),vg=l(lp,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),lp.forEach(o),Mg=h(ae),v(Oo.$$.fragment,ae),wg=h(ae),Pe=a(ae,"DIV",{class:!0});var Vn=r(Pe);v(za.$$.fragment,Vn),Ig=h(Vn),Vt=a(Vn,"P",{});var Ii=r(Vt);Cg=l(Ii,"The "),ai=a(Ii,"A",{href:!0});var $T=r(ai);Pg=l($T,"TFCLIPModel"),$T.forEach(o),$g=l(Ii," forward method, overrides the "),zl=a(Ii,"CODE",{});var kT=r(zl);kg=l(kT,"__call__"),kT.forEach(o),xg=l(Ii," special method."),Ii.forEach(o),Lg=h(Vn),v(Ko.$$.fragment,Vn),jg=h(Vn),v(en.$$.fragment,Vn),Vn.forEach(o),Jg=h(ae),$e=a(ae,"DIV",{class:!0});var Zn=r($e);v(Ua.$$.fragment,Zn),Eg=h(Zn),Zt=a(Zn,"P",{});var Ci=r(Zt);zg=l(Ci,"The "),ri=a(Ci,"A",{href:!0});var xT=r(ri);Ug=l(xT,"TFCLIPModel"),xT.forEach(o),Fg=l(Ci," forward method, overrides the "),Ul=a(Ci,"CODE",{});var LT=r(Ul);Wg=l(LT,"__call__"),LT.forEach(o),Vg=l(Ci," special method."),Ci.forEach(o),Zg=h(Zn),v(tn.$$.fragment,Zn),Bg=h(Zn),v(on.$$.fragment,Zn),Zn.forEach(o),Ng=h(ae),ke=a(ae,"DIV",{class:!0});var Bn=r(ke);v(Fa.$$.fragment,Bn),Gg=h(Bn),Bt=a(Bn,"P",{});var Pi=r(Bt);Rg=l(Pi,"The "),ii=a(Pi,"A",{href:!0});var jT=r(ii);Xg=l(jT,"TFCLIPModel"),jT.forEach(o),qg=l(Pi," forward method, overrides the "),Fl=a(Pi,"CODE",{});var JT=r(Fl);Ag=l(JT,"__call__"),JT.forEach(o),Sg=l(Pi," special method."),Pi.forEach(o),Dg=h(Bn),v(nn.$$.fragment,Bn),Yg=h(Bn),v(sn.$$.fragment,Bn),Bn.forEach(o),ae.forEach(o),cc=h(t),Nt=a(t,"H2",{class:!0});var dp=r(Nt);an=a(dp,"A",{id:!0,class:!0,href:!0});var ET=r(an);Wl=a(ET,"SPAN",{});var zT=r(Wl);v(Wa.$$.fragment,zT),zT.forEach(o),ET.forEach(o),Hg=h(dp),Vl=a(dp,"SPAN",{});var UT=r(Vl);Qg=l(UT,"TFCLIPTextModel"),UT.forEach(o),dp.forEach(o),pc=h(t),Gt=a(t,"DIV",{class:!0});var cp=r(Gt);v(Va.$$.fragment,cp),Og=h(cp),xe=a(cp,"DIV",{class:!0});var Nn=r(xe);v(Za.$$.fragment,Nn),Kg=h(Nn),Rt=a(Nn,"P",{});var $i=r(Rt);e_=l($i,"The "),li=a($i,"A",{href:!0});var FT=r(li);t_=l(FT,"TFCLIPTextModel"),FT.forEach(o),o_=l($i," forward method, overrides the "),Zl=a($i,"CODE",{});var WT=r(Zl);n_=l(WT,"__call__"),WT.forEach(o),s_=l($i," special method."),$i.forEach(o),a_=h(Nn),v(rn.$$.fragment,Nn),r_=h(Nn),v(ln.$$.fragment,Nn),Nn.forEach(o),cp.forEach(o),mc=h(t),Xt=a(t,"H2",{class:!0});var pp=r(Xt);dn=a(pp,"A",{id:!0,class:!0,href:!0});var VT=r(dn);Bl=a(VT,"SPAN",{});var ZT=r(Bl);v(Ba.$$.fragment,ZT),ZT.forEach(o),VT.forEach(o),i_=h(pp),Nl=a(pp,"SPAN",{});var BT=r(Nl);l_=l(BT,"TFCLIPVisionModel"),BT.forEach(o),pp.forEach(o),hc=h(t),qt=a(t,"DIV",{class:!0});var mp=r(qt);v(Na.$$.fragment,mp),d_=h(mp),Le=a(mp,"DIV",{class:!0});var Gn=r(Le);v(Ga.$$.fragment,Gn),c_=h(Gn),At=a(Gn,"P",{});var ki=r(At);p_=l(ki,"The "),di=a(ki,"A",{href:!0});var NT=r(di);m_=l(NT,"TFCLIPVisionModel"),NT.forEach(o),h_=l(ki," forward method, overrides the "),Gl=a(ki,"CODE",{});var GT=r(Gl);f_=l(GT,"__call__"),GT.forEach(o),u_=l(ki," special method."),ki.forEach(o),g_=h(Gn),v(cn.$$.fragment,Gn),__=h(Gn),v(pn.$$.fragment,Gn),Gn.forEach(o),mp.forEach(o),fc=h(t),St=a(t,"H2",{class:!0});var hp=r(St);mn=a(hp,"A",{id:!0,class:!0,href:!0});var RT=r(mn);Rl=a(RT,"SPAN",{});var XT=r(Rl);v(Ra.$$.fragment,XT),XT.forEach(o),RT.forEach(o),b_=h(hp),Xl=a(hp,"SPAN",{});var qT=r(Xl);y_=l(qT,"FlaxCLIPModel"),qT.forEach(o),hp.forEach(o),uc=h(t),z=a(t,"DIV",{class:!0});var A=r(z);v(Xa.$$.fragment,A),T_=h(A),qa=a(A,"P",{});var fp=r(qa);v_=l(fp,"This model inherits from "),ci=a(fp,"A",{href:!0});var AT=r(ci);M_=l(AT,"FlaxPreTrainedModel"),AT.forEach(o),w_=l(fp,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),fp.forEach(o),I_=h(A),Aa=a(A,"P",{});var up=r(Aa);C_=l(up,"This model is also a Flax Linen "),Sa=a(up,"A",{href:!0,rel:!0});var ST=r(Sa);P_=l(ST,"flax.linen.Module"),ST.forEach(o),$_=l(up,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),up.forEach(o),k_=h(A),ql=a(A,"P",{});var DT=r(ql);x_=l(DT,"Finally, this model supports inherent JAX features such as:"),DT.forEach(o),L_=h(A),Be=a(A,"UL",{});var Rn=r(Be);Al=a(Rn,"LI",{});var YT=r(Al);Da=a(YT,"A",{href:!0,rel:!0});var HT=r(Da);j_=l(HT,"Just-In-Time (JIT) compilation"),HT.forEach(o),YT.forEach(o),J_=h(Rn),Sl=a(Rn,"LI",{});var QT=r(Sl);Ya=a(QT,"A",{href:!0,rel:!0});var OT=r(Ya);E_=l(OT,"Automatic Differentiation"),OT.forEach(o),QT.forEach(o),z_=h(Rn),Dl=a(Rn,"LI",{});var KT=r(Dl);Ha=a(KT,"A",{href:!0,rel:!0});var ev=r(Ha);U_=l(ev,"Vectorization"),ev.forEach(o),KT.forEach(o),F_=h(Rn),Yl=a(Rn,"LI",{});var tv=r(Yl);Qa=a(tv,"A",{href:!0,rel:!0});var ov=r(Qa);W_=l(ov,"Parallelization"),ov.forEach(o),tv.forEach(o),Rn.forEach(o),V_=h(A),je=a(A,"DIV",{class:!0});var Xn=r(je);v(Oa.$$.fragment,Xn),Z_=h(Xn),Dt=a(Xn,"P",{});var xi=r(Dt);B_=l(xi,"The "),Hl=a(xi,"CODE",{});var nv=r(Hl);N_=l(nv,"FlaxCLIPPreTrainedModel"),nv.forEach(o),G_=l(xi," forward method, overrides the "),Ql=a(xi,"CODE",{});var sv=r(Ql);R_=l(sv,"__call__"),sv.forEach(o),X_=l(xi," special method."),xi.forEach(o),q_=h(Xn),v(hn.$$.fragment,Xn),A_=h(Xn),v(fn.$$.fragment,Xn),Xn.forEach(o),S_=h(A),un=a(A,"DIV",{class:!0});var gp=r(un);v(Ka.$$.fragment,gp),D_=h(gp),v(gn.$$.fragment,gp),gp.forEach(o),Y_=h(A),_n=a(A,"DIV",{class:!0});var _p=r(_n);v(er.$$.fragment,_p),H_=h(_p),v(bn.$$.fragment,_p),_p.forEach(o),A.forEach(o),gc=h(t),Yt=a(t,"H2",{class:!0});var bp=r(Yt);yn=a(bp,"A",{id:!0,class:!0,href:!0});var av=r(yn);Ol=a(av,"SPAN",{});var rv=r(Ol);v(tr.$$.fragment,rv),rv.forEach(o),av.forEach(o),Q_=h(bp),Kl=a(bp,"SPAN",{});var iv=r(Kl);O_=l(iv,"FlaxCLIPTextModel"),iv.forEach(o),bp.forEach(o),_c=h(t),Ht=a(t,"DIV",{class:!0});var yp=r(Ht);v(or.$$.fragment,yp),K_=h(yp),Je=a(yp,"DIV",{class:!0});var qn=r(Je);v(nr.$$.fragment,qn),eb=h(qn),Qt=a(qn,"P",{});var Li=r(Qt);tb=l(Li,"The "),ed=a(Li,"CODE",{});var lv=r(ed);ob=l(lv,"FlaxCLIPTextPreTrainedModel"),lv.forEach(o),nb=l(Li," forward method, overrides the "),td=a(Li,"CODE",{});var dv=r(td);sb=l(dv,"__call__"),dv.forEach(o),ab=l(Li," special method."),Li.forEach(o),rb=h(qn),v(Tn.$$.fragment,qn),ib=h(qn),v(vn.$$.fragment,qn),qn.forEach(o),yp.forEach(o),bc=h(t),Ot=a(t,"H2",{class:!0});var Tp=r(Ot);Mn=a(Tp,"A",{id:!0,class:!0,href:!0});var cv=r(Mn);od=a(cv,"SPAN",{});var pv=r(od);v(sr.$$.fragment,pv),pv.forEach(o),cv.forEach(o),lb=h(Tp),nd=a(Tp,"SPAN",{});var mv=r(nd);db=l(mv,"FlaxCLIPVisionModel"),mv.forEach(o),Tp.forEach(o),yc=h(t),Kt=a(t,"DIV",{class:!0});var vp=r(Kt);v(ar.$$.fragment,vp),cb=h(vp),Ee=a(vp,"DIV",{class:!0});var An=r(Ee);v(rr.$$.fragment,An),pb=h(An),eo=a(An,"P",{});var ji=r(eo);mb=l(ji,"The "),sd=a(ji,"CODE",{});var hv=r(sd);hb=l(hv,"FlaxCLIPVisionPreTrainedModel"),hv.forEach(o),fb=l(ji," forward method, overrides the "),ad=a(ji,"CODE",{});var fv=r(ad);ub=l(fv,"__call__"),fv.forEach(o),gb=l(ji," special method."),ji.forEach(o),_b=h(An),v(wn.$$.fragment,An),bb=h(An),v(In.$$.fragment,An),An.forEach(o),vp.forEach(o),this.h()},h(){f(d,"name","hf:doc:metadata"),f(d,"content",JSON.stringify(nM)),f(p,"id","clip"),f(p,"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"),f(p,"href","#clip"),f(u,"class","relative group"),f(pe,"id","overview"),f(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"),f(pe,"href","#overview"),f(D,"class","relative group"),f(Fe,"href","https://arxiv.org/abs/2103.00020"),f(Fe,"rel","nofollow"),f(N,"id","usage"),f(N,"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"),f(N,"href","#usage"),f(F,"class","relative group"),f(Xe,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor"),f(ue,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer"),f(Y,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPProcessor"),f(qe,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor"),f(E,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer"),f(lt,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPProcessor"),f(dt,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPModel"),f(Se,"href","https://huggingface.co/valhalla"),f(Se,"rel","nofollow"),f(De,"href","https://github.com/openai/CLIP"),f(De,"rel","nofollow"),f(mo,"id","resources"),f(mo,"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"),f(mo,"href","#resources"),f(ge,"class","relative group"),f(ps,"href","https://huggingface.co/blog/fine-tune-clip-rsicd"),f(ps,"rel","nofollow"),f(hs,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/contrastive-image-text"),f(hs,"rel","nofollow"),f(fo,"id","transformers.CLIPConfig"),f(fo,"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"),f(fo,"href","#transformers.CLIPConfig"),f(mt,"class","relative group"),f(Ir,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig"),f(Cr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPModel"),f(gs,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f(gs,"rel","nofollow"),f(Pr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f($r,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(kr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPConfig"),f(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(_o,"id","transformers.CLIPTextConfig"),f(_o,"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"),f(_o,"href","#transformers.CLIPTextConfig"),f(ft,"class","relative group"),f(xr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel"),f(vs,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f(vs,"rel","nofollow"),f(Lr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(jr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(yo,"id","transformers.CLIPVisionConfig"),f(yo,"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"),f(yo,"href","#transformers.CLIPVisionConfig"),f(_t,"class","relative group"),f(Jr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModel"),f(Is,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f(Is,"rel","nofollow"),f(Er,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(zr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(vo,"id","transformers.CLIPTokenizer"),f(vo,"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"),f(vo,"href","#transformers.CLIPTokenizer"),f(Tt,"class","relative group"),f(Ur,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),f(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(wo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Wr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Io,"id","transformers.CLIPTokenizerFast"),f(Io,"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"),f(Io,"href","#transformers.CLIPTokenizerFast"),f(vt,"class","relative group"),f(Vr,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),f(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Po,"id","transformers.CLIPImageProcessor"),f(Po,"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"),f(Po,"href","#transformers.CLIPImageProcessor"),f(Mt,"class","relative group"),f($o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ko,"id","transformers.CLIPFeatureExtractor"),f(ko,"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"),f(ko,"href","#transformers.CLIPFeatureExtractor"),f(wt,"class","relative group"),f(Rs,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(xo,"id","transformers.CLIPProcessor"),f(xo,"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"),f(xo,"href","#transformers.CLIPProcessor"),f(It,"class","relative group"),f(Br,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPProcessor"),f(Nr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor"),f(Gr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizerFast"),f(Rr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPProcessor.decode"),f(Xr,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode"),f(Lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(qr,"href","/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode"),f(jo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Jo,"id","transformers.CLIPModel"),f(Jo,"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"),f(Jo,"href","#transformers.CLIPModel"),f(Ct,"class","relative group"),f(Ar,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(ta,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ta,"rel","nofollow"),f(Sr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPModel"),f(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Dr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPModel"),f(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Yr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPModel"),f(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Zo,"id","transformers.CLIPTextModel"),f(Zo,"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"),f(Zo,"href","#transformers.CLIPTextModel"),f(xt,"class","relative group"),f(Hr,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(da,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(da,"rel","nofollow"),f(Qr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel"),f(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Go,"id","transformers.CLIPTextModelWithProjection"),f(Go,"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"),f(Go,"href","#transformers.CLIPTextModelWithProjection"),f(jt,"class","relative group"),f(Or,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(ua,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ua,"rel","nofollow"),f(Kr,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModelWithProjection"),f(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(qo,"id","transformers.CLIPVisionModelWithProjection"),f(qo,"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"),f(qo,"href","#transformers.CLIPVisionModelWithProjection"),f(Et,"class","relative group"),f(ei,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(va,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(va,"rel","nofollow"),f(ti,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModelWithProjection"),f(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Do,"id","transformers.CLIPVisionModel"),f(Do,"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"),f(Do,"href","#transformers.CLIPVisionModel"),f(Ut,"class","relative group"),f(oi,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f($a,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f($a,"rel","nofollow"),f(ni,"href","/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModel"),f(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Qo,"id","transformers.TFCLIPModel"),f(Qo,"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"),f(Qo,"href","#transformers.TFCLIPModel"),f(Wt,"class","relative group"),f(si,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(Ea,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Ea,"rel","nofollow"),f(ai,"href","/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPModel"),f(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ri,"href","/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPModel"),f($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ii,"href","/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPModel"),f(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(an,"id","transformers.TFCLIPTextModel"),f(an,"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"),f(an,"href","#transformers.TFCLIPTextModel"),f(Nt,"class","relative group"),f(li,"href","/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPTextModel"),f(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(dn,"id","transformers.TFCLIPVisionModel"),f(dn,"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"),f(dn,"href","#transformers.TFCLIPVisionModel"),f(Xt,"class","relative group"),f(di,"href","/docs/transformers/main/en/model_doc/clip#transformers.TFCLIPVisionModel"),f(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(qt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(mn,"id","transformers.FlaxCLIPModel"),f(mn,"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"),f(mn,"href","#transformers.FlaxCLIPModel"),f(St,"class","relative group"),f(ci,"href","/docs/transformers/main/en/main_classes/model#transformers.FlaxPreTrainedModel"),f(Sa,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),f(Sa,"rel","nofollow"),f(Da,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),f(Da,"rel","nofollow"),f(Ya,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),f(Ya,"rel","nofollow"),f(Ha,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),f(Ha,"rel","nofollow"),f(Qa,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),f(Qa,"rel","nofollow"),f(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(un,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(_n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(yn,"id","transformers.FlaxCLIPTextModel"),f(yn,"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"),f(yn,"href","#transformers.FlaxCLIPTextModel"),f(Yt,"class","relative group"),f(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Mn,"id","transformers.FlaxCLIPVisionModel"),f(Mn,"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"),f(Mn,"href","#transformers.FlaxCLIPVisionModel"),f(Ot,"class","relative group"),f(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,g){e(document.head,d),b(t,y,g),b(t,u,g),e(u,p),e(p,_),M(n,_,null),e(u,c),e(u,$),e($,Sn),b(t,oo,g),b(t,D,g),e(D,pe),e(pe,Ge),M(j,Ge,null),e(D,Dn),e(D,Ue),e(Ue,Yn),b(t,no,g),b(t,te,g),e(te,Hn),e(te,Fe),e(Fe,tt),e(te,Qn),b(t,so,g),b(t,me,g),e(me,On),b(t,ao,g),b(t,he,g),e(he,ot),e(ot,Kn),b(t,nt,g),b(t,F,g),e(F,N),e(N,st),M(re,st,null),e(F,es),e(F,at),e(at,rt),b(t,ro,g),b(t,Re,g),e(Re,fe),b(t,io,g),b(t,oe,g),e(oe,ts),e(oe,Xe),e(Xe,it),e(oe,os),b(t,lo,g),b(t,L,g),e(L,ns),e(L,ue),e(ue,ss),e(L,co),e(L,Y),e(Y,as),e(L,We),e(L,qe),e(qe,rs),e(L,x),e(L,E),e(E,ur),e(L,po),e(L,lt),e(lt,gr),e(L,X),e(L,dt),e(dt,_r),e(L,br),b(t,is,g),M(Ae,t,g),b(t,Ve,g),b(t,q,g),e(q,yr),e(q,Se),e(Se,ct),e(q,Tr),e(q,De),e(De,ls),e(q,vr),b(t,pt,g),b(t,ge,g),e(ge,mo),e(mo,Ji),M(ds,Ji,null),e(ge,Mp),e(ge,Ei),e(Ei,wp),b(t,Ed,g),b(t,Mr,g),e(Mr,Ip),b(t,zd,g),b(t,ho,g),e(ho,cs),e(cs,Cp),e(cs,ps),e(ps,Pp),e(cs,$p),e(ho,kp),e(ho,ms),e(ms,xp),e(ms,hs),e(hs,Lp),e(ms,jp),b(t,Ud,g),b(t,wr,g),e(wr,Jp),b(t,Fd,g),b(t,mt,g),e(mt,fo),e(fo,zi),M(fs,zi,null),e(mt,Ep),e(mt,Ui),e(Ui,zp),b(t,Wd,g),b(t,H,g),M(us,H,null),e(H,Up),e(H,Ye),e(Ye,Ir),e(Ir,Fp),e(Ye,Wp),e(Ye,Cr),e(Cr,Vp),e(Ye,Zp),e(Ye,gs),e(gs,Bp),e(Ye,Np),e(H,Gp),e(H,ht),e(ht,Rp),e(ht,Pr),e(Pr,Xp),e(ht,qp),e(ht,$r),e($r,Ap),e(ht,Sp),e(H,Dp),M(uo,H,null),e(H,Yp),e(H,go),M(_s,go,null),e(go,Hp),e(go,bs),e(bs,Qp),e(bs,kr),e(kr,Op),e(bs,Kp),b(t,Vd,g),b(t,ft,g),e(ft,_o),e(_o,Fi),M(ys,Fi,null),e(ft,em),e(ft,Wi),e(Wi,tm),b(t,Zd,g),b(t,ie,g),M(Ts,ie,null),e(ie,om),e(ie,ut),e(ut,nm),e(ut,xr),e(xr,sm),e(ut,am),e(ut,vs),e(vs,rm),e(ut,im),e(ie,lm),e(ie,gt),e(gt,dm),e(gt,Lr),e(Lr,cm),e(gt,pm),e(gt,jr),e(jr,mm),e(gt,hm),e(ie,fm),M(bo,ie,null),b(t,Bd,g),b(t,_t,g),e(_t,yo),e(yo,Vi),M(Ms,Vi,null),e(_t,um),e(_t,Zi),e(Zi,gm),b(t,Nd,g),b(t,le,g),M(ws,le,null),e(le,_m),e(le,bt),e(bt,bm),e(bt,Jr),e(Jr,ym),e(bt,Tm),e(bt,Is),e(Is,vm),e(bt,Mm),e(le,wm),e(le,yt),e(yt,Im),e(yt,Er),e(Er,Cm),e(yt,Pm),e(yt,zr),e(zr,$m),e(yt,km),e(le,xm),M(To,le,null),b(t,Gd,g),b(t,Tt,g),e(Tt,vo),e(vo,Bi),M(Cs,Bi,null),e(Tt,Lm),e(Tt,Ni),e(Ni,jm),b(t,Rd,g),b(t,Z,g),M(Ps,Z,null),e(Z,Jm),e(Z,Gi),e(Gi,Em),e(Z,zm),e(Z,$s),e($s,Um),e($s,Ur),e(Ur,Fm),e($s,Wm),e(Z,Vm),e(Z,_e),M(ks,_e,null),e(_e,Zm),e(_e,Ri),e(Ri,Bm),e(_e,Nm),e(_e,Xi),e(Xi,Fr),e(Fr,Gm),e(Fr,qi),e(qi,Rm),e(_e,Xm),e(_e,Ai),e(Ai,qm),e(Z,Am),e(Z,Mo),M(xs,Mo,null),e(Mo,Sm),e(Mo,Ls),e(Ls,Dm),e(Ls,Si),e(Si,Ym),e(Ls,Hm),e(Z,Qm),e(Z,wo),M(js,wo,null),e(wo,Om),e(wo,Di),e(Di,Km),e(Z,eh),e(Z,Wr),M(Js,Wr,null),b(t,Xd,g),b(t,vt,g),e(vt,Io),e(Io,Yi),M(Es,Yi,null),e(vt,th),e(vt,Hi),e(Hi,oh),b(t,qd,g),b(t,Q,g),M(zs,Q,null),e(Q,nh),e(Q,Us),e(Us,sh),e(Us,Qi),e(Qi,ah),e(Us,rh),e(Q,ih),e(Q,Fs),e(Fs,lh),e(Fs,Vr),e(Vr,dh),e(Fs,ch),e(Q,ph),e(Q,be),M(Ws,be,null),e(be,mh),e(be,Oi),e(Oi,hh),e(be,fh),e(be,Ki),e(Ki,Zr),e(Zr,uh),e(Zr,el),e(el,gh),e(be,_h),e(be,tl),e(tl,bh),e(Q,yh),e(Q,Co),M(Vs,Co,null),e(Co,Th),e(Co,ol),e(ol,vh),b(t,Ad,g),b(t,Mt,g),e(Mt,Po),e(Po,nl),M(Zs,nl,null),e(Mt,Mh),e(Mt,sl),e(sl,wh),b(t,Sd,g),b(t,Ze,g),M(Bs,Ze,null),e(Ze,Ih),e(Ze,al),e(al,Ch),e(Ze,Ph),e(Ze,$o),M(Ns,$o,null),e($o,$h),e($o,rl),e(rl,kh),b(t,Dd,g),b(t,wt,g),e(wt,ko),e(ko,il),M(Gs,il,null),e(wt,xh),e(wt,ll),e(ll,Lh),b(t,Yd,g),b(t,Rs,g),M(Xs,Rs,null),b(t,Hd,g),b(t,It,g),e(It,xo),e(xo,dl),M(qs,dl,null),e(It,jh),e(It,cl),e(cl,Jh),b(t,Qd,g),b(t,O,g),M(As,O,null),e(O,Eh),e(O,pl),e(pl,zh),e(O,Uh),e(O,ne),e(ne,Br),e(Br,Fh),e(ne,Wh),e(ne,Nr),e(Nr,Vh),e(ne,Zh),e(ne,Gr),e(Gr,Bh),e(ne,Nh),e(ne,ml),e(ml,Gh),e(ne,Rh),e(ne,Rr),e(Rr,Xh),e(ne,qh),e(O,Ah),e(O,Lo),M(Ss,Lo,null),e(Lo,Sh),e(Lo,Ds),e(Ds,Dh),e(Ds,Xr),e(Xr,Yh),e(Ds,Hh),e(O,Qh),e(O,jo),M(Ys,jo,null),e(jo,Oh),e(jo,Hs),e(Hs,Kh),e(Hs,qr),e(qr,ef),e(Hs,tf),b(t,Od,g),b(t,Ct,g),e(Ct,Jo),e(Jo,hl),M(Qs,hl,null),e(Ct,of),e(Ct,fl),e(fl,nf),b(t,Kd,g),b(t,G,g),M(Os,G,null),e(G,sf),e(G,Ks),e(Ks,af),e(Ks,Ar),e(Ar,rf),e(Ks,lf),e(G,df),e(G,ea),e(ea,cf),e(ea,ta),e(ta,pf),e(ea,mf),e(G,hf),e(G,ye),M(oa,ye,null),e(ye,ff),e(ye,Pt),e(Pt,uf),e(Pt,Sr),e(Sr,gf),e(Pt,_f),e(Pt,ul),e(ul,bf),e(Pt,yf),e(ye,Tf),M(Eo,ye,null),e(ye,vf),M(zo,ye,null),e(G,Mf),e(G,Te),M(na,Te,null),e(Te,wf),e(Te,$t),e($t,If),e($t,Dr),e(Dr,Cf),e($t,Pf),e($t,gl),e(gl,$f),e($t,kf),e(Te,xf),M(Uo,Te,null),e(Te,Lf),M(Fo,Te,null),e(G,jf),e(G,ve),M(sa,ve,null),e(ve,Jf),e(ve,kt),e(kt,Ef),e(kt,Yr),e(Yr,zf),e(kt,Uf),e(kt,_l),e(_l,Ff),e(kt,Wf),e(ve,Vf),M(Wo,ve,null),e(ve,Zf),M(Vo,ve,null),b(t,ec,g),b(t,xt,g),e(xt,Zo),e(Zo,bl),M(aa,bl,null),e(xt,Bf),e(xt,yl),e(yl,Nf),b(t,tc,g),b(t,de,g),M(ra,de,null),e(de,Gf),e(de,ia),e(ia,Rf),e(ia,Hr),e(Hr,Xf),e(ia,qf),e(de,Af),e(de,la),e(la,Sf),e(la,da),e(da,Df),e(la,Yf),e(de,Hf),e(de,Me),M(ca,Me,null),e(Me,Qf),e(Me,Lt),e(Lt,Of),e(Lt,Qr),e(Qr,Kf),e(Lt,eu),e(Lt,Tl),e(Tl,tu),e(Lt,ou),e(Me,nu),M(Bo,Me,null),e(Me,su),M(No,Me,null),b(t,oc,g),b(t,jt,g),e(jt,Go),e(Go,vl),M(pa,vl,null),e(jt,au),e(jt,Ml),e(Ml,ru),b(t,nc,g),b(t,K,g),M(ma,K,null),e(K,iu),e(K,wl),e(wl,lu),e(K,du),e(K,ha),e(ha,cu),e(ha,Or),e(Or,pu),e(ha,mu),e(K,hu),e(K,fa),e(fa,fu),e(fa,ua),e(ua,uu),e(fa,gu),e(K,_u),e(K,we),M(ga,we,null),e(we,bu),e(we,Jt),e(Jt,yu),e(Jt,Kr),e(Kr,Tu),e(Jt,vu),e(Jt,Il),e(Il,Mu),e(Jt,wu),e(we,Iu),M(Ro,we,null),e(we,Cu),M(Xo,we,null),b(t,sc,g),b(t,Et,g),e(Et,qo),e(qo,Cl),M(_a,Cl,null),e(Et,Pu),e(Et,Pl),e(Pl,$u),b(t,ac,g),b(t,ee,g),M(ba,ee,null),e(ee,ku),e(ee,$l),e($l,xu),e(ee,Lu),e(ee,ya),e(ya,ju),e(ya,ei),e(ei,Ju),e(ya,Eu),e(ee,zu),e(ee,Ta),e(Ta,Uu),e(Ta,va),e(va,Fu),e(Ta,Wu),e(ee,Vu),e(ee,Ie),M(Ma,Ie,null),e(Ie,Zu),e(Ie,zt),e(zt,Bu),e(zt,ti),e(ti,Nu),e(zt,Gu),e(zt,kl),e(kl,Ru),e(zt,Xu),e(Ie,qu),M(Ao,Ie,null),e(Ie,Au),M(So,Ie,null),b(t,rc,g),b(t,Ut,g),e(Ut,Do),e(Do,xl),M(wa,xl,null),e(Ut,Su),e(Ut,Ll),e(Ll,Du),b(t,ic,g),b(t,ce,g),M(Ia,ce,null),e(ce,Yu),e(ce,Ca),e(Ca,Hu),e(Ca,oi),e(oi,Qu),e(Ca,Ou),e(ce,Ku),e(ce,Pa),e(Pa,eg),e(Pa,$a),e($a,tg),e(Pa,og),e(ce,ng),e(ce,Ce),M(ka,Ce,null),e(Ce,sg),e(Ce,Ft),e(Ft,ag),e(Ft,ni),e(ni,rg),e(Ft,ig),e(Ft,jl),e(jl,lg),e(Ft,dg),e(Ce,cg),M(Yo,Ce,null),e(Ce,pg),M(Ho,Ce,null),b(t,lc,g),b(t,Wt,g),e(Wt,Qo),e(Qo,Jl),M(xa,Jl,null),e(Wt,mg),e(Wt,El),e(El,hg),b(t,dc,g),b(t,B,g),M(La,B,null),e(B,fg),e(B,ja),e(ja,ug),e(ja,si),e(si,gg),e(ja,_g),e(B,bg),e(B,Ja),e(Ja,yg),e(Ja,Ea),e(Ea,Tg),e(Ja,vg),e(B,Mg),M(Oo,B,null),e(B,wg),e(B,Pe),M(za,Pe,null),e(Pe,Ig),e(Pe,Vt),e(Vt,Cg),e(Vt,ai),e(ai,Pg),e(Vt,$g),e(Vt,zl),e(zl,kg),e(Vt,xg),e(Pe,Lg),M(Ko,Pe,null),e(Pe,jg),M(en,Pe,null),e(B,Jg),e(B,$e),M(Ua,$e,null),e($e,Eg),e($e,Zt),e(Zt,zg),e(Zt,ri),e(ri,Ug),e(Zt,Fg),e(Zt,Ul),e(Ul,Wg),e(Zt,Vg),e($e,Zg),M(tn,$e,null),e($e,Bg),M(on,$e,null),e(B,Ng),e(B,ke),M(Fa,ke,null),e(ke,Gg),e(ke,Bt),e(Bt,Rg),e(Bt,ii),e(ii,Xg),e(Bt,qg),e(Bt,Fl),e(Fl,Ag),e(Bt,Sg),e(ke,Dg),M(nn,ke,null),e(ke,Yg),M(sn,ke,null),b(t,cc,g),b(t,Nt,g),e(Nt,an),e(an,Wl),M(Wa,Wl,null),e(Nt,Hg),e(Nt,Vl),e(Vl,Qg),b(t,pc,g),b(t,Gt,g),M(Va,Gt,null),e(Gt,Og),e(Gt,xe),M(Za,xe,null),e(xe,Kg),e(xe,Rt),e(Rt,e_),e(Rt,li),e(li,t_),e(Rt,o_),e(Rt,Zl),e(Zl,n_),e(Rt,s_),e(xe,a_),M(rn,xe,null),e(xe,r_),M(ln,xe,null),b(t,mc,g),b(t,Xt,g),e(Xt,dn),e(dn,Bl),M(Ba,Bl,null),e(Xt,i_),e(Xt,Nl),e(Nl,l_),b(t,hc,g),b(t,qt,g),M(Na,qt,null),e(qt,d_),e(qt,Le),M(Ga,Le,null),e(Le,c_),e(Le,At),e(At,p_),e(At,di),e(di,m_),e(At,h_),e(At,Gl),e(Gl,f_),e(At,u_),e(Le,g_),M(cn,Le,null),e(Le,__),M(pn,Le,null),b(t,fc,g),b(t,St,g),e(St,mn),e(mn,Rl),M(Ra,Rl,null),e(St,b_),e(St,Xl),e(Xl,y_),b(t,uc,g),b(t,z,g),M(Xa,z,null),e(z,T_),e(z,qa),e(qa,v_),e(qa,ci),e(ci,M_),e(qa,w_),e(z,I_),e(z,Aa),e(Aa,C_),e(Aa,Sa),e(Sa,P_),e(Aa,$_),e(z,k_),e(z,ql),e(ql,x_),e(z,L_),e(z,Be),e(Be,Al),e(Al,Da),e(Da,j_),e(Be,J_),e(Be,Sl),e(Sl,Ya),e(Ya,E_),e(Be,z_),e(Be,Dl),e(Dl,Ha),e(Ha,U_),e(Be,F_),e(Be,Yl),e(Yl,Qa),e(Qa,W_),e(z,V_),e(z,je),M(Oa,je,null),e(je,Z_),e(je,Dt),e(Dt,B_),e(Dt,Hl),e(Hl,N_),e(Dt,G_),e(Dt,Ql),e(Ql,R_),e(Dt,X_),e(je,q_),M(hn,je,null),e(je,A_),M(fn,je,null),e(z,S_),e(z,un),M(Ka,un,null),e(un,D_),M(gn,un,null),e(z,Y_),e(z,_n),M(er,_n,null),e(_n,H_),M(bn,_n,null),b(t,gc,g),b(t,Yt,g),e(Yt,yn),e(yn,Ol),M(tr,Ol,null),e(Yt,Q_),e(Yt,Kl),e(Kl,O_),b(t,_c,g),b(t,Ht,g),M(or,Ht,null),e(Ht,K_),e(Ht,Je),M(nr,Je,null),e(Je,eb),e(Je,Qt),e(Qt,tb),e(Qt,ed),e(ed,ob),e(Qt,nb),e(Qt,td),e(td,sb),e(Qt,ab),e(Je,rb),M(Tn,Je,null),e(Je,ib),M(vn,Je,null),b(t,bc,g),b(t,Ot,g),e(Ot,Mn),e(Mn,od),M(sr,od,null),e(Ot,lb),e(Ot,nd),e(nd,db),b(t,yc,g),b(t,Kt,g),M(ar,Kt,null),e(Kt,cb),e(Kt,Ee),M(rr,Ee,null),e(Ee,pb),e(Ee,eo),e(eo,mb),e(eo,sd),e(sd,hb),e(eo,fb),e(eo,ad),e(ad,ub),e(eo,gb),e(Ee,_b),M(wn,Ee,null),e(Ee,bb),M(In,Ee,null),Tc=!0},p(t,[g]){const ir={};g&2&&(ir.$$scope={dirty:g,ctx:t}),uo.$set(ir);const rd={};g&2&&(rd.$$scope={dirty:g,ctx:t}),bo.$set(rd);const id={};g&2&&(id.$$scope={dirty:g,ctx:t}),To.$set(id);const ld={};g&2&&(ld.$$scope={dirty:g,ctx:t}),Eo.$set(ld);const lr={};g&2&&(lr.$$scope={dirty:g,ctx:t}),zo.$set(lr);const dd={};g&2&&(dd.$$scope={dirty:g,ctx:t}),Uo.$set(dd);const cd={};g&2&&(cd.$$scope={dirty:g,ctx:t}),Fo.$set(cd);const pd={};g&2&&(pd.$$scope={dirty:g,ctx:t}),Wo.$set(pd);const dr={};g&2&&(dr.$$scope={dirty:g,ctx:t}),Vo.$set(dr);const md={};g&2&&(md.$$scope={dirty:g,ctx:t}),Bo.$set(md);const hd={};g&2&&(hd.$$scope={dirty:g,ctx:t}),No.$set(hd);const fd={};g&2&&(fd.$$scope={dirty:g,ctx:t}),Ro.$set(fd);const ud={};g&2&&(ud.$$scope={dirty:g,ctx:t}),Xo.$set(ud);const cr={};g&2&&(cr.$$scope={dirty:g,ctx:t}),Ao.$set(cr);const gd={};g&2&&(gd.$$scope={dirty:g,ctx:t}),So.$set(gd);const _d={};g&2&&(_d.$$scope={dirty:g,ctx:t}),Yo.$set(_d);const bd={};g&2&&(bd.$$scope={dirty:g,ctx:t}),Ho.$set(bd);const yd={};g&2&&(yd.$$scope={dirty:g,ctx:t}),Oo.$set(yd);const pr={};g&2&&(pr.$$scope={dirty:g,ctx:t}),Ko.$set(pr);const Td={};g&2&&(Td.$$scope={dirty:g,ctx:t}),en.$set(Td);const R={};g&2&&(R.$$scope={dirty:g,ctx:t}),tn.$set(R);const vd={};g&2&&(vd.$$scope={dirty:g,ctx:t}),on.$set(vd);const Md={};g&2&&(Md.$$scope={dirty:g,ctx:t}),nn.$set(Md);const wd={};g&2&&(wd.$$scope={dirty:g,ctx:t}),sn.$set(wd);const Id={};g&2&&(Id.$$scope={dirty:g,ctx:t}),rn.$set(Id);const Cd={};g&2&&(Cd.$$scope={dirty:g,ctx:t}),ln.$set(Cd);const Pd={};g&2&&(Pd.$$scope={dirty:g,ctx:t}),cn.$set(Pd);const to={};g&2&&(to.$$scope={dirty:g,ctx:t}),pn.$set(to);const $d={};g&2&&($d.$$scope={dirty:g,ctx:t}),hn.$set($d);const kd={};g&2&&(kd.$$scope={dirty:g,ctx:t}),fn.$set(kd);const mr={};g&2&&(mr.$$scope={dirty:g,ctx:t}),gn.$set(mr);const xd={};g&2&&(xd.$$scope={dirty:g,ctx:t}),bn.$set(xd);const Ld={};g&2&&(Ld.$$scope={dirty:g,ctx:t}),Tn.$set(Ld);const jd={};g&2&&(jd.$$scope={dirty:g,ctx:t}),vn.$set(jd);const Jd={};g&2&&(Jd.$$scope={dirty:g,ctx:t}),wn.$set(Jd);const hr={};g&2&&(hr.$$scope={dirty:g,ctx:t}),In.$set(hr)},i(t){Tc||(w(n.$$.fragment,t),w(j.$$.fragment,t),w(re.$$.fragment,t),w(Ae.$$.fragment,t),w(ds.$$.fragment,t),w(fs.$$.fragment,t),w(us.$$.fragment,t),w(uo.$$.fragment,t),w(_s.$$.fragment,t),w(ys.$$.fragment,t),w(Ts.$$.fragment,t),w(bo.$$.fragment,t),w(Ms.$$.fragment,t),w(ws.$$.fragment,t),w(To.$$.fragment,t),w(Cs.$$.fragment,t),w(Ps.$$.fragment,t),w(ks.$$.fragment,t),w(xs.$$.fragment,t),w(js.$$.fragment,t),w(Js.$$.fragment,t),w(Es.$$.fragment,t),w(zs.$$.fragment,t),w(Ws.$$.fragment,t),w(Vs.$$.fragment,t),w(Zs.$$.fragment,t),w(Bs.$$.fragment,t),w(Ns.$$.fragment,t),w(Gs.$$.fragment,t),w(Xs.$$.fragment,t),w(qs.$$.fragment,t),w(As.$$.fragment,t),w(Ss.$$.fragment,t),w(Ys.$$.fragment,t),w(Qs.$$.fragment,t),w(Os.$$.fragment,t),w(oa.$$.fragment,t),w(Eo.$$.fragment,t),w(zo.$$.fragment,t),w(na.$$.fragment,t),w(Uo.$$.fragment,t),w(Fo.$$.fragment,t),w(sa.$$.fragment,t),w(Wo.$$.fragment,t),w(Vo.$$.fragment,t),w(aa.$$.fragment,t),w(ra.$$.fragment,t),w(ca.$$.fragment,t),w(Bo.$$.fragment,t),w(No.$$.fragment,t),w(pa.$$.fragment,t),w(ma.$$.fragment,t),w(ga.$$.fragment,t),w(Ro.$$.fragment,t),w(Xo.$$.fragment,t),w(_a.$$.fragment,t),w(ba.$$.fragment,t),w(Ma.$$.fragment,t),w(Ao.$$.fragment,t),w(So.$$.fragment,t),w(wa.$$.fragment,t),w(Ia.$$.fragment,t),w(ka.$$.fragment,t),w(Yo.$$.fragment,t),w(Ho.$$.fragment,t),w(xa.$$.fragment,t),w(La.$$.fragment,t),w(Oo.$$.fragment,t),w(za.$$.fragment,t),w(Ko.$$.fragment,t),w(en.$$.fragment,t),w(Ua.$$.fragment,t),w(tn.$$.fragment,t),w(on.$$.fragment,t),w(Fa.$$.fragment,t),w(nn.$$.fragment,t),w(sn.$$.fragment,t),w(Wa.$$.fragment,t),w(Va.$$.fragment,t),w(Za.$$.fragment,t),w(rn.$$.fragment,t),w(ln.$$.fragment,t),w(Ba.$$.fragment,t),w(Na.$$.fragment,t),w(Ga.$$.fragment,t),w(cn.$$.fragment,t),w(pn.$$.fragment,t),w(Ra.$$.fragment,t),w(Xa.$$.fragment,t),w(Oa.$$.fragment,t),w(hn.$$.fragment,t),w(fn.$$.fragment,t),w(Ka.$$.fragment,t),w(gn.$$.fragment,t),w(er.$$.fragment,t),w(bn.$$.fragment,t),w(tr.$$.fragment,t),w(or.$$.fragment,t),w(nr.$$.fragment,t),w(Tn.$$.fragment,t),w(vn.$$.fragment,t),w(sr.$$.fragment,t),w(ar.$$.fragment,t),w(rr.$$.fragment,t),w(wn.$$.fragment,t),w(In.$$.fragment,t),Tc=!0)},o(t){I(n.$$.fragment,t),I(j.$$.fragment,t),I(re.$$.fragment,t),I(Ae.$$.fragment,t),I(ds.$$.fragment,t),I(fs.$$.fragment,t),I(us.$$.fragment,t),I(uo.$$.fragment,t),I(_s.$$.fragment,t),I(ys.$$.fragment,t),I(Ts.$$.fragment,t),I(bo.$$.fragment,t),I(Ms.$$.fragment,t),I(ws.$$.fragment,t),I(To.$$.fragment,t),I(Cs.$$.fragment,t),I(Ps.$$.fragment,t),I(ks.$$.fragment,t),I(xs.$$.fragment,t),I(js.$$.fragment,t),I(Js.$$.fragment,t),I(Es.$$.fragment,t),I(zs.$$.fragment,t),I(Ws.$$.fragment,t),I(Vs.$$.fragment,t),I(Zs.$$.fragment,t),I(Bs.$$.fragment,t),I(Ns.$$.fragment,t),I(Gs.$$.fragment,t),I(Xs.$$.fragment,t),I(qs.$$.fragment,t),I(As.$$.fragment,t),I(Ss.$$.fragment,t),I(Ys.$$.fragment,t),I(Qs.$$.fragment,t),I(Os.$$.fragment,t),I(oa.$$.fragment,t),I(Eo.$$.fragment,t),I(zo.$$.fragment,t),I(na.$$.fragment,t),I(Uo.$$.fragment,t),I(Fo.$$.fragment,t),I(sa.$$.fragment,t),I(Wo.$$.fragment,t),I(Vo.$$.fragment,t),I(aa.$$.fragment,t),I(ra.$$.fragment,t),I(ca.$$.fragment,t),I(Bo.$$.fragment,t),I(No.$$.fragment,t),I(pa.$$.fragment,t),I(ma.$$.fragment,t),I(ga.$$.fragment,t),I(Ro.$$.fragment,t),I(Xo.$$.fragment,t),I(_a.$$.fragment,t),I(ba.$$.fragment,t),I(Ma.$$.fragment,t),I(Ao.$$.fragment,t),I(So.$$.fragment,t),I(wa.$$.fragment,t),I(Ia.$$.fragment,t),I(ka.$$.fragment,t),I(Yo.$$.fragment,t),I(Ho.$$.fragment,t),I(xa.$$.fragment,t),I(La.$$.fragment,t),I(Oo.$$.fragment,t),I(za.$$.fragment,t),I(Ko.$$.fragment,t),I(en.$$.fragment,t),I(Ua.$$.fragment,t),I(tn.$$.fragment,t),I(on.$$.fragment,t),I(Fa.$$.fragment,t),I(nn.$$.fragment,t),I(sn.$$.fragment,t),I(Wa.$$.fragment,t),I(Va.$$.fragment,t),I(Za.$$.fragment,t),I(rn.$$.fragment,t),I(ln.$$.fragment,t),I(Ba.$$.fragment,t),I(Na.$$.fragment,t),I(Ga.$$.fragment,t),I(cn.$$.fragment,t),I(pn.$$.fragment,t),I(Ra.$$.fragment,t),I(Xa.$$.fragment,t),I(Oa.$$.fragment,t),I(hn.$$.fragment,t),I(fn.$$.fragment,t),I(Ka.$$.fragment,t),I(gn.$$.fragment,t),I(er.$$.fragment,t),I(bn.$$.fragment,t),I(tr.$$.fragment,t),I(or.$$.fragment,t),I(nr.$$.fragment,t),I(Tn.$$.fragment,t),I(vn.$$.fragment,t),I(sr.$$.fragment,t),I(ar.$$.fragment,t),I(rr.$$.fragment,t),I(wn.$$.fragment,t),I(In.$$.fragment,t),Tc=!1},d(t){o(d),t&&o(y),t&&o(u),C(n),t&&o(oo),t&&o(D),C(j),t&&o(no),t&&o(te),t&&o(so),t&&o(me),t&&o(ao),t&&o(he),t&&o(nt),t&&o(F),C(re),t&&o(ro),t&&o(Re),t&&o(io),t&&o(oe),t&&o(lo),t&&o(L),t&&o(is),C(Ae,t),t&&o(Ve),t&&o(q),t&&o(pt),t&&o(ge),C(ds),t&&o(Ed),t&&o(Mr),t&&o(zd),t&&o(ho),t&&o(Ud),t&&o(wr),t&&o(Fd),t&&o(mt),C(fs),t&&o(Wd),t&&o(H),C(us),C(uo),C(_s),t&&o(Vd),t&&o(ft),C(ys),t&&o(Zd),t&&o(ie),C(Ts),C(bo),t&&o(Bd),t&&o(_t),C(Ms),t&&o(Nd),t&&o(le),C(ws),C(To),t&&o(Gd),t&&o(Tt),C(Cs),t&&o(Rd),t&&o(Z),C(Ps),C(ks),C(xs),C(js),C(Js),t&&o(Xd),t&&o(vt),C(Es),t&&o(qd),t&&o(Q),C(zs),C(Ws),C(Vs),t&&o(Ad),t&&o(Mt),C(Zs),t&&o(Sd),t&&o(Ze),C(Bs),C(Ns),t&&o(Dd),t&&o(wt),C(Gs),t&&o(Yd),t&&o(Rs),C(Xs),t&&o(Hd),t&&o(It),C(qs),t&&o(Qd),t&&o(O),C(As),C(Ss),C(Ys),t&&o(Od),t&&o(Ct),C(Qs),t&&o(Kd),t&&o(G),C(Os),C(oa),C(Eo),C(zo),C(na),C(Uo),C(Fo),C(sa),C(Wo),C(Vo),t&&o(ec),t&&o(xt),C(aa),t&&o(tc),t&&o(de),C(ra),C(ca),C(Bo),C(No),t&&o(oc),t&&o(jt),C(pa),t&&o(nc),t&&o(K),C(ma),C(ga),C(Ro),C(Xo),t&&o(sc),t&&o(Et),C(_a),t&&o(ac),t&&o(ee),C(ba),C(Ma),C(Ao),C(So),t&&o(rc),t&&o(Ut),C(wa),t&&o(ic),t&&o(ce),C(Ia),C(ka),C(Yo),C(Ho),t&&o(lc),t&&o(Wt),C(xa),t&&o(dc),t&&o(B),C(La),C(Oo),C(za),C(Ko),C(en),C(Ua),C(tn),C(on),C(Fa),C(nn),C(sn),t&&o(cc),t&&o(Nt),C(Wa),t&&o(pc),t&&o(Gt),C(Va),C(Za),C(rn),C(ln),t&&o(mc),t&&o(Xt),C(Ba),t&&o(hc),t&&o(qt),C(Na),C(Ga),C(cn),C(pn),t&&o(fc),t&&o(St),C(Ra),t&&o(uc),t&&o(z),C(Xa),C(Oa),C(hn),C(fn),C(Ka),C(gn),C(er),C(bn),t&&o(gc),t&&o(Yt),C(tr),t&&o(_c),t&&o(Ht),C(or),C(nr),C(Tn),C(vn),t&&o(bc),t&&o(Ot),C(sr),t&&o(yc),t&&o(Kt),C(ar),C(rr),C(wn),C(In)}}}const nM={local:"clip",sections:[{local:"overview",title:"Overview"},{local:"usage",title:"Usage"},{local:"resources",title:"Resources"},{local:"transformers.CLIPConfig",title:"CLIPConfig"},{local:"transformers.CLIPTextConfig",title:"CLIPTextConfig"},{local:"transformers.CLIPVisionConfig",title:"CLIPVisionConfig"},{local:"transformers.CLIPTokenizer",title:"CLIPTokenizer"},{local:"transformers.CLIPTokenizerFast",title:"CLIPTokenizerFast"},{local:"transformers.CLIPImageProcessor",title:"CLIPImageProcessor"},{local:"transformers.CLIPFeatureExtractor",title:"CLIPFeatureExtractor"},{local:"transformers.CLIPProcessor",title:"CLIPProcessor"},{local:"transformers.CLIPModel",title:"CLIPModel"},{local:"transformers.CLIPTextModel",title:"CLIPTextModel"},{local:"transformers.CLIPTextModelWithProjection",title:"CLIPTextModelWithProjection"},{local:"transformers.CLIPVisionModelWithProjection",title:"CLIPVisionModelWithProjection"},{local:"transformers.CLIPVisionModel",title:"CLIPVisionModel"},{local:"transformers.TFCLIPModel",title:"TFCLIPModel"},{local:"transformers.TFCLIPTextModel",title:"TFCLIPTextModel"},{local:"transformers.TFCLIPVisionModel",title:"TFCLIPVisionModel"},{local:"transformers.FlaxCLIPModel",title:"FlaxCLIPModel"},{local:"transformers.FlaxCLIPTextModel",title:"FlaxCLIPTextModel"},{local:"transformers.FlaxCLIPVisionModel",title:"FlaxCLIPVisionModel"}],title:"CLIP"};function sM(P){return yv(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pM extends uv{constructor(d){super();gv(this,d,sM,oM,_v,{})}}export{pM as default,nM as metadata};
