import{S as uT,i as gT,s as _T,e as s,k as m,w as y,t as i,M as bT,c as r,d as o,m as h,a,x as T,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 vT,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 yT(P){let d,v,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"),v=i("Example:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Example:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 TT(P){let d,v,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"),v=i("Example:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Example:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 MT(P){let d,v,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"),v=i("Example:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Example:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 wT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function IT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 CT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function PT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 $T(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function kT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 xT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function LT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 jT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function JT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 ET(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function zT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 UT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function FT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 WT(P){let d,v,u,p,_,n,c,$,Sn,oo,D,pe,Ge,j,Dn,Ue,Yn,no,te,Hn,Fe,tt,Qn,so,me,On,ro,he,ot,Kn,nt,F,N,st,ae,es,rt,at,ao,Re,fe,io,oe,ts,Xe,it,os,lo,L,ns,ue,ss,co,Y,rs,We,qe,as;return{c(){d=s("p"),v=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()"),ro=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 "),ae=s("code"),es=i("input_ids"),rt=i(" only and nothing else: "),at=s("code"),ao=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"),rs=i(`Note that when creating models and layers with
`),We=s("a"),qe=i("subclassing"),as=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=r(x,"P",{});var E=a(d);v=l(E,"TensorFlow models and layers in "),u=r(E,"CODE",{});var ua=a(u);p=l(ua,"transformers"),ua.forEach(o),_=l(E," accept two formats as input:"),E.forEach(o),n=h(x),c=r(x,"UL",{});var po=a(c);$=r(po,"LI",{});var lt=a($);Sn=l(lt,"having all inputs as keyword arguments (like PyTorch models), or"),lt.forEach(o),oo=h(po),D=r(po,"LI",{});var ga=a(D);pe=l(ga,"having all inputs as a list, tuple or dict in the first positional argument."),ga.forEach(o),po.forEach(o),Ge=h(x),j=r(x,"P",{});var X=a(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=r(X,"CODE",{});var dt=a(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=r(X,"CODE",{});var _a=a(te);Hn=l(_a,"model.fit()"),_a.forEach(o),Fe=l(X,` supports! If, however, you want to use the second
format outside of Keras methods like `),tt=r(X,"CODE",{});var ba=a(tt);Qn=l(ba,"fit()"),ba.forEach(o),so=l(X," and "),me=r(X,"CODE",{});var is=a(me);On=l(is,"predict()"),is.forEach(o),ro=l(X,`, such as when creating your own layers or models with
the Keras `),he=r(X,"CODE",{});var Ae=a(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=r(x,"UL",{});var Ve=a(F);N=r(Ve,"LI",{});var q=a(N);st=l(q,"a single Tensor with "),ae=r(q,"CODE",{});var va=a(ae);es=l(va,"input_ids"),va.forEach(o),rt=l(q," only and nothing else: "),at=r(q,"CODE",{});var Se=a(at);ao=l(Se,"model(input_ids)"),Se.forEach(o),q.forEach(o),Re=h(Ve),fe=r(Ve,"LI",{});var ct=a(fe);io=l(ct,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),oe=r(ct,"CODE",{});var ya=a(oe);ts=l(ya,"model([input_ids, attention_mask])"),ya.forEach(o),Xe=l(ct," or "),it=r(ct,"CODE",{});var De=a(it);os=l(De,"model([input_ids, attention_mask, token_type_ids])"),De.forEach(o),ct.forEach(o),lo=h(Ve),L=r(Ve,"LI",{});var ls=a(L);ns=l(ls,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),ue=r(ls,"CODE",{});var Ta=a(ue);ss=l(Ta,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),Ta.forEach(o),ls.forEach(o),Ve.forEach(o),co=h(x),Y=r(x,"P",{});var pt=a(Y);rs=l(pt,`Note that when creating models and layers with
`),We=r(pt,"A",{href:!0,rel:!0});var ge=a(We);qe=l(ge,"subclassing"),ge.forEach(o),as=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,v),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,ro),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,ae),e(ae,es),e(N,rt),e(N,at),e(at,ao),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,rs),e(Y,We),e(We,qe),e(Y,as)},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 VT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function ZT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 BT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function NT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 GT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function RT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 XT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function qT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 AT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function ST(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 DT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function YT(P){let d,v,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"),v=i("Example:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Example:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 HT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 QT(P){let d,v,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"),v=i("Examples:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Examples:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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 OT(P){let d,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function KT(P){let d,v,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"),v=i("Example:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Example:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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,v,u,p,_;return{c(){d=s("p"),v=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=r(n,"P",{});var c=a(d);v=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var $=a(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,v),e(d,u),e(u,p),e(d,_)},d(n){n&&o(d)}}}function tM(P){let d,v,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"),v=i("Example:"),u=m(),y(p.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);v=l(c,"Example:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,v),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,v,u,p,_,n,c,$,Sn,oo,D,pe,Ge,j,Dn,Ue,Yn,no,te,Hn,Fe,tt,Qn,so,me,On,ro,he,ot,Kn,nt,F,N,st,ae,es,rt,at,ao,Re,fe,io,oe,ts,Xe,it,os,lo,L,ns,ue,ss,co,Y,rs,We,qe,as,x,E,ua,po,lt,ga,X,dt,_a,ba,is,Ae,Ve,q,va,Se,ct,ya,De,ls,Ta,pt,ge,mo,Ji,ds,Mp,Ei,wp,Ed,Ma,Ip,zd,ho,cs,Cp,ps,Pp,$p,kp,ms,xp,hs,Lp,jp,Ud,wa,Jp,Fd,mt,fo,zi,fs,Ep,Ui,zp,Wd,H,us,Up,Ye,Ia,Fp,Wp,Ca,Vp,Zp,gs,Bp,Np,Gp,ht,Rp,Pa,Xp,qp,$a,Ap,Sp,Dp,uo,Yp,go,_s,Hp,bs,Qp,ka,Op,Kp,Vd,ft,_o,Fi,vs,em,Wi,tm,Zd,ie,ys,om,ut,nm,xa,sm,rm,Ts,am,im,lm,gt,dm,La,cm,pm,ja,mm,hm,fm,bo,Bd,_t,vo,Vi,Ms,um,Zi,gm,Nd,le,ws,_m,bt,bm,Ja,vm,ym,Is,Tm,Mm,wm,vt,Im,Ea,Cm,Pm,za,$m,km,xm,yo,Gd,yt,To,Bi,Cs,Lm,Ni,jm,Rd,Z,Ps,Jm,Gi,Em,zm,$s,Um,Ua,Fm,Wm,Vm,_e,ks,Zm,Ri,Bm,Nm,Xi,Fa,Gm,qi,Rm,Xm,Ai,qm,Am,Mo,xs,Sm,Ls,Dm,Si,Ym,Hm,Qm,wo,js,Om,Di,Km,eh,Wa,Js,Xd,Tt,Io,Yi,Es,th,Hi,oh,qd,Q,zs,nh,Us,sh,Qi,rh,ah,ih,Fs,lh,Va,dh,ch,ph,be,Ws,mh,Oi,hh,fh,Ki,Za,uh,el,gh,_h,tl,bh,vh,Co,Vs,yh,ol,Th,Ad,Mt,Po,nl,Zs,Mh,sl,wh,Sd,Ze,Bs,Ih,rl,Ch,Ph,$o,Ns,$h,al,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,Ba,Fh,Wh,Na,Vh,Zh,Ga,Bh,Nh,ml,Gh,Rh,Ra,Xh,qh,Ah,Lo,Ss,Sh,Ds,Dh,Xa,Yh,Hh,Qh,jo,Ys,Oh,Hs,Kh,qa,ef,tf,Od,Ct,Jo,hl,Qs,of,fl,nf,Kd,G,Os,sf,Ks,rf,Aa,af,lf,df,er,cf,tr,pf,mf,hf,ve,or,ff,Pt,uf,Sa,gf,_f,ul,bf,vf,yf,Eo,Tf,zo,Mf,ye,nr,wf,$t,If,Da,Cf,Pf,gl,$f,kf,xf,Uo,Lf,Fo,jf,Te,sr,Jf,kt,Ef,Ya,zf,Uf,_l,Ff,Wf,Vf,Wo,Zf,Vo,ec,xt,Zo,bl,rr,Bf,vl,Nf,tc,de,ar,Gf,ir,Rf,Ha,Xf,qf,Af,lr,Sf,dr,Df,Yf,Hf,Me,cr,Qf,Lt,Of,Qa,Kf,eu,yl,tu,ou,nu,Bo,su,No,oc,jt,Go,Tl,pr,ru,Ml,au,nc,K,mr,iu,wl,lu,du,hr,cu,Oa,pu,mu,hu,fr,fu,ur,uu,gu,_u,we,gr,bu,Jt,vu,Ka,yu,Tu,Il,Mu,wu,Iu,Ro,Cu,Xo,sc,Et,qo,Cl,_r,Pu,Pl,$u,rc,ee,br,ku,$l,xu,Lu,vr,ju,ei,Ju,Eu,zu,yr,Uu,Tr,Fu,Wu,Vu,Ie,Mr,Zu,zt,Bu,ti,Nu,Gu,kl,Ru,Xu,qu,Ao,Au,So,ac,Ut,Do,xl,wr,Su,Ll,Du,ic,ce,Ir,Yu,Cr,Hu,oi,Qu,Ou,Ku,Pr,eg,$r,tg,og,ng,Ce,kr,sg,Ft,rg,ni,ag,ig,jl,lg,dg,cg,Yo,pg,Ho,lc,Wt,Qo,Jl,xr,mg,El,hg,dc,B,Lr,fg,jr,ug,si,gg,_g,bg,Jr,vg,Er,yg,Tg,Mg,Oo,wg,Pe,zr,Ig,Vt,Cg,ri,Pg,$g,zl,kg,xg,Lg,Ko,jg,en,Jg,$e,Ur,Eg,Zt,zg,ai,Ug,Fg,Ul,Wg,Vg,Zg,tn,Bg,on,Ng,ke,Fr,Gg,Bt,Rg,ii,Xg,qg,Fl,Ag,Sg,Dg,nn,Yg,sn,cc,Nt,rn,Wl,Wr,Hg,Vl,Qg,pc,Gt,Vr,Og,xe,Zr,Kg,Rt,e_,li,t_,o_,Zl,n_,s_,r_,an,a_,ln,mc,Xt,dn,Bl,Br,i_,Nl,l_,hc,qt,Nr,d_,Le,Gr,c_,At,p_,di,m_,h_,Gl,f_,u_,g_,cn,__,pn,fc,St,mn,Rl,Rr,b_,Xl,v_,uc,z,Xr,y_,qr,T_,ci,M_,w_,I_,Ar,C_,Sr,P_,$_,k_,ql,x_,L_,Be,Al,Dr,j_,J_,Sl,Yr,E_,z_,Dl,Hr,U_,F_,Yl,Qr,W_,V_,je,Or,Z_,Dt,B_,Hl,N_,G_,Ql,R_,X_,q_,hn,A_,fn,S_,un,Kr,D_,gn,Y_,_n,ea,H_,bn,gc,Yt,vn,Ol,ta,Q_,Kl,O_,_c,Ht,oa,K_,Je,na,eb,Qt,tb,ed,ob,nb,td,sb,rb,ab,yn,ib,Tn,bc,Ot,Mn,od,sa,lb,nd,db,vc,Kt,ra,cb,Ee,aa,pb,eo,mb,sd,hb,fb,rd,ub,gb,_b,wn,bb,In,yc;return n=new J({}),j=new J({}),ae=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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/configuration_clip.py#L253"}}),uo=new W({props:{anchor:"transformers.CLIPConfig.example",$$slots:{default:[yT]},$$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/v4.32.0/src/transformers/models/clip/configuration_clip.py#L389",returnDescription:`
<p>An instance of a configuration object</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPConfig"
>CLIPConfig</a></p>
`}}),vs=new J({}),ys=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/v4.32.0/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/v4.32.0/src/transformers/models/clip/configuration_clip.py#L39"}}),bo=new W({props:{anchor:"transformers.CLIPTextConfig.example",$$slots:{default:[TT]},$$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/v4.32.0/src/transformers/models/clip/configuration_clip.py#L148"}}),yo=new W({props:{anchor:"transformers.CLIPVisionConfig.example",$$slots:{default:[MT]},$$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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/en/model_doc/clip#transformers.CLIPTokenizerFast">CLIPTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/modeling_clip.py#L967"}}),or=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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:[wT]},$$scope:{ctx:P}}}),zo=new W({props:{anchor:"transformers.CLIPModel.forward.example",$$slots:{default:[IT]},$$scope:{ctx:P}}}),nr=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/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/v4.32.0/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:[CT]},$$scope:{ctx:P}}}),Fo=new W({props:{anchor:"transformers.CLIPModel.get_text_features.example",$$slots:{default:[PT]},$$scope:{ctx:P}}}),sr=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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/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/v4.32.0/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:[$T]},$$scope:{ctx:P}}}),Vo=new W({props:{anchor:"transformers.CLIPModel.get_image_features.example",$$slots:{default:[kT]},$$scope:{ctx:P}}}),rr=new J({}),ar=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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/modeling_clip.py#L793"}}),cr=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clip/modeling_clip.py#L810",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/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:[xT]},$$scope:{ctx:P}}}),No=new W({props:{anchor:"transformers.CLIPTextModel.forward.example",$$slots:{default:[LT]},$$scope:{ctx:P}}}),pr=new J({}),mr=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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/modeling_clip.py#L1198"}}),gr=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/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:[jT]},$$scope:{ctx:P}}}),Xo=new W({props:{anchor:"transformers.CLIPTextModelWithProjection.forward.example",$$slots:{default:[JT]},$$scope:{ctx:P}}}),_r=new J({}),br=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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/modeling_clip.py#L1279"}}),Mr=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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/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:[ET]},$$scope:{ctx:P}}}),So=new W({props:{anchor:"transformers.CLIPVisionModelWithProjection.forward.example",$$slots:{default:[zT]},$$scope:{ctx:P}}}),wr=new J({}),Ir=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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/modeling_clip.py#L912"}}),kr=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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clip/modeling_clip.py#L925",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/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:[UT]},$$scope:{ctx:P}}}),Ho=new W({props:{anchor:"transformers.CLIPVisionModel.forward.example",$$slots:{default:[FT]},$$scope:{ctx:P}}}),xr=new J({}),Lr=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/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/modeling_tf_clip.py#L1167"}}),Oo=new S({props:{$$slots:{default:[WT]},$$scope:{ctx:P}}}),zr=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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:[VT]},$$scope:{ctx:P}}}),en=new W({props:{anchor:"transformers.TFCLIPModel.call.example",$$slots:{default:[ZT]},$$scope:{ctx:P}}}),Ur=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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:[BT]},$$scope:{ctx:P}}}),on=new W({props:{anchor:"transformers.TFCLIPModel.get_text_features.example",$$slots:{default:[NT]},$$scope:{ctx:P}}}),Fr=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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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:[GT]},$$scope:{ctx:P}}}),sn=new W({props:{anchor:"transformers.TFCLIPModel.get_image_features.example",$$slots:{default:[RT]},$$scope:{ctx:P}}}),Wr=new J({}),Vr=new k({props:{name:"class transformers.TFCLIPTextModel",anchor:"transformers.TFCLIPTextModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clip/modeling_tf_clip.py#L1060"}}),Zr=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/modeling_tf_clip.py#L1068",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p>
`}}),an=new S({props:{$$slots:{default:[XT]},$$scope:{ctx:P}}}),ln=new W({props:{anchor:"transformers.TFCLIPTextModel.call.example",$$slots:{default:[qT]},$$scope:{ctx:P}}}),Br=new J({}),Nr=new k({props:{name:"class transformers.TFCLIPVisionModel",anchor:"transformers.TFCLIPVisionModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clip/modeling_tf_clip.py#L1112"}}),Gr=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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/src/transformers/models/clip/modeling_tf_clip.py#L1121",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/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:[AT]},$$scope:{ctx:P}}}),pn=new W({props:{anchor:"transformers.TFCLIPVisionModel.call.example",$$slots:{default:[ST]},$$scope:{ctx:P}}}),Rr=new J({}),Xr=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/v4.32.0/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/v4.32.0/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/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clip/modeling_flax_clip.py#L1160"}}),Or=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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/v4.32.0/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:[DT]},$$scope:{ctx:P}}}),fn=new W({props:{anchor:"transformers.FlaxCLIPModel.__call__.example",$$slots:{default:[YT]},$$scope:{ctx:P}}}),Kr=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/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:[HT]},$$scope:{ctx:P}}}),ea=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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/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/v4.32.0/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:[QT]},$$scope:{ctx:P}}}),ta=new J({}),oa=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/v4.32.0/src/transformers/models/clip/modeling_flax_clip.py#L981"}}),na=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/v4.32.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.32.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clip/modeling_flax_clip.py#L634",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling"
>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),yn=new S({props:{$$slots:{default:[OT]},$$scope:{ctx:P}}}),Tn=new W({props:{anchor:"transformers.FlaxCLIPTextModel.__call__.example",$$slots:{default:[KT]},$$scope:{ctx:P}}}),sa=new J({}),ra=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/v4.32.0/src/transformers/models/clip/modeling_flax_clip.py#L1034"}}),aa=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/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/clip/modeling_flax_clip.py#L714",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/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/v4.32.0/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"),v=m(),u=s("h1"),p=s("a"),_=s("span"),y(n.$$.fragment),c=m(),$=s("span"),Sn=i("CLIP"),oo=m(),D=s("h2"),pe=s("a"),Ge=s("span"),y(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:"),ro=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"),y(ae.$$.fragment),es=m(),rt=s("span"),at=i("Usage"),ao=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"),rs=i("CLIPProcessor"),We=i(` wraps
`),qe=s("a"),as=i("CLIPImageProcessor"),x=i(" and "),E=s("a"),ua=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"),ga=i("CLIPProcessor"),X=i(" and "),dt=s("a"),_a=i("CLIPModel"),ba=i("."),is=m(),y(Ae.$$.fragment),Ve=m(),q=s("p"),va=i("This model was contributed by "),Se=s("a"),ct=i("valhalla"),ya=i(". The original code can be found "),De=s("a"),ls=i("here"),Ta=i("."),pt=m(),ge=s("h2"),mo=s("a"),Ji=s("span"),y(ds.$$.fragment),Mp=m(),Ei=s("span"),wp=i("Resources"),Ed=m(),Ma=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(),wa=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"),y(fs.$$.fragment),Ep=m(),Ui=s("span"),zp=i("CLIPConfig"),Wd=m(),H=s("div"),y(us.$$.fragment),Up=m(),Ye=s("p"),Ia=s("a"),Fp=i("CLIPConfig"),Wp=i(" is the configuration class to store the configuration of a "),Ca=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 "),Pa=s("a"),Xp=i("PretrainedConfig"),qp=i(` and can be used to control the model outputs. Read the
documentation from `),$a=s("a"),Ap=i("PretrainedConfig"),Sp=i(" for more information."),Dp=m(),y(uo.$$.fragment),Yp=m(),go=s("div"),y(_s.$$.fragment),Hp=m(),bs=s("p"),Qp=i("Instantiate a "),ka=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"),y(vs.$$.fragment),em=m(),Wi=s("span"),tm=i("CLIPTextConfig"),Zd=m(),ie=s("div"),y(ys.$$.fragment),om=m(),ut=s("p"),nm=i("This is the configuration class to store the configuration of a "),xa=s("a"),sm=i("CLIPTextModel"),rm=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
`),Ts=s("a"),am=i("openai/clip-vit-base-patch32"),im=i(" architecture."),lm=m(),gt=s("p"),dm=i("Configuration objects inherit from "),La=s("a"),cm=i("PretrainedConfig"),pm=i(` and can be used to control the model outputs. Read the
documentation from `),ja=s("a"),mm=i("PretrainedConfig"),hm=i(" for more information."),fm=m(),y(bo.$$.fragment),Bd=m(),_t=s("h2"),vo=s("a"),Vi=s("span"),y(Ms.$$.fragment),um=m(),Zi=s("span"),gm=i("CLIPVisionConfig"),Nd=m(),le=s("div"),y(ws.$$.fragment),_m=m(),bt=s("p"),bm=i("This is the configuration class to store the configuration of a "),Ja=s("a"),vm=i("CLIPVisionModel"),ym=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"),Tm=i("openai/clip-vit-base-patch32"),Mm=i(" architecture."),wm=m(),vt=s("p"),Im=i("Configuration objects inherit from "),Ea=s("a"),Cm=i("PretrainedConfig"),Pm=i(` and can be used to control the model outputs. Read the
documentation from `),za=s("a"),$m=i("PretrainedConfig"),km=i(" for more information."),xm=m(),y(yo.$$.fragment),Gd=m(),yt=s("h2"),To=s("a"),Bi=s("span"),y(Cs.$$.fragment),Lm=m(),Ni=s("span"),jm=i("CLIPTokenizer"),Rd=m(),Z=s("div"),y(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 "),Ua=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"),y(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"),Fa=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"),y(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"),y(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(),Wa=s("div"),y(Js.$$.fragment),Xd=m(),Tt=s("h2"),Io=s("a"),Yi=s("span"),y(Es.$$.fragment),th=m(),Hi=s("span"),oh=i("CLIPTokenizerFast"),qd=m(),Q=s("div"),y(zs.$$.fragment),nh=m(),Us=s("p"),sh=i("Construct a \u201Cfast\u201D CLIP tokenizer (backed by HuggingFace\u2019s "),Qi=s("em"),rh=i("tokenizers"),ah=i(` library). Based on byte-level
Byte-Pair-Encoding.`),ih=m(),Fs=s("p"),lh=i("This tokenizer inherits from "),Va=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"),y(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"),Za=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."),vh=m(),Co=s("div"),y(Vs.$$.fragment),yh=m(),ol=s("p"),Th=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"),y(Zs.$$.fragment),Mh=m(),sl=s("span"),wh=i("CLIPImageProcessor"),Sd=m(),Ze=s("div"),y(Bs.$$.fragment),Ih=m(),rl=s("p"),Ch=i("Constructs a CLIP image processor."),Ph=m(),$o=s("div"),y(Ns.$$.fragment),$h=m(),al=s("p"),kh=i("Preprocess an image or batch of images."),Dd=m(),wt=s("h2"),ko=s("a"),il=s("span"),y(Gs.$$.fragment),xh=m(),ll=s("span"),Lh=i("CLIPFeatureExtractor"),Yd=m(),Rs=s("div"),y(Xs.$$.fragment),Hd=m(),It=s("h2"),xo=s("a"),dl=s("span"),y(qs.$$.fragment),jh=m(),cl=s("span"),Jh=i("CLIPProcessor"),Qd=m(),O=s("div"),y(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"),Ba=s("a"),Fh=i("CLIPProcessor"),Wh=i(" offers all the functionalities of "),Na=s("a"),Vh=i("CLIPImageProcessor"),Zh=i(" and "),Ga=s("a"),Bh=i("CLIPTokenizerFast"),Nh=i(`. See the
`),ml=s("code"),Gh=i("__call__()"),Rh=i(" and "),Ra=s("a"),Xh=i("decode()"),qh=i(" for more information."),Ah=m(),Lo=s("div"),y(Ss.$$.fragment),Sh=m(),Ds=s("p"),Dh=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Xa=s("a"),Yh=i("batch_decode()"),Hh=i(`. Please
refer to the docstring of this method for more information.`),Qh=m(),jo=s("div"),y(Ys.$$.fragment),Oh=m(),Hs=s("p"),Kh=i("This method forwards all its arguments to CLIPTokenizerFast\u2019s "),qa=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"),y(Qs.$$.fragment),of=m(),fl=s("span"),nf=i("CLIPModel"),Kd=m(),G=s("div"),y(Os.$$.fragment),sf=m(),Ks=s("p"),rf=i("This model inherits from "),Aa=s("a"),af=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(),er=s("p"),cf=i("This model is also a PyTorch "),tr=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(),ve=s("div"),y(or.$$.fragment),ff=m(),Pt=s("p"),uf=i("The "),Sa=s("a"),gf=i("CLIPModel"),_f=i(" forward method, overrides the "),ul=s("code"),bf=i("__call__"),vf=i(" special method."),yf=m(),y(Eo.$$.fragment),Tf=m(),y(zo.$$.fragment),Mf=m(),ye=s("div"),y(nr.$$.fragment),wf=m(),$t=s("p"),If=i("The "),Da=s("a"),Cf=i("CLIPModel"),Pf=i(" forward method, overrides the "),gl=s("code"),$f=i("__call__"),kf=i(" special method."),xf=m(),y(Uo.$$.fragment),Lf=m(),y(Fo.$$.fragment),jf=m(),Te=s("div"),y(sr.$$.fragment),Jf=m(),kt=s("p"),Ef=i("The "),Ya=s("a"),zf=i("CLIPModel"),Uf=i(" forward method, overrides the "),_l=s("code"),Ff=i("__call__"),Wf=i(" special method."),Vf=m(),y(Wo.$$.fragment),Zf=m(),y(Vo.$$.fragment),ec=m(),xt=s("h2"),Zo=s("a"),bl=s("span"),y(rr.$$.fragment),Bf=m(),vl=s("span"),Nf=i("CLIPTextModel"),tc=m(),de=s("div"),y(ar.$$.fragment),Gf=m(),ir=s("p"),Rf=i(`The text model from CLIP without any head or projection on top.
This model inherits from `),Ha=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(),lr=s("p"),Sf=i("This model is also a PyTorch "),dr=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"),y(cr.$$.fragment),Qf=m(),Lt=s("p"),Of=i("The "),Qa=s("a"),Kf=i("CLIPTextModel"),eu=i(" forward method, overrides the "),yl=s("code"),tu=i("__call__"),ou=i(" special method."),nu=m(),y(Bo.$$.fragment),su=m(),y(No.$$.fragment),oc=m(),jt=s("h2"),Go=s("a"),Tl=s("span"),y(pr.$$.fragment),ru=m(),Ml=s("span"),au=i("CLIPTextModelWithProjection"),nc=m(),K=s("div"),y(mr.$$.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(),hr=s("p"),cu=i("This model inherits from "),Oa=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(),fr=s("p"),fu=i("This model is also a PyTorch "),ur=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"),y(gr.$$.fragment),bu=m(),Jt=s("p"),vu=i("The "),Ka=s("a"),yu=i("CLIPTextModelWithProjection"),Tu=i(" forward method, overrides the "),Il=s("code"),Mu=i("__call__"),wu=i(" special method."),Iu=m(),y(Ro.$$.fragment),Cu=m(),y(Xo.$$.fragment),sc=m(),Et=s("h2"),qo=s("a"),Cl=s("span"),y(_r.$$.fragment),Pu=m(),Pl=s("span"),$u=i("CLIPVisionModelWithProjection"),rc=m(),ee=s("div"),y(br.$$.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(),vr=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(),yr=s("p"),Uu=i("This model is also a PyTorch "),Tr=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"),y(Mr.$$.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(),y(Ao.$$.fragment),Au=m(),y(So.$$.fragment),ac=m(),Ut=s("h2"),Do=s("a"),xl=s("span"),y(wr.$$.fragment),Su=m(),Ll=s("span"),Du=i("CLIPVisionModel"),ic=m(),ce=s("div"),y(Ir.$$.fragment),Yu=m(),Cr=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(),Pr=s("p"),eg=i("This model is also a PyTorch "),$r=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"),y(kr.$$.fragment),sg=m(),Ft=s("p"),rg=i("The "),ni=s("a"),ag=i("CLIPVisionModel"),ig=i(" forward method, overrides the "),jl=s("code"),lg=i("__call__"),dg=i(" special method."),cg=m(),y(Yo.$$.fragment),pg=m(),y(Ho.$$.fragment),lc=m(),Wt=s("h2"),Qo=s("a"),Jl=s("span"),y(xr.$$.fragment),mg=m(),El=s("span"),hg=i("TFCLIPModel"),dc=m(),B=s("div"),y(Lr.$$.fragment),fg=m(),jr=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(),Jr=s("p"),vg=i("This model is also a "),Er=s("a"),yg=i("tf.keras.Model"),Tg=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(),y(Oo.$$.fragment),wg=m(),Pe=s("div"),y(zr.$$.fragment),Ig=m(),Vt=s("p"),Cg=i("The "),ri=s("a"),Pg=i("TFCLIPModel"),$g=i(" forward method, overrides the "),zl=s("code"),kg=i("__call__"),xg=i(" special method."),Lg=m(),y(Ko.$$.fragment),jg=m(),y(en.$$.fragment),Jg=m(),$e=s("div"),y(Ur.$$.fragment),Eg=m(),Zt=s("p"),zg=i("The "),ai=s("a"),Ug=i("TFCLIPModel"),Fg=i(" forward method, overrides the "),Ul=s("code"),Wg=i("__call__"),Vg=i(" special method."),Zg=m(),y(tn.$$.fragment),Bg=m(),y(on.$$.fragment),Ng=m(),ke=s("div"),y(Fr.$$.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(),y(nn.$$.fragment),Yg=m(),y(sn.$$.fragment),cc=m(),Nt=s("h2"),rn=s("a"),Wl=s("span"),y(Wr.$$.fragment),Hg=m(),Vl=s("span"),Qg=i("TFCLIPTextModel"),pc=m(),Gt=s("div"),y(Vr.$$.fragment),Og=m(),xe=s("div"),y(Zr.$$.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."),r_=m(),y(an.$$.fragment),a_=m(),y(ln.$$.fragment),mc=m(),Xt=s("h2"),dn=s("a"),Bl=s("span"),y(Br.$$.fragment),i_=m(),Nl=s("span"),l_=i("TFCLIPVisionModel"),hc=m(),qt=s("div"),y(Nr.$$.fragment),d_=m(),Le=s("div"),y(Gr.$$.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(),y(cn.$$.fragment),__=m(),y(pn.$$.fragment),fc=m(),St=s("h2"),mn=s("a"),Rl=s("span"),y(Rr.$$.fragment),b_=m(),Xl=s("span"),v_=i("FlaxCLIPModel"),uc=m(),z=s("div"),y(Xr.$$.fragment),y_=m(),qr=s("p"),T_=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(),Ar=s("p"),C_=i("This model is also a Flax Linen "),Sr=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"),Dr=s("a"),j_=i("Just-In-Time (JIT) compilation"),J_=m(),Sl=s("li"),Yr=s("a"),E_=i("Automatic Differentiation"),z_=m(),Dl=s("li"),Hr=s("a"),U_=i("Vectorization"),F_=m(),Yl=s("li"),Qr=s("a"),W_=i("Parallelization"),V_=m(),je=s("div"),y(Or.$$.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(),y(hn.$$.fragment),A_=m(),y(fn.$$.fragment),S_=m(),un=s("div"),y(Kr.$$.fragment),D_=m(),y(gn.$$.fragment),Y_=m(),_n=s("div"),y(ea.$$.fragment),H_=m(),y(bn.$$.fragment),gc=m(),Yt=s("h2"),vn=s("a"),Ol=s("span"),y(ta.$$.fragment),Q_=m(),Kl=s("span"),O_=i("FlaxCLIPTextModel"),_c=m(),Ht=s("div"),y(oa.$$.fragment),K_=m(),Je=s("div"),y(na.$$.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__"),rb=i(" special method."),ab=m(),y(yn.$$.fragment),ib=m(),y(Tn.$$.fragment),bc=m(),Ot=s("h2"),Mn=s("a"),od=s("span"),y(sa.$$.fragment),lb=m(),nd=s("span"),db=i("FlaxCLIPVisionModel"),vc=m(),Kt=s("div"),y(ra.$$.fragment),cb=m(),Ee=s("div"),y(aa.$$.fragment),pb=m(),eo=s("p"),mb=i("The "),sd=s("code"),hb=i("FlaxCLIPVisionPreTrainedModel"),fb=i(" forward method, overrides the "),rd=s("code"),ub=i("__call__"),gb=i(" special method."),_b=m(),y(wn.$$.fragment),bb=m(),y(In.$$.fragment),this.h()},l(t){const g=bT('[data-svelte="svelte-1phssyn"]',document.head);d=r(g,"META",{name:!0,content:!0}),g.forEach(o),v=h(t),u=r(t,"H1",{class:!0});var ia=a(u);p=r(ia,"A",{id:!0,class:!0,href:!0});var ad=a(p);_=r(ad,"SPAN",{});var id=a(_);T(n.$$.fragment,id),id.forEach(o),ad.forEach(o),c=h(ia),$=r(ia,"SPAN",{});var ld=a($);Sn=l(ld,"CLIP"),ld.forEach(o),ia.forEach(o),oo=h(t),D=r(t,"H2",{class:!0});var la=a(D);pe=r(la,"A",{id:!0,class:!0,href:!0});var dd=a(pe);Ge=r(dd,"SPAN",{});var cd=a(Ge);T(j.$$.fragment,cd),cd.forEach(o),dd.forEach(o),Dn=h(la),Ue=r(la,"SPAN",{});var pd=a(Ue);Yn=l(pd,"Overview"),pd.forEach(o),la.forEach(o),no=h(t),te=r(t,"P",{});var da=a(te);Hn=l(da,"The CLIP model was proposed in "),Fe=r(da,"A",{href:!0,rel:!0});var md=a(Fe);tt=l(md,"Learning Transferable Visual Models From Natural Language Supervision"),md.forEach(o),Qn=l(da,` 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.`),da.forEach(o),so=h(t),me=r(t,"P",{});var hd=a(me);On=l(hd,"The abstract from the paper is the following:"),hd.forEach(o),ro=h(t),he=r(t,"P",{});var fd=a(he);ot=r(fd,"EM",{});var ud=a(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=r(t,"H2",{class:!0});var ca=a(F);N=r(ca,"A",{id:!0,class:!0,href:!0});var gd=a(N);st=r(gd,"SPAN",{});var _d=a(st);T(ae.$$.fragment,_d),_d.forEach(o),gd.forEach(o),es=h(ca),rt=r(ca,"SPAN",{});var bd=a(rt);at=l(bd,"Usage"),bd.forEach(o),ca.forEach(o),ao=h(t),Re=r(t,"P",{});var vd=a(Re);fe=l(vd,`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.`),vd.forEach(o),io=h(t),oe=r(t,"P",{});var pa=a(oe);ts=l(pa,`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=r(pa,"A",{href:!0});var yd=a(Xe);it=l(yd,"CLIPImageProcessor"),yd.forEach(o),os=l(pa," can be used to resize (or rescale) and normalize images for the model."),pa.forEach(o),lo=h(t),L=r(t,"P",{});var R=a(L);ns=l(R,"The "),ue=r(R,"A",{href:!0});var Td=a(ue);ss=l(Td,"CLIPTokenizer"),Td.forEach(o),co=l(R," is used to encode the text. The "),Y=r(R,"A",{href:!0});var Md=a(Y);rs=l(Md,"CLIPProcessor"),Md.forEach(o),We=l(R,` wraps
`),qe=r(R,"A",{href:!0});var wd=a(qe);as=l(wd,"CLIPImageProcessor"),wd.forEach(o),x=l(R," and "),E=r(R,"A",{href:!0});var Id=a(E);ua=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=r(R,"A",{href:!0});var Cd=a(lt);ga=l(Cd,"CLIPProcessor"),Cd.forEach(o),X=l(R," and "),dt=r(R,"A",{href:!0});var Pd=a(dt);_a=l(Pd,"CLIPModel"),Pd.forEach(o),ba=l(R,"."),R.forEach(o),is=h(t),T(Ae.$$.fragment,t),Ve=h(t),q=r(t,"P",{});var to=a(q);va=l(to,"This model was contributed by "),Se=r(to,"A",{href:!0,rel:!0});var $d=a(Se);ct=l($d,"valhalla"),$d.forEach(o),ya=l(to,". The original code can be found "),De=r(to,"A",{href:!0,rel:!0});var kd=a(De);ls=l(kd,"here"),kd.forEach(o),Ta=l(to,"."),to.forEach(o),pt=h(t),ge=r(t,"H2",{class:!0});var ma=a(ge);mo=r(ma,"A",{id:!0,class:!0,href:!0});var xd=a(mo);Ji=r(xd,"SPAN",{});var Ld=a(Ji);T(ds.$$.fragment,Ld),Ld.forEach(o),xd.forEach(o),Mp=h(ma),Ei=r(ma,"SPAN",{});var jd=a(Ei);wp=l(jd,"Resources"),jd.forEach(o),ma.forEach(o),Ed=h(t),Ma=r(t,"P",{});var Jd=a(Ma);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=r(t,"UL",{});var ha=a(ho);cs=r(ha,"LI",{});var Tc=a(cs);Cp=l(Tc,"A blog post on "),ps=r(Tc,"A",{href:!0,rel:!0});var Tb=a(ps);Pp=l(Tb,"How to fine-tune CLIP on 10,000 image-text pairs"),Tb.forEach(o),$p=l(Tc,"."),Tc.forEach(o),kp=h(ha),ms=r(ha,"LI",{});var Mc=a(ms);xp=l(Mc,"CLIP is supported by this "),hs=r(Mc,"A",{href:!0,rel:!0});var Mb=a(hs);Lp=l(Mb,"example script"),Mb.forEach(o),jp=l(Mc,"."),Mc.forEach(o),ha.forEach(o),Ud=h(t),wa=r(t,"P",{});var wb=a(wa);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=r(t,"H2",{class:!0});var wc=a(mt);fo=r(wc,"A",{id:!0,class:!0,href:!0});var Ib=a(fo);zi=r(Ib,"SPAN",{});var Cb=a(zi);T(fs.$$.fragment,Cb),Cb.forEach(o),Ib.forEach(o),Ep=h(wc),Ui=r(wc,"SPAN",{});var Pb=a(Ui);zp=l(Pb,"CLIPConfig"),Pb.forEach(o),wc.forEach(o),Wd=h(t),H=r(t,"DIV",{class:!0});var He=a(H);T(us.$$.fragment,He),Up=h(He),Ye=r(He,"P",{});var fa=a(Ye);Ia=r(fa,"A",{href:!0});var $b=a(Ia);Fp=l($b,"CLIPConfig"),$b.forEach(o),Wp=l(fa," is the configuration class to store the configuration of a "),Ca=r(fa,"A",{href:!0});var kb=a(Ca);Vp=l(kb,"CLIPModel"),kb.forEach(o),Zp=l(fa,`. 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=r(fa,"A",{href:!0,rel:!0});var xb=a(gs);Bp=l(xb,"openai/clip-vit-base-patch32"),xb.forEach(o),Np=l(fa," architecture."),fa.forEach(o),Gp=h(He),ht=r(He,"P",{});var pi=a(ht);Rp=l(pi,"Configuration objects inherit from "),Pa=r(pi,"A",{href:!0});var Lb=a(Pa);Xp=l(Lb,"PretrainedConfig"),Lb.forEach(o),qp=l(pi,` and can be used to control the model outputs. Read the
documentation from `),$a=r(pi,"A",{href:!0});var jb=a($a);Ap=l(jb,"PretrainedConfig"),jb.forEach(o),Sp=l(pi," for more information."),pi.forEach(o),Dp=h(He),T(uo.$$.fragment,He),Yp=h(He),go=r(He,"DIV",{class:!0});var Ic=a(go);T(_s.$$.fragment,Ic),Hp=h(Ic),bs=r(Ic,"P",{});var Cc=a(bs);Qp=l(Cc,"Instantiate a "),ka=r(Cc,"A",{href:!0});var Jb=a(ka);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=r(t,"H2",{class:!0});var Pc=a(ft);_o=r(Pc,"A",{id:!0,class:!0,href:!0});var Eb=a(_o);Fi=r(Eb,"SPAN",{});var zb=a(Fi);T(vs.$$.fragment,zb),zb.forEach(o),Eb.forEach(o),em=h(Pc),Wi=r(Pc,"SPAN",{});var Ub=a(Wi);tm=l(Ub,"CLIPTextConfig"),Ub.forEach(o),Pc.forEach(o),Zd=h(t),ie=r(t,"DIV",{class:!0});var Cn=a(ie);T(ys.$$.fragment,Cn),om=h(Cn),ut=r(Cn,"P",{});var mi=a(ut);nm=l(mi,"This is the configuration class to store the configuration of a "),xa=r(mi,"A",{href:!0});var Fb=a(xa);sm=l(Fb,"CLIPTextModel"),Fb.forEach(o),rm=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
`),Ts=r(mi,"A",{href:!0,rel:!0});var Wb=a(Ts);am=l(Wb,"openai/clip-vit-base-patch32"),Wb.forEach(o),im=l(mi," architecture."),mi.forEach(o),lm=h(Cn),gt=r(Cn,"P",{});var hi=a(gt);dm=l(hi,"Configuration objects inherit from "),La=r(hi,"A",{href:!0});var Vb=a(La);cm=l(Vb,"PretrainedConfig"),Vb.forEach(o),pm=l(hi,` and can be used to control the model outputs. Read the
documentation from `),ja=r(hi,"A",{href:!0});var Zb=a(ja);mm=l(Zb,"PretrainedConfig"),Zb.forEach(o),hm=l(hi," for more information."),hi.forEach(o),fm=h(Cn),T(bo.$$.fragment,Cn),Cn.forEach(o),Bd=h(t),_t=r(t,"H2",{class:!0});var $c=a(_t);vo=r($c,"A",{id:!0,class:!0,href:!0});var Bb=a(vo);Vi=r(Bb,"SPAN",{});var Nb=a(Vi);T(Ms.$$.fragment,Nb),Nb.forEach(o),Bb.forEach(o),um=h($c),Zi=r($c,"SPAN",{});var Gb=a(Zi);gm=l(Gb,"CLIPVisionConfig"),Gb.forEach(o),$c.forEach(o),Nd=h(t),le=r(t,"DIV",{class:!0});var Pn=a(le);T(ws.$$.fragment,Pn),_m=h(Pn),bt=r(Pn,"P",{});var fi=a(bt);bm=l(fi,"This is the configuration class to store the configuration of a "),Ja=r(fi,"A",{href:!0});var Rb=a(Ja);vm=l(Rb,"CLIPVisionModel"),Rb.forEach(o),ym=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=r(fi,"A",{href:!0,rel:!0});var Xb=a(Is);Tm=l(Xb,"openai/clip-vit-base-patch32"),Xb.forEach(o),Mm=l(fi," architecture."),fi.forEach(o),wm=h(Pn),vt=r(Pn,"P",{});var ui=a(vt);Im=l(ui,"Configuration objects inherit from "),Ea=r(ui,"A",{href:!0});var qb=a(Ea);Cm=l(qb,"PretrainedConfig"),qb.forEach(o),Pm=l(ui,` and can be used to control the model outputs. Read the
documentation from `),za=r(ui,"A",{href:!0});var Ab=a(za);$m=l(Ab,"PretrainedConfig"),Ab.forEach(o),km=l(ui," for more information."),ui.forEach(o),xm=h(Pn),T(yo.$$.fragment,Pn),Pn.forEach(o),Gd=h(t),yt=r(t,"H2",{class:!0});var kc=a(yt);To=r(kc,"A",{id:!0,class:!0,href:!0});var Sb=a(To);Bi=r(Sb,"SPAN",{});var Db=a(Bi);T(Cs.$$.fragment,Db),Db.forEach(o),Sb.forEach(o),Lm=h(kc),Ni=r(kc,"SPAN",{});var Yb=a(Ni);jm=l(Yb,"CLIPTokenizer"),Yb.forEach(o),kc.forEach(o),Rd=h(t),Z=r(t,"DIV",{class:!0});var se=a(Z);T(Ps.$$.fragment,se),Jm=h(se),Gi=r(se,"P",{});var Hb=a(Gi);Em=l(Hb,"Construct a CLIP tokenizer. Based on byte-level Byte-Pair-Encoding."),Hb.forEach(o),zm=h(se),$s=r(se,"P",{});var xc=a($s);Um=l(xc,"This tokenizer inherits from "),Ua=r(xc,"A",{href:!0});var Qb=a(Ua);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=r(se,"DIV",{class:!0});var $n=a(_e);T(ks.$$.fragment,$n),Zm=h($n),Ri=r($n,"P",{});var Ob=a(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=r($n,"UL",{});var Kb=a(Xi);Fa=r(Kb,"LI",{});var vb=a(Fa);Gm=l(vb,"single sequence: "),qi=r(vb,"CODE",{});var ev=a(qi);Rm=l(ev,"<|startoftext|> X <|endoftext|>"),ev.forEach(o),vb.forEach(o),Kb.forEach(o),Xm=h($n),Ai=r($n,"P",{});var tv=a(Ai);qm=l(tv,"Pairs of sequences are not the expected use case, but they will be handled without a separator."),tv.forEach(o),$n.forEach(o),Am=h(se),Mo=r(se,"DIV",{class:!0});var Lc=a(Mo);T(xs.$$.fragment,Lc),Sm=h(Lc),Ls=r(Lc,"P",{});var jc=a(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=r(jc,"CODE",{});var ov=a(Si);Ym=l(ov,"prepare_for_model"),ov.forEach(o),Hm=l(jc," method."),jc.forEach(o),Lc.forEach(o),Qm=h(se),wo=r(se,"DIV",{class:!0});var Jc=a(wo);T(js.$$.fragment,Jc),Om=h(Jc),Di=r(Jc,"P",{});var nv=a(Di);Km=l(nv,`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),nv.forEach(o),Jc.forEach(o),eh=h(se),Wa=r(se,"DIV",{class:!0});var sv=a(Wa);T(Js.$$.fragment,sv),sv.forEach(o),se.forEach(o),Xd=h(t),Tt=r(t,"H2",{class:!0});var Ec=a(Tt);Io=r(Ec,"A",{id:!0,class:!0,href:!0});var rv=a(Io);Yi=r(rv,"SPAN",{});var av=a(Yi);T(Es.$$.fragment,av),av.forEach(o),rv.forEach(o),th=h(Ec),Hi=r(Ec,"SPAN",{});var iv=a(Hi);oh=l(iv,"CLIPTokenizerFast"),iv.forEach(o),Ec.forEach(o),qd=h(t),Q=r(t,"DIV",{class:!0});var Qe=a(Q);T(zs.$$.fragment,Qe),nh=h(Qe),Us=r(Qe,"P",{});var zc=a(Us);sh=l(zc,"Construct a \u201Cfast\u201D CLIP tokenizer (backed by HuggingFace\u2019s "),Qi=r(zc,"EM",{});var lv=a(Qi);rh=l(lv,"tokenizers"),lv.forEach(o),ah=l(zc,` library). Based on byte-level
Byte-Pair-Encoding.`),zc.forEach(o),ih=h(Qe),Fs=r(Qe,"P",{});var Uc=a(Fs);lh=l(Uc,"This tokenizer inherits from "),Va=r(Uc,"A",{href:!0});var dv=a(Va);dh=l(dv,"PreTrainedTokenizerFast"),dv.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=r(Qe,"DIV",{class:!0});var kn=a(be);T(Ws.$$.fragment,kn),mh=h(kn),Oi=r(kn,"P",{});var cv=a(Oi);hh=l(cv,`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:`),cv.forEach(o),fh=h(kn),Ki=r(kn,"UL",{});var pv=a(Ki);Za=r(pv,"LI",{});var yb=a(Za);uh=l(yb,"single sequence: "),el=r(yb,"CODE",{});var mv=a(el);gh=l(mv,"<|startoftext|> X <|endoftext|>"),mv.forEach(o),yb.forEach(o),pv.forEach(o),_h=h(kn),tl=r(kn,"P",{});var hv=a(tl);bh=l(hv,"Pairs of sequences are not the expected use case, but they will be handled without a separator."),hv.forEach(o),kn.forEach(o),vh=h(Qe),Co=r(Qe,"DIV",{class:!0});var Fc=a(Co);T(Vs.$$.fragment,Fc),yh=h(Fc),ol=r(Fc,"P",{});var fv=a(ol);Th=l(fv,`Create a mask from the two sequences passed. CLIP does not make use of token type ids, therefore a list of
zeros is returned.`),fv.forEach(o),Fc.forEach(o),Qe.forEach(o),Ad=h(t),Mt=r(t,"H2",{class:!0});var Wc=a(Mt);Po=r(Wc,"A",{id:!0,class:!0,href:!0});var uv=a(Po);nl=r(uv,"SPAN",{});var gv=a(nl);T(Zs.$$.fragment,gv),gv.forEach(o),uv.forEach(o),Mh=h(Wc),sl=r(Wc,"SPAN",{});var _v=a(sl);wh=l(_v,"CLIPImageProcessor"),_v.forEach(o),Wc.forEach(o),Sd=h(t),Ze=r(t,"DIV",{class:!0});var gi=a(Ze);T(Bs.$$.fragment,gi),Ih=h(gi),rl=r(gi,"P",{});var bv=a(rl);Ch=l(bv,"Constructs a CLIP image processor."),bv.forEach(o),Ph=h(gi),$o=r(gi,"DIV",{class:!0});var Vc=a($o);T(Ns.$$.fragment,Vc),$h=h(Vc),al=r(Vc,"P",{});var vv=a(al);kh=l(vv,"Preprocess an image or batch of images."),vv.forEach(o),Vc.forEach(o),gi.forEach(o),Dd=h(t),wt=r(t,"H2",{class:!0});var Zc=a(wt);ko=r(Zc,"A",{id:!0,class:!0,href:!0});var yv=a(ko);il=r(yv,"SPAN",{});var Tv=a(il);T(Gs.$$.fragment,Tv),Tv.forEach(o),yv.forEach(o),xh=h(Zc),ll=r(Zc,"SPAN",{});var Mv=a(ll);Lh=l(Mv,"CLIPFeatureExtractor"),Mv.forEach(o),Zc.forEach(o),Yd=h(t),Rs=r(t,"DIV",{class:!0});var wv=a(Rs);T(Xs.$$.fragment,wv),wv.forEach(o),Hd=h(t),It=r(t,"H2",{class:!0});var Bc=a(It);xo=r(Bc,"A",{id:!0,class:!0,href:!0});var Iv=a(xo);dl=r(Iv,"SPAN",{});var Cv=a(dl);T(qs.$$.fragment,Cv),Cv.forEach(o),Iv.forEach(o),jh=h(Bc),cl=r(Bc,"SPAN",{});var Pv=a(cl);Jh=l(Pv,"CLIPProcessor"),Pv.forEach(o),Bc.forEach(o),Qd=h(t),O=r(t,"DIV",{class:!0});var Oe=a(O);T(As.$$.fragment,Oe),Eh=h(Oe),pl=r(Oe,"P",{});var $v=a(pl);zh=l($v,"Constructs a CLIP processor which wraps a CLIP image processor and a CLIP tokenizer into a single processor."),$v.forEach(o),Uh=h(Oe),ne=r(Oe,"P",{});var Ne=a(ne);Ba=r(Ne,"A",{href:!0});var kv=a(Ba);Fh=l(kv,"CLIPProcessor"),kv.forEach(o),Wh=l(Ne," offers all the functionalities of "),Na=r(Ne,"A",{href:!0});var xv=a(Na);Vh=l(xv,"CLIPImageProcessor"),xv.forEach(o),Zh=l(Ne," and "),Ga=r(Ne,"A",{href:!0});var Lv=a(Ga);Bh=l(Lv,"CLIPTokenizerFast"),Lv.forEach(o),Nh=l(Ne,`. See the
`),ml=r(Ne,"CODE",{});var jv=a(ml);Gh=l(jv,"__call__()"),jv.forEach(o),Rh=l(Ne," and "),Ra=r(Ne,"A",{href:!0});var Jv=a(Ra);Xh=l(Jv,"decode()"),Jv.forEach(o),qh=l(Ne," for more information."),Ne.forEach(o),Ah=h(Oe),Lo=r(Oe,"DIV",{class:!0});var Nc=a(Lo);T(Ss.$$.fragment,Nc),Sh=h(Nc),Ds=r(Nc,"P",{});var Gc=a(Ds);Dh=l(Gc,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),Xa=r(Gc,"A",{href:!0});var Ev=a(Xa);Yh=l(Ev,"batch_decode()"),Ev.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=r(Oe,"DIV",{class:!0});var Rc=a(jo);T(Ys.$$.fragment,Rc),Oh=h(Rc),Hs=r(Rc,"P",{});var Xc=a(Hs);Kh=l(Xc,"This method forwards all its arguments to CLIPTokenizerFast\u2019s "),qa=r(Xc,"A",{href:!0});var zv=a(qa);ef=l(zv,"decode()"),zv.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=r(t,"H2",{class:!0});var qc=a(Ct);Jo=r(qc,"A",{id:!0,class:!0,href:!0});var Uv=a(Jo);hl=r(Uv,"SPAN",{});var Fv=a(hl);T(Qs.$$.fragment,Fv),Fv.forEach(o),Uv.forEach(o),of=h(qc),fl=r(qc,"SPAN",{});var Wv=a(fl);nf=l(Wv,"CLIPModel"),Wv.forEach(o),qc.forEach(o),Kd=h(t),G=r(t,"DIV",{class:!0});var ze=a(G);T(Os.$$.fragment,ze),sf=h(ze),Ks=r(ze,"P",{});var Ac=a(Ks);rf=l(Ac,"This model inherits from "),Aa=r(Ac,"A",{href:!0});var Vv=a(Aa);af=l(Vv,"PreTrainedModel"),Vv.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),er=r(ze,"P",{});var Sc=a(er);cf=l(Sc,"This model is also a PyTorch "),tr=r(Sc,"A",{href:!0,rel:!0});var Zv=a(tr);pf=l(Zv,"torch.nn.Module"),Zv.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),ve=r(ze,"DIV",{class:!0});var xn=a(ve);T(or.$$.fragment,xn),ff=h(xn),Pt=r(xn,"P",{});var _i=a(Pt);uf=l(_i,"The "),Sa=r(_i,"A",{href:!0});var Bv=a(Sa);gf=l(Bv,"CLIPModel"),Bv.forEach(o),_f=l(_i," forward method, overrides the "),ul=r(_i,"CODE",{});var Nv=a(ul);bf=l(Nv,"__call__"),Nv.forEach(o),vf=l(_i," special method."),_i.forEach(o),yf=h(xn),T(Eo.$$.fragment,xn),Tf=h(xn),T(zo.$$.fragment,xn),xn.forEach(o),Mf=h(ze),ye=r(ze,"DIV",{class:!0});var Ln=a(ye);T(nr.$$.fragment,Ln),wf=h(Ln),$t=r(Ln,"P",{});var bi=a($t);If=l(bi,"The "),Da=r(bi,"A",{href:!0});var Gv=a(Da);Cf=l(Gv,"CLIPModel"),Gv.forEach(o),Pf=l(bi," forward method, overrides the "),gl=r(bi,"CODE",{});var Rv=a(gl);$f=l(Rv,"__call__"),Rv.forEach(o),kf=l(bi," special method."),bi.forEach(o),xf=h(Ln),T(Uo.$$.fragment,Ln),Lf=h(Ln),T(Fo.$$.fragment,Ln),Ln.forEach(o),jf=h(ze),Te=r(ze,"DIV",{class:!0});var jn=a(Te);T(sr.$$.fragment,jn),Jf=h(jn),kt=r(jn,"P",{});var vi=a(kt);Ef=l(vi,"The "),Ya=r(vi,"A",{href:!0});var Xv=a(Ya);zf=l(Xv,"CLIPModel"),Xv.forEach(o),Uf=l(vi," forward method, overrides the "),_l=r(vi,"CODE",{});var qv=a(_l);Ff=l(qv,"__call__"),qv.forEach(o),Wf=l(vi," special method."),vi.forEach(o),Vf=h(jn),T(Wo.$$.fragment,jn),Zf=h(jn),T(Vo.$$.fragment,jn),jn.forEach(o),ze.forEach(o),ec=h(t),xt=r(t,"H2",{class:!0});var Dc=a(xt);Zo=r(Dc,"A",{id:!0,class:!0,href:!0});var Av=a(Zo);bl=r(Av,"SPAN",{});var Sv=a(bl);T(rr.$$.fragment,Sv),Sv.forEach(o),Av.forEach(o),Bf=h(Dc),vl=r(Dc,"SPAN",{});var Dv=a(vl);Nf=l(Dv,"CLIPTextModel"),Dv.forEach(o),Dc.forEach(o),tc=h(t),de=r(t,"DIV",{class:!0});var Jn=a(de);T(ar.$$.fragment,Jn),Gf=h(Jn),ir=r(Jn,"P",{});var Yc=a(ir);Rf=l(Yc,`The text model from CLIP without any head or projection on top.
This model inherits from `),Ha=r(Yc,"A",{href:!0});var Yv=a(Ha);Xf=l(Yv,"PreTrainedModel"),Yv.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),lr=r(Jn,"P",{});var Hc=a(lr);Sf=l(Hc,"This model is also a PyTorch "),dr=r(Hc,"A",{href:!0,rel:!0});var Hv=a(dr);Df=l(Hv,"torch.nn.Module"),Hv.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=r(Jn,"DIV",{class:!0});var En=a(Me);T(cr.$$.fragment,En),Qf=h(En),Lt=r(En,"P",{});var yi=a(Lt);Of=l(yi,"The "),Qa=r(yi,"A",{href:!0});var Qv=a(Qa);Kf=l(Qv,"CLIPTextModel"),Qv.forEach(o),eu=l(yi," forward method, overrides the "),yl=r(yi,"CODE",{});var Ov=a(yl);tu=l(Ov,"__call__"),Ov.forEach(o),ou=l(yi," special method."),yi.forEach(o),nu=h(En),T(Bo.$$.fragment,En),su=h(En),T(No.$$.fragment,En),En.forEach(o),Jn.forEach(o),oc=h(t),jt=r(t,"H2",{class:!0});var Qc=a(jt);Go=r(Qc,"A",{id:!0,class:!0,href:!0});var Kv=a(Go);Tl=r(Kv,"SPAN",{});var ey=a(Tl);T(pr.$$.fragment,ey),ey.forEach(o),Kv.forEach(o),ru=h(Qc),Ml=r(Qc,"SPAN",{});var ty=a(Ml);au=l(ty,"CLIPTextModelWithProjection"),ty.forEach(o),Qc.forEach(o),nc=h(t),K=r(t,"DIV",{class:!0});var Ke=a(K);T(mr.$$.fragment,Ke),iu=h(Ke),wl=r(Ke,"P",{});var oy=a(wl);lu=l(oy,"CLIP Text Model with a projection layer on top (a linear layer on top of the pooled output)."),oy.forEach(o),du=h(Ke),hr=r(Ke,"P",{});var Oc=a(hr);cu=l(Oc,"This model inherits from "),Oa=r(Oc,"A",{href:!0});var ny=a(Oa);pu=l(ny,"PreTrainedModel"),ny.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),fr=r(Ke,"P",{});var Kc=a(fr);fu=l(Kc,"This model is also a PyTorch "),ur=r(Kc,"A",{href:!0,rel:!0});var sy=a(ur);uu=l(sy,"torch.nn.Module"),sy.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=r(Ke,"DIV",{class:!0});var zn=a(we);T(gr.$$.fragment,zn),bu=h(zn),Jt=r(zn,"P",{});var Ti=a(Jt);vu=l(Ti,"The "),Ka=r(Ti,"A",{href:!0});var ry=a(Ka);yu=l(ry,"CLIPTextModelWithProjection"),ry.forEach(o),Tu=l(Ti," forward method, overrides the "),Il=r(Ti,"CODE",{});var ay=a(Il);Mu=l(ay,"__call__"),ay.forEach(o),wu=l(Ti," special method."),Ti.forEach(o),Iu=h(zn),T(Ro.$$.fragment,zn),Cu=h(zn),T(Xo.$$.fragment,zn),zn.forEach(o),Ke.forEach(o),sc=h(t),Et=r(t,"H2",{class:!0});var ep=a(Et);qo=r(ep,"A",{id:!0,class:!0,href:!0});var iy=a(qo);Cl=r(iy,"SPAN",{});var ly=a(Cl);T(_r.$$.fragment,ly),ly.forEach(o),iy.forEach(o),Pu=h(ep),Pl=r(ep,"SPAN",{});var dy=a(Pl);$u=l(dy,"CLIPVisionModelWithProjection"),dy.forEach(o),ep.forEach(o),rc=h(t),ee=r(t,"DIV",{class:!0});var et=a(ee);T(br.$$.fragment,et),ku=h(et),$l=r(et,"P",{});var cy=a($l);xu=l(cy,"CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output)."),cy.forEach(o),Lu=h(et),vr=r(et,"P",{});var tp=a(vr);ju=l(tp,"This model inherits from "),ei=r(tp,"A",{href:!0});var py=a(ei);Ju=l(py,"PreTrainedModel"),py.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),yr=r(et,"P",{});var op=a(yr);Uu=l(op,"This model is also a PyTorch "),Tr=r(op,"A",{href:!0,rel:!0});var my=a(Tr);Fu=l(my,"torch.nn.Module"),my.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=r(et,"DIV",{class:!0});var Un=a(Ie);T(Mr.$$.fragment,Un),Zu=h(Un),zt=r(Un,"P",{});var Mi=a(zt);Bu=l(Mi,"The "),ti=r(Mi,"A",{href:!0});var hy=a(ti);Nu=l(hy,"CLIPVisionModelWithProjection"),hy.forEach(o),Gu=l(Mi," forward method, overrides the "),kl=r(Mi,"CODE",{});var fy=a(kl);Ru=l(fy,"__call__"),fy.forEach(o),Xu=l(Mi," special method."),Mi.forEach(o),qu=h(Un),T(Ao.$$.fragment,Un),Au=h(Un),T(So.$$.fragment,Un),Un.forEach(o),et.forEach(o),ac=h(t),Ut=r(t,"H2",{class:!0});var np=a(Ut);Do=r(np,"A",{id:!0,class:!0,href:!0});var uy=a(Do);xl=r(uy,"SPAN",{});var gy=a(xl);T(wr.$$.fragment,gy),gy.forEach(o),uy.forEach(o),Su=h(np),Ll=r(np,"SPAN",{});var _y=a(Ll);Du=l(_y,"CLIPVisionModel"),_y.forEach(o),np.forEach(o),ic=h(t),ce=r(t,"DIV",{class:!0});var Fn=a(ce);T(Ir.$$.fragment,Fn),Yu=h(Fn),Cr=r(Fn,"P",{});var sp=a(Cr);Hu=l(sp,`The vision model from CLIP without any head or projection on top.
This model inherits from `),oi=r(sp,"A",{href:!0});var by=a(oi);Qu=l(by,"PreTrainedModel"),by.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),Pr=r(Fn,"P",{});var rp=a(Pr);eg=l(rp,"This model is also a PyTorch "),$r=r(rp,"A",{href:!0,rel:!0});var vy=a($r);tg=l(vy,"torch.nn.Module"),vy.forEach(o),og=l(rp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),rp.forEach(o),ng=h(Fn),Ce=r(Fn,"DIV",{class:!0});var Wn=a(Ce);T(kr.$$.fragment,Wn),sg=h(Wn),Ft=r(Wn,"P",{});var wi=a(Ft);rg=l(wi,"The "),ni=r(wi,"A",{href:!0});var yy=a(ni);ag=l(yy,"CLIPVisionModel"),yy.forEach(o),ig=l(wi," forward method, overrides the "),jl=r(wi,"CODE",{});var Ty=a(jl);lg=l(Ty,"__call__"),Ty.forEach(o),dg=l(wi," special method."),wi.forEach(o),cg=h(Wn),T(Yo.$$.fragment,Wn),pg=h(Wn),T(Ho.$$.fragment,Wn),Wn.forEach(o),Fn.forEach(o),lc=h(t),Wt=r(t,"H2",{class:!0});var ap=a(Wt);Qo=r(ap,"A",{id:!0,class:!0,href:!0});var My=a(Qo);Jl=r(My,"SPAN",{});var wy=a(Jl);T(xr.$$.fragment,wy),wy.forEach(o),My.forEach(o),mg=h(ap),El=r(ap,"SPAN",{});var Iy=a(El);hg=l(Iy,"TFCLIPModel"),Iy.forEach(o),ap.forEach(o),dc=h(t),B=r(t,"DIV",{class:!0});var re=a(B);T(Lr.$$.fragment,re),fg=h(re),jr=r(re,"P",{});var ip=a(jr);ug=l(ip,"This model inherits from "),si=r(ip,"A",{href:!0});var Cy=a(si);gg=l(Cy,"TFPreTrainedModel"),Cy.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(re),Jr=r(re,"P",{});var lp=a(Jr);vg=l(lp,"This model is also a "),Er=r(lp,"A",{href:!0,rel:!0});var Py=a(Er);yg=l(Py,"tf.keras.Model"),Py.forEach(o),Tg=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(re),T(Oo.$$.fragment,re),wg=h(re),Pe=r(re,"DIV",{class:!0});var Vn=a(Pe);T(zr.$$.fragment,Vn),Ig=h(Vn),Vt=r(Vn,"P",{});var Ii=a(Vt);Cg=l(Ii,"The "),ri=r(Ii,"A",{href:!0});var $y=a(ri);Pg=l($y,"TFCLIPModel"),$y.forEach(o),$g=l(Ii," forward method, overrides the "),zl=r(Ii,"CODE",{});var ky=a(zl);kg=l(ky,"__call__"),ky.forEach(o),xg=l(Ii," special method."),Ii.forEach(o),Lg=h(Vn),T(Ko.$$.fragment,Vn),jg=h(Vn),T(en.$$.fragment,Vn),Vn.forEach(o),Jg=h(re),$e=r(re,"DIV",{class:!0});var Zn=a($e);T(Ur.$$.fragment,Zn),Eg=h(Zn),Zt=r(Zn,"P",{});var Ci=a(Zt);zg=l(Ci,"The "),ai=r(Ci,"A",{href:!0});var xy=a(ai);Ug=l(xy,"TFCLIPModel"),xy.forEach(o),Fg=l(Ci," forward method, overrides the "),Ul=r(Ci,"CODE",{});var Ly=a(Ul);Wg=l(Ly,"__call__"),Ly.forEach(o),Vg=l(Ci," special method."),Ci.forEach(o),Zg=h(Zn),T(tn.$$.fragment,Zn),Bg=h(Zn),T(on.$$.fragment,Zn),Zn.forEach(o),Ng=h(re),ke=r(re,"DIV",{class:!0});var Bn=a(ke);T(Fr.$$.fragment,Bn),Gg=h(Bn),Bt=r(Bn,"P",{});var Pi=a(Bt);Rg=l(Pi,"The "),ii=r(Pi,"A",{href:!0});var jy=a(ii);Xg=l(jy,"TFCLIPModel"),jy.forEach(o),qg=l(Pi," forward method, overrides the "),Fl=r(Pi,"CODE",{});var Jy=a(Fl);Ag=l(Jy,"__call__"),Jy.forEach(o),Sg=l(Pi," special method."),Pi.forEach(o),Dg=h(Bn),T(nn.$$.fragment,Bn),Yg=h(Bn),T(sn.$$.fragment,Bn),Bn.forEach(o),re.forEach(o),cc=h(t),Nt=r(t,"H2",{class:!0});var dp=a(Nt);rn=r(dp,"A",{id:!0,class:!0,href:!0});var Ey=a(rn);Wl=r(Ey,"SPAN",{});var zy=a(Wl);T(Wr.$$.fragment,zy),zy.forEach(o),Ey.forEach(o),Hg=h(dp),Vl=r(dp,"SPAN",{});var Uy=a(Vl);Qg=l(Uy,"TFCLIPTextModel"),Uy.forEach(o),dp.forEach(o),pc=h(t),Gt=r(t,"DIV",{class:!0});var cp=a(Gt);T(Vr.$$.fragment,cp),Og=h(cp),xe=r(cp,"DIV",{class:!0});var Nn=a(xe);T(Zr.$$.fragment,Nn),Kg=h(Nn),Rt=r(Nn,"P",{});var $i=a(Rt);e_=l($i,"The "),li=r($i,"A",{href:!0});var Fy=a(li);t_=l(Fy,"TFCLIPTextModel"),Fy.forEach(o),o_=l($i," forward method, overrides the "),Zl=r($i,"CODE",{});var Wy=a(Zl);n_=l(Wy,"__call__"),Wy.forEach(o),s_=l($i," special method."),$i.forEach(o),r_=h(Nn),T(an.$$.fragment,Nn),a_=h(Nn),T(ln.$$.fragment,Nn),Nn.forEach(o),cp.forEach(o),mc=h(t),Xt=r(t,"H2",{class:!0});var pp=a(Xt);dn=r(pp,"A",{id:!0,class:!0,href:!0});var Vy=a(dn);Bl=r(Vy,"SPAN",{});var Zy=a(Bl);T(Br.$$.fragment,Zy),Zy.forEach(o),Vy.forEach(o),i_=h(pp),Nl=r(pp,"SPAN",{});var By=a(Nl);l_=l(By,"TFCLIPVisionModel"),By.forEach(o),pp.forEach(o),hc=h(t),qt=r(t,"DIV",{class:!0});var mp=a(qt);T(Nr.$$.fragment,mp),d_=h(mp),Le=r(mp,"DIV",{class:!0});var Gn=a(Le);T(Gr.$$.fragment,Gn),c_=h(Gn),At=r(Gn,"P",{});var ki=a(At);p_=l(ki,"The "),di=r(ki,"A",{href:!0});var Ny=a(di);m_=l(Ny,"TFCLIPVisionModel"),Ny.forEach(o),h_=l(ki," forward method, overrides the "),Gl=r(ki,"CODE",{});var Gy=a(Gl);f_=l(Gy,"__call__"),Gy.forEach(o),u_=l(ki," special method."),ki.forEach(o),g_=h(Gn),T(cn.$$.fragment,Gn),__=h(Gn),T(pn.$$.fragment,Gn),Gn.forEach(o),mp.forEach(o),fc=h(t),St=r(t,"H2",{class:!0});var hp=a(St);mn=r(hp,"A",{id:!0,class:!0,href:!0});var Ry=a(mn);Rl=r(Ry,"SPAN",{});var Xy=a(Rl);T(Rr.$$.fragment,Xy),Xy.forEach(o),Ry.forEach(o),b_=h(hp),Xl=r(hp,"SPAN",{});var qy=a(Xl);v_=l(qy,"FlaxCLIPModel"),qy.forEach(o),hp.forEach(o),uc=h(t),z=r(t,"DIV",{class:!0});var A=a(z);T(Xr.$$.fragment,A),y_=h(A),qr=r(A,"P",{});var fp=a(qr);T_=l(fp,"This model inherits from "),ci=r(fp,"A",{href:!0});var Ay=a(ci);M_=l(Ay,"FlaxPreTrainedModel"),Ay.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),Ar=r(A,"P",{});var up=a(Ar);C_=l(up,"This model is also a Flax Linen "),Sr=r(up,"A",{href:!0,rel:!0});var Sy=a(Sr);P_=l(Sy,"flax.linen.Module"),Sy.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=r(A,"P",{});var Dy=a(ql);x_=l(Dy,"Finally, this model supports inherent JAX features such as:"),Dy.forEach(o),L_=h(A),Be=r(A,"UL",{});var Rn=a(Be);Al=r(Rn,"LI",{});var Yy=a(Al);Dr=r(Yy,"A",{href:!0,rel:!0});var Hy=a(Dr);j_=l(Hy,"Just-In-Time (JIT) compilation"),Hy.forEach(o),Yy.forEach(o),J_=h(Rn),Sl=r(Rn,"LI",{});var Qy=a(Sl);Yr=r(Qy,"A",{href:!0,rel:!0});var Oy=a(Yr);E_=l(Oy,"Automatic Differentiation"),Oy.forEach(o),Qy.forEach(o),z_=h(Rn),Dl=r(Rn,"LI",{});var Ky=a(Dl);Hr=r(Ky,"A",{href:!0,rel:!0});var eT=a(Hr);U_=l(eT,"Vectorization"),eT.forEach(o),Ky.forEach(o),F_=h(Rn),Yl=r(Rn,"LI",{});var tT=a(Yl);Qr=r(tT,"A",{href:!0,rel:!0});var oT=a(Qr);W_=l(oT,"Parallelization"),oT.forEach(o),tT.forEach(o),Rn.forEach(o),V_=h(A),je=r(A,"DIV",{class:!0});var Xn=a(je);T(Or.$$.fragment,Xn),Z_=h(Xn),Dt=r(Xn,"P",{});var xi=a(Dt);B_=l(xi,"The "),Hl=r(xi,"CODE",{});var nT=a(Hl);N_=l(nT,"FlaxCLIPPreTrainedModel"),nT.forEach(o),G_=l(xi," forward method, overrides the "),Ql=r(xi,"CODE",{});var sT=a(Ql);R_=l(sT,"__call__"),sT.forEach(o),X_=l(xi," special method."),xi.forEach(o),q_=h(Xn),T(hn.$$.fragment,Xn),A_=h(Xn),T(fn.$$.fragment,Xn),Xn.forEach(o),S_=h(A),un=r(A,"DIV",{class:!0});var gp=a(un);T(Kr.$$.fragment,gp),D_=h(gp),T(gn.$$.fragment,gp),gp.forEach(o),Y_=h(A),_n=r(A,"DIV",{class:!0});var _p=a(_n);T(ea.$$.fragment,_p),H_=h(_p),T(bn.$$.fragment,_p),_p.forEach(o),A.forEach(o),gc=h(t),Yt=r(t,"H2",{class:!0});var bp=a(Yt);vn=r(bp,"A",{id:!0,class:!0,href:!0});var rT=a(vn);Ol=r(rT,"SPAN",{});var aT=a(Ol);T(ta.$$.fragment,aT),aT.forEach(o),rT.forEach(o),Q_=h(bp),Kl=r(bp,"SPAN",{});var iT=a(Kl);O_=l(iT,"FlaxCLIPTextModel"),iT.forEach(o),bp.forEach(o),_c=h(t),Ht=r(t,"DIV",{class:!0});var vp=a(Ht);T(oa.$$.fragment,vp),K_=h(vp),Je=r(vp,"DIV",{class:!0});var qn=a(Je);T(na.$$.fragment,qn),eb=h(qn),Qt=r(qn,"P",{});var Li=a(Qt);tb=l(Li,"The "),ed=r(Li,"CODE",{});var lT=a(ed);ob=l(lT,"FlaxCLIPTextPreTrainedModel"),lT.forEach(o),nb=l(Li," forward method, overrides the "),td=r(Li,"CODE",{});var dT=a(td);sb=l(dT,"__call__"),dT.forEach(o),rb=l(Li," special method."),Li.forEach(o),ab=h(qn),T(yn.$$.fragment,qn),ib=h(qn),T(Tn.$$.fragment,qn),qn.forEach(o),vp.forEach(o),bc=h(t),Ot=r(t,"H2",{class:!0});var yp=a(Ot);Mn=r(yp,"A",{id:!0,class:!0,href:!0});var cT=a(Mn);od=r(cT,"SPAN",{});var pT=a(od);T(sa.$$.fragment,pT),pT.forEach(o),cT.forEach(o),lb=h(yp),nd=r(yp,"SPAN",{});var mT=a(nd);db=l(mT,"FlaxCLIPVisionModel"),mT.forEach(o),yp.forEach(o),vc=h(t),Kt=r(t,"DIV",{class:!0});var Tp=a(Kt);T(ra.$$.fragment,Tp),cb=h(Tp),Ee=r(Tp,"DIV",{class:!0});var An=a(Ee);T(aa.$$.fragment,An),pb=h(An),eo=r(An,"P",{});var ji=a(eo);mb=l(ji,"The "),sd=r(ji,"CODE",{});var hT=a(sd);hb=l(hT,"FlaxCLIPVisionPreTrainedModel"),hT.forEach(o),fb=l(ji," forward method, overrides the "),rd=r(ji,"CODE",{});var fT=a(rd);ub=l(fT,"__call__"),fT.forEach(o),gb=l(ji," special method."),ji.forEach(o),_b=h(An),T(wn.$$.fragment,An),bb=h(An),T(In.$$.fragment,An),An.forEach(o),Tp.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/v4.32.0/en/model_doc/clip#transformers.CLIPImageProcessor"),f(ue,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPTokenizer"),f(Y,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPProcessor"),f(qe,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPImageProcessor"),f(E,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPTokenizer"),f(lt,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPProcessor"),f(dt,"href","/docs/transformers/v4.32.0/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(Ia,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPConfig"),f(Ca,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPModel"),f(gs,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f(gs,"rel","nofollow"),f(Pa,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),f($a,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),f(ka,"href","/docs/transformers/v4.32.0/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(xa,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPTextModel"),f(Ts,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f(Ts,"rel","nofollow"),f(La,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),f(ja,"href","/docs/transformers/v4.32.0/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(vo,"id","transformers.CLIPVisionConfig"),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.CLIPVisionConfig"),f(_t,"class","relative group"),f(Ja,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPVisionModel"),f(Is,"href","https://huggingface.co/openai/clip-vit-base-patch32"),f(Is,"rel","nofollow"),f(Ea,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),f(za,"href","/docs/transformers/v4.32.0/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(To,"id","transformers.CLIPTokenizer"),f(To,"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(To,"href","#transformers.CLIPTokenizer"),f(yt,"class","relative group"),f(Ua,"href","/docs/transformers/v4.32.0/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(Wa,"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(Tt,"class","relative group"),f(Va,"href","/docs/transformers/v4.32.0/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(Ba,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPProcessor"),f(Na,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPImageProcessor"),f(Ga,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPTokenizerFast"),f(Ra,"href","/docs/transformers/v4.32.0/en/model_doc/clip#transformers.CLIPProcessor.decode"),f(Xa,"href","/docs/transformers/v4.32.0/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(qa,"href","/docs/transformers/v4.32.0/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(Aa,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(tr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(tr,"rel","nofollow"),f(Sa,"href","/docs/transformers/v4.32.0/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(Da,"href","/docs/transformers/v4.32.0/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(Ya,"href","/docs/transformers/v4.32.0/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(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(Ha,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(dr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(dr,"rel","nofollow"),f(Qa,"href","/docs/transformers/v4.32.0/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(Oa,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(ur,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ur,"rel","nofollow"),f(Ka,"href","/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f(Tr,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Tr,"rel","nofollow"),f(ti,"href","/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/model#transformers.PreTrainedModel"),f($r,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f($r,"rel","nofollow"),f(ni,"href","/docs/transformers/v4.32.0/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/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel"),f(Er,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Er,"rel","nofollow"),f(ri,"href","/docs/transformers/v4.32.0/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(ai,"href","/docs/transformers/v4.32.0/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/v4.32.0/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(rn,"id","transformers.TFCLIPTextModel"),f(rn,"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(rn,"href","#transformers.TFCLIPTextModel"),f(Nt,"class","relative group"),f(li,"href","/docs/transformers/v4.32.0/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/v4.32.0/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/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),f(Sr,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),f(Sr,"rel","nofollow"),f(Dr,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),f(Dr,"rel","nofollow"),f(Yr,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),f(Yr,"rel","nofollow"),f(Hr,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),f(Hr,"rel","nofollow"),f(Qr,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),f(Qr,"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(vn,"id","transformers.FlaxCLIPTextModel"),f(vn,"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(vn,"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,v,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,ro,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(ae,st,null),e(F,es),e(F,rt),e(rt,at),b(t,ao,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,rs),e(L,We),e(L,qe),e(qe,as),e(L,x),e(L,E),e(E,ua),e(L,po),e(L,lt),e(lt,ga),e(L,X),e(L,dt),e(dt,_a),e(L,ba),b(t,is,g),M(Ae,t,g),b(t,Ve,g),b(t,q,g),e(q,va),e(q,Se),e(Se,ct),e(q,ya),e(q,De),e(De,ls),e(q,Ta),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,Ma,g),e(Ma,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,wa,g),e(wa,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,Ia),e(Ia,Fp),e(Ye,Wp),e(Ye,Ca),e(Ca,Vp),e(Ye,Zp),e(Ye,gs),e(gs,Bp),e(Ye,Np),e(H,Gp),e(H,ht),e(ht,Rp),e(ht,Pa),e(Pa,Xp),e(ht,qp),e(ht,$a),e($a,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,ka),e(ka,Op),e(bs,Kp),b(t,Vd,g),b(t,ft,g),e(ft,_o),e(_o,Fi),M(vs,Fi,null),e(ft,em),e(ft,Wi),e(Wi,tm),b(t,Zd,g),b(t,ie,g),M(ys,ie,null),e(ie,om),e(ie,ut),e(ut,nm),e(ut,xa),e(xa,sm),e(ut,rm),e(ut,Ts),e(Ts,am),e(ut,im),e(ie,lm),e(ie,gt),e(gt,dm),e(gt,La),e(La,cm),e(gt,pm),e(gt,ja),e(ja,mm),e(gt,hm),e(ie,fm),M(bo,ie,null),b(t,Bd,g),b(t,_t,g),e(_t,vo),e(vo,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,Ja),e(Ja,vm),e(bt,ym),e(bt,Is),e(Is,Tm),e(bt,Mm),e(le,wm),e(le,vt),e(vt,Im),e(vt,Ea),e(Ea,Cm),e(vt,Pm),e(vt,za),e(za,$m),e(vt,km),e(le,xm),M(yo,le,null),b(t,Gd,g),b(t,yt,g),e(yt,To),e(To,Bi),M(Cs,Bi,null),e(yt,Lm),e(yt,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,Ua),e(Ua,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,Fa),e(Fa,Gm),e(Fa,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,Wa),M(Js,Wa,null),b(t,Xd,g),b(t,Tt,g),e(Tt,Io),e(Io,Yi),M(Es,Yi,null),e(Tt,th),e(Tt,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,rh),e(Us,ah),e(Q,ih),e(Q,Fs),e(Fs,lh),e(Fs,Va),e(Va,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,Za),e(Za,uh),e(Za,el),e(el,gh),e(be,_h),e(be,tl),e(tl,bh),e(Q,vh),e(Q,Co),M(Vs,Co,null),e(Co,yh),e(Co,ol),e(ol,Th),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,rl),e(rl,Ch),e(Ze,Ph),e(Ze,$o),M(Ns,$o,null),e($o,$h),e($o,al),e(al,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,Ba),e(Ba,Fh),e(ne,Wh),e(ne,Na),e(Na,Vh),e(ne,Zh),e(ne,Ga),e(Ga,Bh),e(ne,Nh),e(ne,ml),e(ml,Gh),e(ne,Rh),e(ne,Ra),e(Ra,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,Xa),e(Xa,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,qa),e(qa,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,rf),e(Ks,Aa),e(Aa,af),e(Ks,lf),e(G,df),e(G,er),e(er,cf),e(er,tr),e(tr,pf),e(er,mf),e(G,hf),e(G,ve),M(or,ve,null),e(ve,ff),e(ve,Pt),e(Pt,uf),e(Pt,Sa),e(Sa,gf),e(Pt,_f),e(Pt,ul),e(ul,bf),e(Pt,vf),e(ve,yf),M(Eo,ve,null),e(ve,Tf),M(zo,ve,null),e(G,Mf),e(G,ye),M(nr,ye,null),e(ye,wf),e(ye,$t),e($t,If),e($t,Da),e(Da,Cf),e($t,Pf),e($t,gl),e(gl,$f),e($t,kf),e(ye,xf),M(Uo,ye,null),e(ye,Lf),M(Fo,ye,null),e(G,jf),e(G,Te),M(sr,Te,null),e(Te,Jf),e(Te,kt),e(kt,Ef),e(kt,Ya),e(Ya,zf),e(kt,Uf),e(kt,_l),e(_l,Ff),e(kt,Wf),e(Te,Vf),M(Wo,Te,null),e(Te,Zf),M(Vo,Te,null),b(t,ec,g),b(t,xt,g),e(xt,Zo),e(Zo,bl),M(rr,bl,null),e(xt,Bf),e(xt,vl),e(vl,Nf),b(t,tc,g),b(t,de,g),M(ar,de,null),e(de,Gf),e(de,ir),e(ir,Rf),e(ir,Ha),e(Ha,Xf),e(ir,qf),e(de,Af),e(de,lr),e(lr,Sf),e(lr,dr),e(dr,Df),e(lr,Yf),e(de,Hf),e(de,Me),M(cr,Me,null),e(Me,Qf),e(Me,Lt),e(Lt,Of),e(Lt,Qa),e(Qa,Kf),e(Lt,eu),e(Lt,yl),e(yl,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,Tl),M(pr,Tl,null),e(jt,ru),e(jt,Ml),e(Ml,au),b(t,nc,g),b(t,K,g),M(mr,K,null),e(K,iu),e(K,wl),e(wl,lu),e(K,du),e(K,hr),e(hr,cu),e(hr,Oa),e(Oa,pu),e(hr,mu),e(K,hu),e(K,fr),e(fr,fu),e(fr,ur),e(ur,uu),e(fr,gu),e(K,_u),e(K,we),M(gr,we,null),e(we,bu),e(we,Jt),e(Jt,vu),e(Jt,Ka),e(Ka,yu),e(Jt,Tu),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(_r,Cl,null),e(Et,Pu),e(Et,Pl),e(Pl,$u),b(t,rc,g),b(t,ee,g),M(br,ee,null),e(ee,ku),e(ee,$l),e($l,xu),e(ee,Lu),e(ee,vr),e(vr,ju),e(vr,ei),e(ei,Ju),e(vr,Eu),e(ee,zu),e(ee,yr),e(yr,Uu),e(yr,Tr),e(Tr,Fu),e(yr,Wu),e(ee,Vu),e(ee,Ie),M(Mr,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,ac,g),b(t,Ut,g),e(Ut,Do),e(Do,xl),M(wr,xl,null),e(Ut,Su),e(Ut,Ll),e(Ll,Du),b(t,ic,g),b(t,ce,g),M(Ir,ce,null),e(ce,Yu),e(ce,Cr),e(Cr,Hu),e(Cr,oi),e(oi,Qu),e(Cr,Ou),e(ce,Ku),e(ce,Pr),e(Pr,eg),e(Pr,$r),e($r,tg),e(Pr,og),e(ce,ng),e(ce,Ce),M(kr,Ce,null),e(Ce,sg),e(Ce,Ft),e(Ft,rg),e(Ft,ni),e(ni,ag),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(xr,Jl,null),e(Wt,mg),e(Wt,El),e(El,hg),b(t,dc,g),b(t,B,g),M(Lr,B,null),e(B,fg),e(B,jr),e(jr,ug),e(jr,si),e(si,gg),e(jr,_g),e(B,bg),e(B,Jr),e(Jr,vg),e(Jr,Er),e(Er,yg),e(Jr,Tg),e(B,Mg),M(Oo,B,null),e(B,wg),e(B,Pe),M(zr,Pe,null),e(Pe,Ig),e(Pe,Vt),e(Vt,Cg),e(Vt,ri),e(ri,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(Ur,$e,null),e($e,Eg),e($e,Zt),e(Zt,zg),e(Zt,ai),e(ai,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(Fr,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,rn),e(rn,Wl),M(Wr,Wl,null),e(Nt,Hg),e(Nt,Vl),e(Vl,Qg),b(t,pc,g),b(t,Gt,g),M(Vr,Gt,null),e(Gt,Og),e(Gt,xe),M(Zr,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,r_),M(an,xe,null),e(xe,a_),M(ln,xe,null),b(t,mc,g),b(t,Xt,g),e(Xt,dn),e(dn,Bl),M(Br,Bl,null),e(Xt,i_),e(Xt,Nl),e(Nl,l_),b(t,hc,g),b(t,qt,g),M(Nr,qt,null),e(qt,d_),e(qt,Le),M(Gr,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(Rr,Rl,null),e(St,b_),e(St,Xl),e(Xl,v_),b(t,uc,g),b(t,z,g),M(Xr,z,null),e(z,y_),e(z,qr),e(qr,T_),e(qr,ci),e(ci,M_),e(qr,w_),e(z,I_),e(z,Ar),e(Ar,C_),e(Ar,Sr),e(Sr,P_),e(Ar,$_),e(z,k_),e(z,ql),e(ql,x_),e(z,L_),e(z,Be),e(Be,Al),e(Al,Dr),e(Dr,j_),e(Be,J_),e(Be,Sl),e(Sl,Yr),e(Yr,E_),e(Be,z_),e(Be,Dl),e(Dl,Hr),e(Hr,U_),e(Be,F_),e(Be,Yl),e(Yl,Qr),e(Qr,W_),e(z,V_),e(z,je),M(Or,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(Kr,un,null),e(un,D_),M(gn,un,null),e(z,Y_),e(z,_n),M(ea,_n,null),e(_n,H_),M(bn,_n,null),b(t,gc,g),b(t,Yt,g),e(Yt,vn),e(vn,Ol),M(ta,Ol,null),e(Yt,Q_),e(Yt,Kl),e(Kl,O_),b(t,_c,g),b(t,Ht,g),M(oa,Ht,null),e(Ht,K_),e(Ht,Je),M(na,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,rb),e(Je,ab),M(yn,Je,null),e(Je,ib),M(Tn,Je,null),b(t,bc,g),b(t,Ot,g),e(Ot,Mn),e(Mn,od),M(sa,od,null),e(Ot,lb),e(Ot,nd),e(nd,db),b(t,vc,g),b(t,Kt,g),M(ra,Kt,null),e(Kt,cb),e(Kt,Ee),M(aa,Ee,null),e(Ee,pb),e(Ee,eo),e(eo,mb),e(eo,sd),e(sd,hb),e(eo,fb),e(eo,rd),e(rd,ub),e(eo,gb),e(Ee,_b),M(wn,Ee,null),e(Ee,bb),M(In,Ee,null),yc=!0},p(t,[g]){const ia={};g&2&&(ia.$$scope={dirty:g,ctx:t}),uo.$set(ia);const ad={};g&2&&(ad.$$scope={dirty:g,ctx:t}),bo.$set(ad);const id={};g&2&&(id.$$scope={dirty:g,ctx:t}),yo.$set(id);const ld={};g&2&&(ld.$$scope={dirty:g,ctx:t}),Eo.$set(ld);const la={};g&2&&(la.$$scope={dirty:g,ctx:t}),zo.$set(la);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 da={};g&2&&(da.$$scope={dirty:g,ctx:t}),Vo.$set(da);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 ca={};g&2&&(ca.$$scope={dirty:g,ctx:t}),Ao.$set(ca);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 vd={};g&2&&(vd.$$scope={dirty:g,ctx:t}),Oo.$set(vd);const pa={};g&2&&(pa.$$scope={dirty:g,ctx:t}),Ko.$set(pa);const yd={};g&2&&(yd.$$scope={dirty:g,ctx:t}),en.$set(yd);const R={};g&2&&(R.$$scope={dirty:g,ctx:t}),tn.$set(R);const Td={};g&2&&(Td.$$scope={dirty:g,ctx:t}),on.$set(Td);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}),an.$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 ma={};g&2&&(ma.$$scope={dirty:g,ctx:t}),gn.$set(ma);const xd={};g&2&&(xd.$$scope={dirty:g,ctx:t}),bn.$set(xd);const Ld={};g&2&&(Ld.$$scope={dirty:g,ctx:t}),yn.$set(Ld);const jd={};g&2&&(jd.$$scope={dirty:g,ctx:t}),Tn.$set(jd);const Jd={};g&2&&(Jd.$$scope={dirty:g,ctx:t}),wn.$set(Jd);const ha={};g&2&&(ha.$$scope={dirty:g,ctx:t}),In.$set(ha)},i(t){yc||(w(n.$$.fragment,t),w(j.$$.fragment,t),w(ae.$$.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(vs.$$.fragment,t),w(ys.$$.fragment,t),w(bo.$$.fragment,t),w(Ms.$$.fragment,t),w(ws.$$.fragment,t),w(yo.$$.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(or.$$.fragment,t),w(Eo.$$.fragment,t),w(zo.$$.fragment,t),w(nr.$$.fragment,t),w(Uo.$$.fragment,t),w(Fo.$$.fragment,t),w(sr.$$.fragment,t),w(Wo.$$.fragment,t),w(Vo.$$.fragment,t),w(rr.$$.fragment,t),w(ar.$$.fragment,t),w(cr.$$.fragment,t),w(Bo.$$.fragment,t),w(No.$$.fragment,t),w(pr.$$.fragment,t),w(mr.$$.fragment,t),w(gr.$$.fragment,t),w(Ro.$$.fragment,t),w(Xo.$$.fragment,t),w(_r.$$.fragment,t),w(br.$$.fragment,t),w(Mr.$$.fragment,t),w(Ao.$$.fragment,t),w(So.$$.fragment,t),w(wr.$$.fragment,t),w(Ir.$$.fragment,t),w(kr.$$.fragment,t),w(Yo.$$.fragment,t),w(Ho.$$.fragment,t),w(xr.$$.fragment,t),w(Lr.$$.fragment,t),w(Oo.$$.fragment,t),w(zr.$$.fragment,t),w(Ko.$$.fragment,t),w(en.$$.fragment,t),w(Ur.$$.fragment,t),w(tn.$$.fragment,t),w(on.$$.fragment,t),w(Fr.$$.fragment,t),w(nn.$$.fragment,t),w(sn.$$.fragment,t),w(Wr.$$.fragment,t),w(Vr.$$.fragment,t),w(Zr.$$.fragment,t),w(an.$$.fragment,t),w(ln.$$.fragment,t),w(Br.$$.fragment,t),w(Nr.$$.fragment,t),w(Gr.$$.fragment,t),w(cn.$$.fragment,t),w(pn.$$.fragment,t),w(Rr.$$.fragment,t),w(Xr.$$.fragment,t),w(Or.$$.fragment,t),w(hn.$$.fragment,t),w(fn.$$.fragment,t),w(Kr.$$.fragment,t),w(gn.$$.fragment,t),w(ea.$$.fragment,t),w(bn.$$.fragment,t),w(ta.$$.fragment,t),w(oa.$$.fragment,t),w(na.$$.fragment,t),w(yn.$$.fragment,t),w(Tn.$$.fragment,t),w(sa.$$.fragment,t),w(ra.$$.fragment,t),w(aa.$$.fragment,t),w(wn.$$.fragment,t),w(In.$$.fragment,t),yc=!0)},o(t){I(n.$$.fragment,t),I(j.$$.fragment,t),I(ae.$$.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(vs.$$.fragment,t),I(ys.$$.fragment,t),I(bo.$$.fragment,t),I(Ms.$$.fragment,t),I(ws.$$.fragment,t),I(yo.$$.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(or.$$.fragment,t),I(Eo.$$.fragment,t),I(zo.$$.fragment,t),I(nr.$$.fragment,t),I(Uo.$$.fragment,t),I(Fo.$$.fragment,t),I(sr.$$.fragment,t),I(Wo.$$.fragment,t),I(Vo.$$.fragment,t),I(rr.$$.fragment,t),I(ar.$$.fragment,t),I(cr.$$.fragment,t),I(Bo.$$.fragment,t),I(No.$$.fragment,t),I(pr.$$.fragment,t),I(mr.$$.fragment,t),I(gr.$$.fragment,t),I(Ro.$$.fragment,t),I(Xo.$$.fragment,t),I(_r.$$.fragment,t),I(br.$$.fragment,t),I(Mr.$$.fragment,t),I(Ao.$$.fragment,t),I(So.$$.fragment,t),I(wr.$$.fragment,t),I(Ir.$$.fragment,t),I(kr.$$.fragment,t),I(Yo.$$.fragment,t),I(Ho.$$.fragment,t),I(xr.$$.fragment,t),I(Lr.$$.fragment,t),I(Oo.$$.fragment,t),I(zr.$$.fragment,t),I(Ko.$$.fragment,t),I(en.$$.fragment,t),I(Ur.$$.fragment,t),I(tn.$$.fragment,t),I(on.$$.fragment,t),I(Fr.$$.fragment,t),I(nn.$$.fragment,t),I(sn.$$.fragment,t),I(Wr.$$.fragment,t),I(Vr.$$.fragment,t),I(Zr.$$.fragment,t),I(an.$$.fragment,t),I(ln.$$.fragment,t),I(Br.$$.fragment,t),I(Nr.$$.fragment,t),I(Gr.$$.fragment,t),I(cn.$$.fragment,t),I(pn.$$.fragment,t),I(Rr.$$.fragment,t),I(Xr.$$.fragment,t),I(Or.$$.fragment,t),I(hn.$$.fragment,t),I(fn.$$.fragment,t),I(Kr.$$.fragment,t),I(gn.$$.fragment,t),I(ea.$$.fragment,t),I(bn.$$.fragment,t),I(ta.$$.fragment,t),I(oa.$$.fragment,t),I(na.$$.fragment,t),I(yn.$$.fragment,t),I(Tn.$$.fragment,t),I(sa.$$.fragment,t),I(ra.$$.fragment,t),I(aa.$$.fragment,t),I(wn.$$.fragment,t),I(In.$$.fragment,t),yc=!1},d(t){o(d),t&&o(v),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(ro),t&&o(he),t&&o(nt),t&&o(F),C(ae),t&&o(ao),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(Ma),t&&o(zd),t&&o(ho),t&&o(Ud),t&&o(wa),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(vs),t&&o(Zd),t&&o(ie),C(ys),C(bo),t&&o(Bd),t&&o(_t),C(Ms),t&&o(Nd),t&&o(le),C(ws),C(yo),t&&o(Gd),t&&o(yt),C(Cs),t&&o(Rd),t&&o(Z),C(Ps),C(ks),C(xs),C(js),C(Js),t&&o(Xd),t&&o(Tt),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(or),C(Eo),C(zo),C(nr),C(Uo),C(Fo),C(sr),C(Wo),C(Vo),t&&o(ec),t&&o(xt),C(rr),t&&o(tc),t&&o(de),C(ar),C(cr),C(Bo),C(No),t&&o(oc),t&&o(jt),C(pr),t&&o(nc),t&&o(K),C(mr),C(gr),C(Ro),C(Xo),t&&o(sc),t&&o(Et),C(_r),t&&o(rc),t&&o(ee),C(br),C(Mr),C(Ao),C(So),t&&o(ac),t&&o(Ut),C(wr),t&&o(ic),t&&o(ce),C(Ir),C(kr),C(Yo),C(Ho),t&&o(lc),t&&o(Wt),C(xr),t&&o(dc),t&&o(B),C(Lr),C(Oo),C(zr),C(Ko),C(en),C(Ur),C(tn),C(on),C(Fr),C(nn),C(sn),t&&o(cc),t&&o(Nt),C(Wr),t&&o(pc),t&&o(Gt),C(Vr),C(Zr),C(an),C(ln),t&&o(mc),t&&o(Xt),C(Br),t&&o(hc),t&&o(qt),C(Nr),C(Gr),C(cn),C(pn),t&&o(fc),t&&o(St),C(Rr),t&&o(uc),t&&o(z),C(Xr),C(Or),C(hn),C(fn),C(Kr),C(gn),C(ea),C(bn),t&&o(gc),t&&o(Yt),C(ta),t&&o(_c),t&&o(Ht),C(oa),C(na),C(yn),C(Tn),t&&o(bc),t&&o(Ot),C(sa),t&&o(vc),t&&o(Kt),C(ra),C(aa),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 vT(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pM extends uT{constructor(d){super();gT(this,d,sM,oM,_T,{})}}export{pM as default,nM as metadata};
