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