import{S as uT,i as gT,s as _T,e as s,k as m,w as v,t as i,M as bT,c as a,d as o,m as h,a as r,x as T,h as l,b as f,G as e,g as b,y as M,q as w,o as I,B as P,v as yT,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 vT($){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBDb25maWclMkMlMjBDTElQTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUENvbmZpZyUyMHdpdGglMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ0xJUENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENMSVBNb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBDTElQTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmlnJTBBJTBBJTIzJTIwV2UlMjBjYW4lMjBhbHNvJTIwaW5pdGlhbGl6ZSUyMGElMjBDTElQQ29uZmlnJTIwZnJvbSUyMGElMjBDTElQVGV4dENvbmZpZyUyMGFuZCUyMGElMjBDTElQVmlzaW9uQ29uZmlnJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBUZXh0Q29uZmlnJTJDJTIwQ0xJUFZpc2lvbkNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDTElQVGV4dCUyMGFuZCUyMENMSVBWaXNpb24lMjBjb25maWd1cmF0aW9uJTBBY29uZmlnX3RleHQlMjAlM0QlMjBDTElQVGV4dENvbmZpZygpJTBBY29uZmlnX3Zpc2lvbiUyMCUzRCUyMENMSVBWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMENMSVBDb25maWcuZnJvbV90ZXh0X3Zpc2lvbl9jb25maWdzKGNvbmZpZ190ZXh0JTJDJTIwY29uZmlnX3Zpc2lvbik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPConfig, CLIPModel

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=s("p"),y=i("Example:"),u=m(),v(p.$$.fragment)},l(n){d=a(n,"P",{});var c=r(d);y=l(c,"Example:"),c.forEach(o),u=h(n),T(p.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),M(p,n,c),_=!0},p:V,i(n){_||(w(p.$$.fragment,n),_=!0)},o(n){I(p.$$.fragment,n),_=!1},d(n){n&&o(d),n&&o(u),P(p,n)}}}function MT($){let d,y,u,p,_;return p=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENMSVBWaXNpb25Db25maWclMkMlMjBDTElQVmlzaW9uTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ0xJUFZpc2lvbkNvbmZpZyUyMHdpdGglMjBvcGVuYWklMkZjbGlwLXZpdC1iYXNlLXBhdGNoMzIlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ0xJUFZpc2lvbkNvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENMSVBWaXNpb25Nb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwb3BlbmFpJTJGY2xpcC12aXQtYmFzZS1wYXRjaDMyJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBDTElQVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPVisionConfig, CLIPVisionModel

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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