import{s as ka,o as Ja,n as U}from"../chunks/scheduler.9bc65507.js";import{S as za,i as Ua,g as a,s as i,u,A as Za,h as r,f as t,c as l,j as f,v as _,y as g,k as m,o as n,a as d,w as C,d as v,t as b,x as y}from"../chunks/index.78c82d43.js";import{T as zo}from"../chunks/Tip.87d55b76.js";import{D as P}from"../chunks/Docstring.4e7352e2.js";import{C as ne}from"../chunks/CodeBlock.73e038be.js";import{I as B}from"../chunks/IconCopyLink.bedaa44d.js";import{E as Ve}from"../chunks/ExampleCodeBlock.872b014d.js";function Wa(w){let s,T="Example:",h,p,M;return p=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoaW5lc2VDTElQQ29uZmlnJTJDJTIwQ2hpbmVzZUNMSVBNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDaGluZXNlQ0xJUENvbmZpZyUyMHdpdGglMjBPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ2hpbmVzZUNMSVBDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDaGluZXNlQ0xJUE1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMENoaW5lc2VDTElQTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmlnJTBBJTBBJTIzJTIwV2UlMjBjYW4lMjBhbHNvJTIwaW5pdGlhbGl6ZSUyMGElMjBDaGluZXNlQ0xJUENvbmZpZyUyMGZyb20lMjBhJTIwQ2hpbmVzZUNMSVBUZXh0Q29uZmlnJTIwYW5kJTIwYSUyMENoaW5lc2VDTElQVmlzaW9uQ29uZmlnJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENoaW5lc2VDTElQVGV4dENvbmZpZyUyMGFuZCUyMENoaW5lc2VDTElQVmlzaW9uQ29uZmlnJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ190ZXh0JTIwJTNEJTIwQ2hpbmVzZUNMSVBUZXh0Q29uZmlnKCklMEFjb25maWdfdmlzaW9uJTIwJTNEJTIwQ2hpbmVzZUNMSVBWaXNpb25Db25maWcoKSUwQSUwQWNvbmZpZyUyMCUzRCUyMENoaW5lc2VDTElQQ29uZmlnLmZyb21fdGV4dF92aXNpb25fY29uZmlncyhjb25maWdfdGV4dCUyQyUyMGNvbmZpZ192aXNpb24p",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChineseCLIPConfig, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ChineseCLIPConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel(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 ChineseCLIPConfig from a ChineseCLIPTextConfig and a ChineseCLIPVisionConfig</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPTextConfig and ChineseCLIPVisionConfig configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>config_text = ChineseCLIPTextConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_vision = ChineseCLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span>config = ChineseCLIPConfig.from_text_vision_configs(config_text, config_vision)`,wrap:!1}}),{c(){s=a("p"),s.textContent=T,h=i(),u(p.$$.fragment)},l(o){s=r(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-11lpom8"&&(s.textContent=T),h=l(o),_(p.$$.fragment,o)},m(o,I){d(o,s,I),d(o,h,I),C(p,o,I),M=!0},p:U,i(o){M||(v(p.$$.fragment,o),M=!0)},o(o){b(p.$$.fragment,o),M=!1},d(o){o&&(t(s),t(h)),y(p,o)}}}function Na(w){let s,T="Example:",h,p,M;return p=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoaW5lc2VDTElQVGV4dENvbmZpZyUyQyUyMENoaW5lc2VDTElQVGV4dE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMENoaW5lc2VDTElQVGV4dENvbmZpZyUyMHdpdGglMjBPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ2hpbmVzZUNMSVBUZXh0Q29uZmlnKCklMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQ2hpbmVzZUNMSVBUZXh0TW9kZWwlMjAod2l0aCUyMHJhbmRvbSUyMHdlaWdodHMpJTIwZnJvbSUyMHRoZSUyME9GQS1TeXMlMkZjaGluZXNlLWNsaXAtdml0LWJhc2UtcGF0Y2gxNiUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQ2hpbmVzZUNMSVBUZXh0TW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChineseCLIPTextConfig, ChineseCLIPTextModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPTextConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ChineseCLIPTextConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPTextModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPTextModel(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`,wrap:!1}}),{c(){s=a("p"),s.textContent=T,h=i(),u(p.$$.fragment)},l(o){s=r(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-11lpom8"&&(s.textContent=T),h=l(o),_(p.$$.fragment,o)},m(o,I){d(o,s,I),d(o,h,I),C(p,o,I),M=!0},p:U,i(o){M||(v(p.$$.fragment,o),M=!0)},o(o){b(p.$$.fragment,o),M=!1},d(o){o&&(t(s),t(h)),y(p,o)}}}function Ea(w){let s,T="Example:",h,p,M;return p=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMENoaW5lc2VDTElQVmlzaW9uQ29uZmlnJTJDJTIwQ2hpbmVzZUNMSVBWaXNpb25Nb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDaGluZXNlQ0xJUFZpc2lvbkNvbmZpZyUyMHdpdGglMjBPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwQ2hpbmVzZUNMSVBWaXNpb25Db25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBDaGluZXNlQ0xJUFZpc2lvbk1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMENoaW5lc2VDTElQVmlzaW9uTW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ChineseCLIPVisionConfig, ChineseCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPVisionConfig with OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ChineseCLIPVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ChineseCLIPVisionModel (with random weights) from the OFA-Sys/chinese-clip-vit-base-patch16 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPVisionModel(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`,wrap:!1}}),{c(){s=a("p"),s.textContent=T,h=i(),u(p.$$.fragment)},l(o){s=r(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-11lpom8"&&(s.textContent=T),h=l(o),_(p.$$.fragment,o)},m(o,I){d(o,s,I),d(o,h,I),C(p,o,I),M=!0},p:U,i(o){M||(v(p.$$.fragment,o),M=!0)},o(o){b(p.$$.fragment,o),M=!1},d(o){o&&(t(s),t(h)),y(p,o)}}}function Va(w){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=a("p"),s.innerHTML=T},l(h){s=r(h,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(h,p){d(h,s,p)},p:U,d(h){h&&t(s)}}}function Ba(w){let s,T="Examples:",h,p,M;return p=new ne({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENoaW5lc2VDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMENoaW5lc2VDTElQTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMk9GQS1TeXMlMkZjaGluZXNlLWNsaXAtdml0LWJhc2UtcGF0Y2gxNiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZjbGlwLWNuLWJlaWppbmcub3NzLWNuLWJlaWppbmcuYWxpeXVuY3MuY29tJTJGcG9rZW1vbi5qcGVnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKHRleHQlM0QlNUIlMjIlRTYlOUQlQjAlRTUlQjAlQkMlRTklQkUlOUYlMjIlMkMlMjAlMjIlRTUlQTYlOTklRTglOUIlOTklRTclQTclOEQlRTUlQUQlOTAlMjIlMkMlMjAlMjIlRTUlQjAlOEYlRTclODElQUIlRTklQkUlOTklMjIlMkMlMjAlMjIlRTclOUElQUUlRTUlOEQlQTElRTQlQjglOTglMjIlNUQlMkMlMjBpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIlMkMlMjBwYWRkaW5nJTNEVHJ1ZSklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbG9naXRzX3Blcl9pbWFnZSUyMCUzRCUyMG91dHB1dHMubG9naXRzX3Blcl9pbWFnZSUyMCUyMCUyMyUyMHRoaXMlMjBpcyUyMHRoZSUyMGltYWdlLXRleHQlMjBzaW1pbGFyaXR5JTIwc2NvcmUlMEFwcm9icyUyMCUzRCUyMGxvZ2l0c19wZXJfaW1hZ2Uuc29mdG1heChkaW0lM0QxKSUyMCUyMCUyMyUyMHdlJTIwY2FuJTIwdGFrZSUyMHRoZSUyMHNvZnRtYXglMjB0byUyMGdldCUyMHRoZSUyMGxhYmVsJTIwcHJvYmFiaWxpdGllcw==",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, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg&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;杰尼龟&quot;</span>, <span class="hljs-string">&quot;妙蛙种子&quot;</span>, <span class="hljs-string">&quot;小火龙&quot;</span>, <span class="hljs-string">&quot;皮卡丘&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>`,wrap:!1}}),{c(){s=a("p"),s.textContent=T,h=i(),u(p.$$.fragment)},l(o){s=r(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),h=l(o),_(p.$$.fragment,o)},m(o,I){d(o,s,I),d(o,h,I),C(p,o,I),M=!0},p:U,i(o){M||(v(p.$$.fragment,o),M=!0)},o(o){b(p.$$.fragment,o),M=!1},d(o){o&&(t(s),t(h)),y(p,o)}}}function Ra(w){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=a("p"),s.innerHTML=T},l(h){s=r(h,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(h,p){d(h,s,p)},p:U,d(h){h&&t(s)}}}function Sa(w){let s,T="Examples:",h,p,M;return p=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDaGluZXNlQ0xJUE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBDaGluZXNlQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjIpJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyT0ZBLVN5cyUyRmNoaW5lc2UtY2xpcC12aXQtYmFzZS1wYXRjaDE2JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMHRva2VuaXplciglNUIlMjIlRTYlOUQlQjAlRTUlQjAlQkMlRTklQkUlOUYlMjIlMkMlMjAlMjIlRTUlQTYlOTklRTglOUIlOTklRTclQTclOEQlRTUlQUQlOTAlMjIlMkMlMjAlMjIlRTUlQjAlOEYlRTclODElQUIlRTklQkUlOTklMjIlMkMlMjAlMjIlRTclOUElQUUlRTUlOEQlQTElRTQlQjglOTglMjIlNUQlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBdGV4dF9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF90ZXh0X2ZlYXR1cmVzKCoqaW5wdXRzKSUwQXRleHRfZmVhdHVyZXMlMjAlM0QlMjB0ZXh0X2ZlYXR1cmVzJTIwJTJGJTIwdGV4dF9mZWF0dXJlcy5ub3JtKHAlM0QyJTJDJTIwZGltJTNELTElMkMlMjBrZWVwZGltJTNEVHJ1ZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;杰尼龟&quot;</span>, <span class="hljs-string">&quot;妙蛙种子&quot;</span>, <span class="hljs-string">&quot;小火龙&quot;</span>, <span class="hljs-string">&quot;皮卡丘&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)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = text_features / text_features.norm(p=<span class="hljs-number">2</span>, dim=-<span class="hljs-number">1</span>, keepdim=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){s=a("p"),s.textContent=T,h=i(),u(p.$$.fragment)},l(o){s=r(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),h=l(o),_(p.$$.fragment,o)},m(o,I){d(o,s,I),d(o,h,I),C(p,o,I),M=!0},p:U,i(o){M||(v(p.$$.fragment,o),M=!0)},o(o){b(p.$$.fragment,o),M=!1},d(o){o&&(t(s),t(h)),y(p,o)}}}function Ga(w){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=a("p"),s.innerHTML=T},l(h){s=r(h,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(h,p){d(h,s,p)},p:U,d(h){h&&t(s)}}}function Fa(w){let s,T="Examples:",h,p,M;return p=new ne({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMENoaW5lc2VDTElQTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMENoaW5lc2VDTElQTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMk9GQS1TeXMlMkZjaGluZXNlLWNsaXAtdml0LWJhc2UtcGF0Y2gxNiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZjbGlwLWNuLWJlaWppbmcub3NzLWNuLWJlaWppbmcuYWxpeXVuY3MuY29tJTJGcG9rZW1vbi5qcGVnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF9pbWFnZV9mZWF0dXJlcygqKmlucHV0cyklMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMGltYWdlX2ZlYXR1cmVzJTIwJTJGJTIwaW1hZ2VfZmVhdHVyZXMubm9ybShwJTNEMiUyQyUyMGRpbSUzRC0xJTJDJTIwa2VlcGRpbSUzRFRydWUp",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, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg&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)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = image_features / image_features.norm(p=<span class="hljs-number">2</span>, dim=-<span class="hljs-number">1</span>, keepdim=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){s=a("p"),s.textContent=T,h=i(),u(p.$$.fragment)},l(o){s=r(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),h=l(o),_(p.$$.fragment,o)},m(o,I){d(o,s,I),d(o,h,I),C(p,o,I),M=!0},p:U,i(o){M||(v(p.$$.fragment,o),M=!0)},o(o){b(p.$$.fragment,o),M=!1},d(o){o&&(t(s),t(h)),y(p,o)}}}function Xa(w){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=a("p"),s.innerHTML=T},l(h){s=r(h,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(h,p){d(h,s,p)},p:U,d(h){h&&t(s)}}}function Ha(w){let s,T="Example:",h,p,M;return p=new ne({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBDaGluZXNlQ0xJUFRleHRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyT0ZBLVN5cyUyRmNoaW5lc2UtY2xpcC12aXQtYmFzZS1wYXRjaDE2JTIyKSUwQW1vZGVsJTIwJTNEJTIwQ2hpbmVzZUNMSVBUZXh0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMk9GQS1TeXMlMkZjaGluZXNlLWNsaXAtdml0LWJhc2UtcGF0Y2gxNiUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, ChineseCLIPTextModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPTextModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</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_states = outputs.last_hidden_state`,wrap:!1}}),{c(){s=a("p"),s.textContent=T,h=i(),u(p.$$.fragment)},l(o){s=r(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-11lpom8"&&(s.textContent=T),h=l(o),_(p.$$.fragment,o)},m(o,I){d(o,s,I),d(o,h,I),C(p,o,I),M=!0},p:U,i(o){M||(v(p.$$.fragment,o),M=!0)},o(o){b(p.$$.fragment,o),M=!1},d(o){o&&(t(s),t(h)),y(p,o)}}}function qa(w){let s,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){s=a("p"),s.innerHTML=T},l(h){s=r(h,"P",{"data-svelte-h":!0}),g(s)!=="svelte-fincs2"&&(s.innerHTML=T)},m(h,p){d(h,s,p)},p:U,d(h){h&&t(s)}}}function Aa(w){let s,T="Examples:",h,p,M;return p=new ne({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQ0xJUFByb2Nlc3NvciUyQyUyMENoaW5lc2VDTElQVmlzaW9uTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMENoaW5lc2VDTElQVmlzaW9uTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMk9GQS1TeXMlMkZjaGluZXNlLWNsaXAtdml0LWJhc2UtcGF0Y2gxNiUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBDTElQUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZjbGlwLWNuLWJlaWppbmcub3NzLWNuLWJlaWppbmcuYWxpeXVuY3MuY29tJTJGcG9rZW1vbi5qcGVnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGUlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBcG9vbGVkX291dHB1dCUyMCUzRCUyMG91dHB1dHMucG9vbGVyX291dHB1dCUyMCUyMCUyMyUyMHBvb2xlZCUyMENMUyUyMHN0YXRlcw==",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, ChineseCLIPVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPVisionModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = CLIPProcessor.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg&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>`,wrap:!1}}),{c(){s=a("p"),s.textContent=T,h=i(),u(p.$$.fragment)},l(o){s=r(o,"P",{"data-svelte-h":!0}),g(s)!=="svelte-kvfsh7"&&(s.textContent=T),h=l(o),_(p.$$.fragment,o)},m(o,I){d(o,s,I),d(o,h,I),C(p,o,I),M=!0},p:U,i(o){M||(v(p.$$.fragment,o),M=!0)},o(o){b(p.$$.fragment,o),M=!1},d(o){o&&(t(s),t(h)),y(p,o)}}}function Qa(w){let s,T,h,p,M,o,I,Be,Tn,$t,Ps="Chinese-CLIP",Uo,H,se,mo,Re,In,jt,xs="Overview",Zo,Se,Ls=`The Chinese-CLIP model was proposed in <a href="https://arxiv.org/abs/2211.01335" rel="nofollow">Chinese CLIP: Contrastive Vision-Language Pretraining in Chinese</a> by An Yang, Junshu Pan, Junyang Lin, Rui Men, Yichang Zhang, Jingren Zhou, Chang Zhou.
Chinese-CLIP is an implementation of CLIP (Radford et al., 2021) on a large-scale dataset of Chinese image-text pairs. It is capable of performing cross-modal retrieval and also playing as a vision backbone for vision tasks like zero-shot image classification, open-domain object detection, etc. The original Chinese-CLIP code is released <a href="https://github.com/OFA-Sys/Chinese-CLIP" rel="nofollow">at this link</a>.`,Wo,Ge,$s="The abstract from the paper is the following:",No,Fe,js="<em>The tremendous success of CLIP (Radford et al., 2021) has promoted the research and application of contrastive learning for vision-language pretraining. In this work, we construct a large-scale dataset of image-text pairs in Chinese, where most data are retrieved from publicly available datasets, and we pretrain Chinese CLIP models on the new dataset. We develop 5 Chinese CLIP models of multiple sizes, spanning from 77 to 958 million parameters. Furthermore, we propose a two-stage pretraining method, where the model is first trained with the image encoder frozen and then trained with all parameters being optimized, to achieve enhanced model performance. Our comprehensive experiments demonstrate that Chinese CLIP can achieve the state-of-the-art performance on MUGE, Flickr30K-CN, and COCO-CN in the setups of zero-shot learning and finetuning, and it is able to achieve competitive performance in zero-shot image classification based on the evaluation on the ELEVATER benchmark (Li et al., 2022). Our codes, pretrained models, and demos have been released.</em>",Eo,q,ae,fo,Xe,wn,kt,ks="Usage",Vo,He,Js="The code snippet below shows how to compute image & text features and similarities:",Bo,qe,Ro,Ae,zs="Currently, we release the following scales of pretrained Chinese-CLIP models at HF Model Hub:",So,Qe,Us='<li><a href="https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16" rel="nofollow">OFA-Sys/chinese-clip-vit-base-patch16</a></li> <li><a href="https://huggingface.co/OFA-Sys/chinese-clip-vit-large-patch14" rel="nofollow">OFA-Sys/chinese-clip-vit-large-patch14</a></li> <li><a href="https://huggingface.co/OFA-Sys/chinese-clip-vit-large-patch14-336px" rel="nofollow">OFA-Sys/chinese-clip-vit-large-patch14-336px</a></li> <li><a href="https://huggingface.co/OFA-Sys/chinese-clip-vit-huge-patch14" rel="nofollow">OFA-Sys/chinese-clip-vit-huge-patch14</a></li>',Go,Ye,Zs='The Chinese-CLIP model was contributed by <a href="https://huggingface.co/OFA-Sys" rel="nofollow">OFA-Sys</a>.',Fo,A,re,go,Oe,Pn,Jt,Ws="ChineseCLIPConfig",Xo,x,De,xn,zt,Ns=`<a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</a> is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a>. It is used
to instantiate Chinese-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
Chinese-CLIP <a href="https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16" rel="nofollow">OFA-Sys/chinese-clip-vit-base-patch16</a>
architecture.`,Ln,Ut,Es=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,$n,ie,jn,le,Ke,kn,Zt,Vs=`Instantiate a <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</a> (or a derived class) from Chinese-CLIP text model configuration and
Chinese-CLIP vision model configuration. Returns:
<a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</a>: An instance of a configuration object`,Ho,Q,ce,uo,et,Jn,Wt,Bs="ChineseCLIPTextConfig",qo,k,tt,zn,Nt,Rs=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a>. It is used to instantiate a
Chinese CLIP model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the Chinese CLIP
[OFA-Sys/chinese-clip-vit-base-patch16](https:
//huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16) architecture.`,Un,Et,Ss=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Zn,de,Ao,Y,pe,_o,ot,Wn,Vt,Gs="ChineseCLIPVisionConfig",Qo,J,nt,Nn,Bt,Fs=`This is the configuration class to store the configuration of a <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a>. It is used to instantiate an
ChineseCLIP model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the ChineseCLIP
[OFA-Sys/chinese-clip-vit-base-patch16](https:
//huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16) architecture.`,En,Rt,Xs=`Configuration objects inherit from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.34.0/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Vn,he,Yo,O,me,Co,st,Bn,St,Hs="ChineseCLIPImageProcessor",Oo,R,at,Rn,Gt,qs="Constructs a Chinese-CLIP image processor.",Sn,fe,rt,Gn,Ft,As="Preprocess an image or batch of images.",Do,D,ge,vo,it,Fn,Xt,Qs="ChineseCLIPFeatureExtractor",Ko,lt,ct,en,K,ue,bo,dt,Xn,Ht,Ys="ChineseCLIPProcessor",tn,L,pt,Hn,qt,Os=`Constructs a Chinese-CLIP processor which wraps a Chinese-CLIP image processor and a Chinese-CLIP tokenizer into a
single processor.`,qn,At,Ds=`<a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPProcessor">ChineseCLIPProcessor</a> offers all the functionalities of <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPImageProcessor</a> and <a href="/docs/transformers/v4.34.0/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>.
See the <code>__call__()</code> and <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPProcessor.decode">decode()</a> for more information.`,An,_e,ht,Qn,Qt,Ks=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/v4.34.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,Yn,Ce,mt,On,Yt,ea=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/v4.34.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,on,ee,ve,yo,ft,Dn,Ot,ta="ChineseCLIPModel",nn,$,gt,Kn,Dt,oa=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,es,Z,ut,ts,Kt,na='The <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',os,be,ns,ye,ss,W,_t,as,eo,sa='The <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',rs,Me,is,Te,ls,N,Ct,cs,to,aa='The <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',ds,Ie,ps,we,sn,te,Pe,Mo,vt,hs,oo,ra="ChineseCLIPTextModel",an,j,bt,ms,no,ia=`The text model from CHINESE_CLIP without any head or projection on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,fs,so,la=`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in <a href="https://arxiv.org/abs/1706.03762" rel="nofollow">Attention is
all you need</a> by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`,gs,ao,ca=`To behave as an decoder the model needs to be initialized with the <code>is_decoder</code> argument of the configuration set
to <code>True</code>. To be used in a Seq2Seq model, the model needs to initialized with both <code>is_decoder</code> argument and
<code>add_cross_attention</code> set to <code>True</code>; an <code>encoder_hidden_states</code> is then expected as an input to the forward pass.`,us,E,yt,_s,ro,da='The <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPTextModel">ChineseCLIPTextModel</a> forward method, overrides the <code>__call__</code> special method.',Cs,xe,vs,Le,rn,oe,$e,To,Mt,bs,io,pa="ChineseCLIPVisionModel",ln,S,Tt,ys,lo,ha=`The vision model from CHINESE_CLIP without any head or projection on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,Ms,V,It,Ts,co,ma='The <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionModel">ChineseCLIPVisionModel</a> forward method, overrides the <code>__call__</code> special method.',Is,je,ws,ke,cn,Io,dn;return Be=new B({}),Re=new B({}),Xe=new B({}),qe=new ne({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQ2hpbmVzZUNMSVBQcm9jZXNzb3IlMkMlMjBDaGluZXNlQ0xJUE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBDaGluZXNlQ0xJUE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJPRkEtU3lzJTJGY2hpbmVzZS1jbGlwLXZpdC1iYXNlLXBhdGNoMTYlMjIpJTBBcHJvY2Vzc29yJTIwJTNEJTIwQ2hpbmVzZUNMSVBQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMk9GQS1TeXMlMkZjaGluZXNlLWNsaXAtdml0LWJhc2UtcGF0Y2gxNiUyMiklMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRmNsaXAtY24tYmVpamluZy5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20lMkZwb2tlbW9uLmpwZWclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMjMlMjBTcXVpcnRsZSUyQyUyMEJ1bGJhc2F1ciUyQyUyMENoYXJtYW5kZXIlMkMlMjBQaWthY2h1JTIwaW4lMjBFbmdsaXNoJTBBdGV4dHMlMjAlM0QlMjAlNUIlMjIlRTYlOUQlQjAlRTUlQjAlQkMlRTklQkUlOUYlMjIlMkMlMjAlMjIlRTUlQTYlOTklRTglOUIlOTklRTclQTclOEQlRTUlQUQlOTAlMjIlMkMlMjAlMjIlRTUlQjAlOEYlRTclODElQUIlRTklQkUlOTklMjIlMkMlMjAlMjIlRTclOUElQUUlRTUlOEQlQTElRTQlQjglOTglMjIlNUQlMEElMEElMjMlMjBjb21wdXRlJTIwaW1hZ2UlMjBmZWF0dXJlJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF9pbWFnZV9mZWF0dXJlcygqKmlucHV0cyklMEFpbWFnZV9mZWF0dXJlcyUyMCUzRCUyMGltYWdlX2ZlYXR1cmVzJTIwJTJGJTIwaW1hZ2VfZmVhdHVyZXMubm9ybShwJTNEMiUyQyUyMGRpbSUzRC0xJTJDJTIwa2VlcGRpbSUzRFRydWUpJTIwJTIwJTIzJTIwbm9ybWFsaXplJTBBJTBBJTIzJTIwY29tcHV0ZSUyMHRleHQlMjBmZWF0dXJlcyUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEdGV4dHMlMkMlMjBwYWRkaW5nJTNEVHJ1ZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBdGV4dF9mZWF0dXJlcyUyMCUzRCUyMG1vZGVsLmdldF90ZXh0X2ZlYXR1cmVzKCoqaW5wdXRzKSUwQXRleHRfZmVhdHVyZXMlMjAlM0QlMjB0ZXh0X2ZlYXR1cmVzJTIwJTJGJTIwdGV4dF9mZWF0dXJlcy5ub3JtKHAlM0QyJTJDJTIwZGltJTNELTElMkMlMjBrZWVwZGltJTNEVHJ1ZSklMjAlMjAlMjMlMjBub3JtYWxpemUlMEElMEElMjMlMjBjb21wdXRlJTIwaW1hZ2UtdGV4dCUyMHNpbWlsYXJpdHklMjBzY29yZXMlMEFpbnB1dHMlMjAlM0QlMjBwcm9jZXNzb3IodGV4dCUzRHRleHRzJTJDJTIwaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyJTJDJTIwcGFkZGluZyUzRFRydWUpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0c19wZXJfaW1hZ2UlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0c19wZXJfaW1hZ2UlMjAlMjAlMjMlMjB0aGlzJTIwaXMlMjB0aGUlMjBpbWFnZS10ZXh0JTIwc2ltaWxhcml0eSUyMHNjb3JlJTBBcHJvYnMlMjAlM0QlMjBsb2dpdHNfcGVyX2ltYWdlLnNvZnRtYXgoZGltJTNEMSklMjAlMjAlMjMlMjBwcm9icyUzQSUyMCU1QiU1QjEuMjY4NmUtMDMlMkMlMjA1LjQ0OTllLTAyJTJDJTIwNi43OTY4ZS0wNCUyQyUyMDkuNDM1NWUtMDElNUQlNUQ=",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> ChineseCLIPProcessor, ChineseCLIPModel

<span class="hljs-meta">&gt;&gt;&gt; </span>model = ChineseCLIPModel.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor = ChineseCLIPProcessor.from_pretrained(<span class="hljs-string">&quot;OFA-Sys/chinese-clip-vit-base-patch16&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://clip-cn-beijing.oss-cn-beijing.aliyuncs.com/pokemon.jpeg&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><span class="hljs-comment"># Squirtle, Bulbasaur, Charmander, Pikachu in English</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>texts = [<span class="hljs-string">&quot;杰尼龟&quot;</span>, <span class="hljs-string">&quot;妙蛙种子&quot;</span>, <span class="hljs-string">&quot;小火龙&quot;</span>, <span class="hljs-string">&quot;皮卡丘&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute image feature</span>
<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)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_features = image_features / image_features.norm(p=<span class="hljs-number">2</span>, dim=-<span class="hljs-number">1</span>, keepdim=<span class="hljs-literal">True</span>)  <span class="hljs-comment"># normalize</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute text features</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, 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)
<span class="hljs-meta">&gt;&gt;&gt; </span>text_features = text_features / text_features.norm(p=<span class="hljs-number">2</span>, dim=-<span class="hljs-number">1</span>, keepdim=<span class="hljs-literal">True</span>)  <span class="hljs-comment"># normalize</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># compute image-text similarity scores</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text=texts, 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"># probs: [[1.2686e-03, 5.4499e-02, 6.7968e-04, 9.4355e-01]]</span>`,wrap:!1}}),Oe=new B({}),De=new P({props:{name:"class transformers.ChineseCLIPConfig",anchor:"transformers.ChineseCLIPConfig",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.ChineseCLIPConfig.text_config",description:`<strong>text_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPTextConfig">ChineseCLIPTextConfig</a>.`,name:"text_config"},{anchor:"transformers.ChineseCLIPConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionConfig">ChineseCLIPVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.ChineseCLIPConfig.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.ChineseCLIPConfig.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 ChineseCLIP
implementation.`,name:"logit_scale_init_value"},{anchor:"transformers.ChineseCLIPConfig.kwargs",description:`<strong>kwargs</strong> (<em>optional</em>) &#x2014;
Dictionary of keyword arguments.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L268"}}),ie=new Ve({props:{anchor:"transformers.ChineseCLIPConfig.example",$$slots:{default:[Wa]},$$scope:{ctx:w}}}),Ke=new P({props:{name:"from_text_vision_configs",anchor:"transformers.ChineseCLIPConfig.from_text_vision_configs",parameters:[{name:"text_config",val:": ChineseCLIPTextConfig"},{name:"vision_config",val:": ChineseCLIPVisionConfig"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L406"}}),et=new B({}),tt=new P({props:{name:"class transformers.ChineseCLIPTextConfig",anchor:"transformers.ChineseCLIPTextConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"initializer_factor",val:" = 1.0"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPTextConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the CHINESE_CLIP model. Defines the number of different tokens that can be represented
by the <code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a>.`,name:"vocab_size"},{anchor:"transformers.ChineseCLIPTextConfig.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.ChineseCLIPTextConfig.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.ChineseCLIPTextConfig.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.ChineseCLIPTextConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.ChineseCLIPTextConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.ChineseCLIPTextConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.ChineseCLIPTextConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.ChineseCLIPTextConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#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.ChineseCLIPTextConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.ChineseCLIPTextConfig.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.ChineseCLIPTextConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.ChineseCLIPTextConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.ChineseCLIPTextConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L40"}}),de=new Ve({props:{anchor:"transformers.ChineseCLIPTextConfig.example",$$slots:{default:[Na]},$$scope:{ctx:w}}}),ot=new B({}),nt=new P({props:{name:"class transformers.ChineseCLIPVisionConfig",anchor:"transformers.ChineseCLIPVisionConfig",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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.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.ChineseCLIPVisionConfig.initializer_factor",description:`<strong>initializer_factor</strong> (\`float&#x201C;, <em>optional</em>, defaults to 1) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L163"}}),he=new Ve({props:{anchor:"transformers.ChineseCLIPVisionConfig.example",$$slots:{default:[Ea]},$$scope:{ctx:w}}}),st=new B({}),at=new P({props:{name:"class transformers.ChineseCLIPImageProcessor",anchor:"transformers.ChineseCLIPImageProcessor",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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.ChineseCLIPImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.
Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.ChineseCLIPImageProcessor.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L50"}}),rt=new P({props:{name:"preprocess",anchor:"transformers.ChineseCLIPImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"do_convert_rgb",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": typing.Optional[transformers.image_utils.ChannelDimension] = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": typing.Union[str, transformers.image_utils.ChannelDimension, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If
passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.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.ChineseCLIPImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li>Unset: Use the channel dimension format of the input image.</li>
</ul>`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) &#x2014;
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:<ul>
<li><code>&quot;channels_first&quot;</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>&quot;channels_last&quot;</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
<li><code>&quot;none&quot;</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li>
</ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L163"}}),it=new B({}),ct=new P({props:{name:"class transformers.ChineseCLIPFeatureExtractor",anchor:"transformers.ChineseCLIPFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/feature_extraction_chinese_clip.py#L26"}}),dt=new B({}),pt=new P({props:{name:"class transformers.ChineseCLIPProcessor",anchor:"transformers.ChineseCLIPProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ChineseCLIPProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.ChineseCLIPProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/processing_chinese_clip.py#L25"}}),ht=new P({props:{name:"batch_decode",anchor:"transformers.ChineseCLIPProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/processing_chinese_clip.py#L115"}}),mt=new P({props:{name:"decode",anchor:"transformers.ChineseCLIPProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/processing_chinese_clip.py#L122"}}),ft=new B({}),gt=new P({props:{name:"class transformers.ChineseCLIPModel",anchor:"transformers.ChineseCLIPModel",parameters:[{name:"config",val:": ChineseCLIPConfig"}],parametersDescription:[{anchor:"transformers.ChineseCLIPModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1351"}}),ut=new P({props:{name:"forward",anchor:"transformers.ChineseCLIPModel.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:"token_type_ids",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.ChineseCLIPModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.ChineseCLIPModel.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.ChineseCLIPModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ChineseCLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.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.ChineseCLIPModel.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.ChineseCLIPModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1486",returnDescription:`
<p>A <code>transformers.models.chinese_clip.modeling_chinese_clip.ChineseCLIPOutput</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.chinese_clip.configuration_chinese_clip.ChineseCLIPConfig'&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>) — 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>) — 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>) — 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>) — The text embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPTextModel"
>ChineseCLIPTextModel</a>.</li>
<li><strong>image_embeds(<code>torch.FloatTensor</code></strong> of shape <code>(batch_size, output_dim</code>) — The image embeddings obtained by applying the projection layer to the pooled output of
<a
  href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionModel"
>ChineseCLIPVisionModel</a>.</li>
<li><strong>text_model_output(<code>BaseModelOutputWithPoolingAndCrossAttentions</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPTextModel"
>ChineseCLIPTextModel</a>.</li>
<li><strong>vision_model_output(<code>BaseModelOutputWithPoolingAndCrossAttentions</code>):</strong>
The output of the <a
  href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionModel"
>ChineseCLIPVisionModel</a>.</li>
</ul>
`,returnType:`
<p><code>transformers.models.chinese_clip.modeling_chinese_clip.ChineseCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),be=new zo({props:{$$slots:{default:[Va]},$$scope:{ctx:w}}}),ye=new Ve({props:{anchor:"transformers.ChineseCLIPModel.forward.example",$$slots:{default:[Ba]},$$scope:{ctx:w}}}),_t=new P({props:{name:"get_text_features",anchor:"transformers.ChineseCLIPModel.get_text_features",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",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.ChineseCLIPModel.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.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.ChineseCLIPModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</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.ChineseCLIPModel.get_text_features.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.get_text_features.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.ChineseCLIPModel.get_text_features.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.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.ChineseCLIPModel.get_text_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1386",returnDescription:`
<p>The text embeddings obtained by
applying the projection layer to the final [CLS] hidden state of Text-Transformer.</p>
`,returnType:`
<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Me=new zo({props:{$$slots:{default:[Ra]},$$scope:{ctx:w}}}),Te=new Ve({props:{anchor:"transformers.ChineseCLIPModel.get_text_features.example",$$slots:{default:[Sa]},$$scope:{ctx:w}}}),Ct=new P({props:{name:"get_image_features",anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.get_image_features.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ChineseCLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChineseCLIPModel.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.ChineseCLIPModel.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.ChineseCLIPModel.get_image_features.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1436",returnDescription:`
<p>The image embeddings obtained by
applying the projection layer to the final [CLS] hidden state of Vision-Transformer.</p>
`,returnType:`
<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),Ie=new zo({props:{$$slots:{default:[Ga]},$$scope:{ctx:w}}}),we=new Ve({props:{anchor:"transformers.ChineseCLIPModel.get_image_features.example",$$slots:{default:[Fa]},$$scope:{ctx:w}}}),vt=new B({}),bt=new P({props:{name:"class transformers.ChineseCLIPTextModel",anchor:"transformers.ChineseCLIPTextModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.ChineseCLIPTextModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1114"}}),yt=new P({props:{name:"forward",anchor:"transformers.ChineseCLIPTextModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ChineseCLIPTextModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
it.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.34.0/en/model_doc/vits#transformers.VitsTokenizer.__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.ChineseCLIPTextModel.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.ChineseCLIPTextModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.ChineseCLIPTextModel.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.ChineseCLIPTextModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ChineseCLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChineseCLIPTextModel.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.ChineseCLIPTextModel.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.ChineseCLIPTextModel.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.ChineseCLIPTextModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ChineseCLIPTextModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.ChineseCLIPTextModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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>`,name:"encoder_attention_mask"},{anchor:"transformers.ChineseCLIPTextModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.ChineseCLIPTextModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1155",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</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 (<a
  href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig"
>ChineseCLIPConfig</a>) 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>) — 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>) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) — 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 of the decoder’s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new zo({props:{$$slots:{default:[Xa]},$$scope:{ctx:w}}}),Le=new Ve({props:{anchor:"transformers.ChineseCLIPTextModel.forward.example",$$slots:{default:[Ha]},$$scope:{ctx:w}}}),Mt=new B({}),Tt=new P({props:{name:"class transformers.ChineseCLIPVisionModel",anchor:"transformers.ChineseCLIPVisionModel",parameters:[{name:"config",val:": ChineseCLIPVisionConfig"}],parametersDescription:[{anchor:"transformers.ChineseCLIPVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.34.0/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.34.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1296"}}),It=new P({props:{name:"forward",anchor:"transformers.ChineseCLIPVisionModel.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.ChineseCLIPVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.34.0/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ChineseCLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ChineseCLIPVisionModel.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.ChineseCLIPVisionModel.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.ChineseCLIPVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1309",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.chinese_clip.configuration_chinese_clip.ChineseCLIPVisionConfig'&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>) — 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>) — 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>) — 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>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),je=new zo({props:{$$slots:{default:[qa]},$$scope:{ctx:w}}}),ke=new Ve({props:{anchor:"transformers.ChineseCLIPVisionModel.forward.example",$$slots:{default:[Aa]},$$scope:{ctx:w}}}),{c(){s=a("meta"),T=i(),h=a("p"),p=i(),M=a("h1"),o=a("a"),I=a("span"),u(Be.$$.fragment),Tn=i(),$t=a("span"),$t.textContent=Ps,Uo=i(),H=a("h2"),se=a("a"),mo=a("span"),u(Re.$$.fragment),In=i(),jt=a("span"),jt.textContent=xs,Zo=i(),Se=a("p"),Se.innerHTML=Ls,Wo=i(),Ge=a("p"),Ge.textContent=$s,No=i(),Fe=a("p"),Fe.innerHTML=js,Eo=i(),q=a("h2"),ae=a("a"),fo=a("span"),u(Xe.$$.fragment),wn=i(),kt=a("span"),kt.textContent=ks,Vo=i(),He=a("p"),He.textContent=Js,Bo=i(),u(qe.$$.fragment),Ro=i(),Ae=a("p"),Ae.textContent=zs,So=i(),Qe=a("ul"),Qe.innerHTML=Us,Go=i(),Ye=a("p"),Ye.innerHTML=Zs,Fo=i(),A=a("h2"),re=a("a"),go=a("span"),u(Oe.$$.fragment),Pn=i(),Jt=a("span"),Jt.textContent=Ws,Xo=i(),x=a("div"),u(De.$$.fragment),xn=i(),zt=a("p"),zt.innerHTML=Ns,Ln=i(),Ut=a("p"),Ut.innerHTML=Es,$n=i(),u(ie.$$.fragment),jn=i(),le=a("div"),u(Ke.$$.fragment),kn=i(),Zt=a("p"),Zt.innerHTML=Vs,Ho=i(),Q=a("h2"),ce=a("a"),uo=a("span"),u(et.$$.fragment),Jn=i(),Wt=a("span"),Wt.textContent=Bs,qo=i(),k=a("div"),u(tt.$$.fragment),zn=i(),Nt=a("p"),Nt.innerHTML=Rs,Un=i(),Et=a("p"),Et.innerHTML=Ss,Zn=i(),u(de.$$.fragment),Ao=i(),Y=a("h2"),pe=a("a"),_o=a("span"),u(ot.$$.fragment),Wn=i(),Vt=a("span"),Vt.textContent=Gs,Qo=i(),J=a("div"),u(nt.$$.fragment),Nn=i(),Bt=a("p"),Bt.innerHTML=Fs,En=i(),Rt=a("p"),Rt.innerHTML=Xs,Vn=i(),u(he.$$.fragment),Yo=i(),O=a("h2"),me=a("a"),Co=a("span"),u(st.$$.fragment),Bn=i(),St=a("span"),St.textContent=Hs,Oo=i(),R=a("div"),u(at.$$.fragment),Rn=i(),Gt=a("p"),Gt.textContent=qs,Sn=i(),fe=a("div"),u(rt.$$.fragment),Gn=i(),Ft=a("p"),Ft.textContent=As,Do=i(),D=a("h2"),ge=a("a"),vo=a("span"),u(it.$$.fragment),Fn=i(),Xt=a("span"),Xt.textContent=Qs,Ko=i(),lt=a("div"),u(ct.$$.fragment),en=i(),K=a("h2"),ue=a("a"),bo=a("span"),u(dt.$$.fragment),Xn=i(),Ht=a("span"),Ht.textContent=Ys,tn=i(),L=a("div"),u(pt.$$.fragment),Hn=i(),qt=a("p"),qt.textContent=Os,qn=i(),At=a("p"),At.innerHTML=Ds,An=i(),_e=a("div"),u(ht.$$.fragment),Qn=i(),Qt=a("p"),Qt.innerHTML=Ks,Yn=i(),Ce=a("div"),u(mt.$$.fragment),On=i(),Yt=a("p"),Yt.innerHTML=ea,on=i(),ee=a("h2"),ve=a("a"),yo=a("span"),u(ft.$$.fragment),Dn=i(),Ot=a("span"),Ot.textContent=ta,nn=i(),$=a("div"),u(gt.$$.fragment),Kn=i(),Dt=a("p"),Dt.innerHTML=oa,es=i(),Z=a("div"),u(ut.$$.fragment),ts=i(),Kt=a("p"),Kt.innerHTML=na,os=i(),u(be.$$.fragment),ns=i(),u(ye.$$.fragment),ss=i(),W=a("div"),u(_t.$$.fragment),as=i(),eo=a("p"),eo.innerHTML=sa,rs=i(),u(Me.$$.fragment),is=i(),u(Te.$$.fragment),ls=i(),N=a("div"),u(Ct.$$.fragment),cs=i(),to=a("p"),to.innerHTML=aa,ds=i(),u(Ie.$$.fragment),ps=i(),u(we.$$.fragment),sn=i(),te=a("h2"),Pe=a("a"),Mo=a("span"),u(vt.$$.fragment),hs=i(),oo=a("span"),oo.textContent=ra,an=i(),j=a("div"),u(bt.$$.fragment),ms=i(),no=a("p"),no.innerHTML=ia,fs=i(),so=a("p"),so.innerHTML=la,gs=i(),ao=a("p"),ao.innerHTML=ca,us=i(),E=a("div"),u(yt.$$.fragment),_s=i(),ro=a("p"),ro.innerHTML=da,Cs=i(),u(xe.$$.fragment),vs=i(),u(Le.$$.fragment),rn=i(),oe=a("h2"),$e=a("a"),To=a("span"),u(Mt.$$.fragment),bs=i(),io=a("span"),io.textContent=pa,ln=i(),S=a("div"),u(Tt.$$.fragment),ys=i(),lo=a("p"),lo.innerHTML=ha,Ms=i(),V=a("div"),u(It.$$.fragment),Ts=i(),co=a("p"),co.innerHTML=ma,Is=i(),u(je.$$.fragment),ws=i(),u(ke.$$.fragment),cn=i(),Io=a("p"),this.h()},l(e){const c=Za("svelte-1phssyn",document.head);s=r(c,"META",{name:!0,content:!0}),c.forEach(t),T=l(e),h=r(e,"P",{}),f(h).forEach(t),p=l(e),M=r(e,"H1",{class:!0});var wt=f(M);o=r(wt,"A",{id:!0,class:!0,href:!0});var wo=f(o);I=r(wo,"SPAN",{});var Po=f(I);_(Be.$$.fragment,Po),Po.forEach(t),wo.forEach(t),Tn=l(wt),$t=r(wt,"SPAN",{"data-svelte-h":!0}),g($t)!=="svelte-15ocwmd"&&($t.textContent=Ps),wt.forEach(t),Uo=l(e),H=r(e,"H2",{class:!0});var Pt=f(H);se=r(Pt,"A",{id:!0,class:!0,href:!0});var xo=f(se);mo=r(xo,"SPAN",{});var Lo=f(mo);_(Re.$$.fragment,Lo),Lo.forEach(t),xo.forEach(t),In=l(Pt),jt=r(Pt,"SPAN",{"data-svelte-h":!0}),g(jt)!=="svelte-1jsw1pg"&&(jt.textContent=xs),Pt.forEach(t),Zo=l(e),Se=r(e,"P",{"data-svelte-h":!0}),g(Se)!=="svelte-m8ac9v"&&(Se.innerHTML=Ls),Wo=l(e),Ge=r(e,"P",{"data-svelte-h":!0}),g(Ge)!=="svelte-vfdo9a"&&(Ge.textContent=$s),No=l(e),Fe=r(e,"P",{"data-svelte-h":!0}),g(Fe)!=="svelte-22isf2"&&(Fe.innerHTML=js),Eo=l(e),q=r(e,"H2",{class:!0});var xt=f(q);ae=r(xt,"A",{id:!0,class:!0,href:!0});var $o=f(ae);fo=r($o,"SPAN",{});var jo=f(fo);_(Xe.$$.fragment,jo),jo.forEach(t),$o.forEach(t),wn=l(xt),kt=r(xt,"SPAN",{"data-svelte-h":!0}),g(kt)!=="svelte-jwh4bg"&&(kt.textContent=ks),xt.forEach(t),Vo=l(e),He=r(e,"P",{"data-svelte-h":!0}),g(He)!=="svelte-1wttker"&&(He.textContent=Js),Bo=l(e),_(qe.$$.fragment,e),Ro=l(e),Ae=r(e,"P",{"data-svelte-h":!0}),g(Ae)!=="svelte-ii9rty"&&(Ae.textContent=zs),So=l(e),Qe=r(e,"UL",{"data-svelte-h":!0}),g(Qe)!=="svelte-14rhxk4"&&(Qe.innerHTML=Us),Go=l(e),Ye=r(e,"P",{"data-svelte-h":!0}),g(Ye)!=="svelte-1w1cg86"&&(Ye.innerHTML=Zs),Fo=l(e),A=r(e,"H2",{class:!0});var Lt=f(A);re=r(Lt,"A",{id:!0,class:!0,href:!0});var ko=f(re);go=r(ko,"SPAN",{});var Jo=f(go);_(Oe.$$.fragment,Jo),Jo.forEach(t),ko.forEach(t),Pn=l(Lt),Jt=r(Lt,"SPAN",{"data-svelte-h":!0}),g(Jt)!=="svelte-ut1gc4"&&(Jt.textContent=Ws),Lt.forEach(t),Xo=l(e),x=r(e,"DIV",{class:!0});var z=f(x);_(De.$$.fragment,z),xn=l(z),zt=r(z,"P",{"data-svelte-h":!0}),g(zt)!=="svelte-o83lda"&&(zt.innerHTML=Ns),Ln=l(z),Ut=r(z,"P",{"data-svelte-h":!0}),g(Ut)!=="svelte-10kqkkl"&&(Ut.innerHTML=Es),$n=l(z),_(ie.$$.fragment,z),jn=l(z),le=r(z,"DIV",{class:!0});var pn=f(le);_(Ke.$$.fragment,pn),kn=l(pn),Zt=r(pn,"P",{"data-svelte-h":!0}),g(Zt)!=="svelte-9k246b"&&(Zt.innerHTML=Vs),pn.forEach(t),z.forEach(t),Ho=l(e),Q=r(e,"H2",{class:!0});var hn=f(Q);ce=r(hn,"A",{id:!0,class:!0,href:!0});var fa=f(ce);uo=r(fa,"SPAN",{});var ga=f(uo);_(et.$$.fragment,ga),ga.forEach(t),fa.forEach(t),Jn=l(hn),Wt=r(hn,"SPAN",{"data-svelte-h":!0}),g(Wt)!=="svelte-1mpo19v"&&(Wt.textContent=Bs),hn.forEach(t),qo=l(e),k=r(e,"DIV",{class:!0});var Je=f(k);_(tt.$$.fragment,Je),zn=l(Je),Nt=r(Je,"P",{"data-svelte-h":!0}),g(Nt)!=="svelte-dq7kz1"&&(Nt.innerHTML=Rs),Un=l(Je),Et=r(Je,"P",{"data-svelte-h":!0}),g(Et)!=="svelte-10kqkkl"&&(Et.innerHTML=Ss),Zn=l(Je),_(de.$$.fragment,Je),Je.forEach(t),Ao=l(e),Y=r(e,"H2",{class:!0});var mn=f(Y);pe=r(mn,"A",{id:!0,class:!0,href:!0});var ua=f(pe);_o=r(ua,"SPAN",{});var _a=f(_o);_(ot.$$.fragment,_a),_a.forEach(t),ua.forEach(t),Wn=l(mn),Vt=r(mn,"SPAN",{"data-svelte-h":!0}),g(Vt)!=="svelte-15a7ij4"&&(Vt.textContent=Gs),mn.forEach(t),Qo=l(e),J=r(e,"DIV",{class:!0});var ze=f(J);_(nt.$$.fragment,ze),Nn=l(ze),Bt=r(ze,"P",{"data-svelte-h":!0}),g(Bt)!=="svelte-1t9pst1"&&(Bt.innerHTML=Fs),En=l(ze),Rt=r(ze,"P",{"data-svelte-h":!0}),g(Rt)!=="svelte-10kqkkl"&&(Rt.innerHTML=Xs),Vn=l(ze),_(he.$$.fragment,ze),ze.forEach(t),Yo=l(e),O=r(e,"H2",{class:!0});var fn=f(O);me=r(fn,"A",{id:!0,class:!0,href:!0});var Ca=f(me);Co=r(Ca,"SPAN",{});var va=f(Co);_(st.$$.fragment,va),va.forEach(t),Ca.forEach(t),Bn=l(fn),St=r(fn,"SPAN",{"data-svelte-h":!0}),g(St)!=="svelte-rv6ayh"&&(St.textContent=Hs),fn.forEach(t),Oo=l(e),R=r(e,"DIV",{class:!0});var po=f(R);_(at.$$.fragment,po),Rn=l(po),Gt=r(po,"P",{"data-svelte-h":!0}),g(Gt)!=="svelte-13f40b0"&&(Gt.textContent=qs),Sn=l(po),fe=r(po,"DIV",{class:!0});var gn=f(fe);_(rt.$$.fragment,gn),Gn=l(gn),Ft=r(gn,"P",{"data-svelte-h":!0}),g(Ft)!=="svelte-1x3yxsa"&&(Ft.textContent=As),gn.forEach(t),po.forEach(t),Do=l(e),D=r(e,"H2",{class:!0});var un=f(D);ge=r(un,"A",{id:!0,class:!0,href:!0});var ba=f(ge);vo=r(ba,"SPAN",{});var ya=f(vo);_(it.$$.fragment,ya),ya.forEach(t),ba.forEach(t),Fn=l(un),Xt=r(un,"SPAN",{"data-svelte-h":!0}),g(Xt)!=="svelte-1opazt4"&&(Xt.textContent=Qs),un.forEach(t),Ko=l(e),lt=r(e,"DIV",{class:!0});var Ma=f(lt);_(ct.$$.fragment,Ma),Ma.forEach(t),en=l(e),K=r(e,"H2",{class:!0});var _n=f(K);ue=r(_n,"A",{id:!0,class:!0,href:!0});var Ta=f(ue);bo=r(Ta,"SPAN",{});var Ia=f(bo);_(dt.$$.fragment,Ia),Ia.forEach(t),Ta.forEach(t),Xn=l(_n),Ht=r(_n,"SPAN",{"data-svelte-h":!0}),g(Ht)!=="svelte-lnsz00"&&(Ht.textContent=Ys),_n.forEach(t),tn=l(e),L=r(e,"DIV",{class:!0});var G=f(L);_(pt.$$.fragment,G),Hn=l(G),qt=r(G,"P",{"data-svelte-h":!0}),g(qt)!=="svelte-1qx1ch7"&&(qt.textContent=Os),qn=l(G),At=r(G,"P",{"data-svelte-h":!0}),g(At)!=="svelte-gxsef4"&&(At.innerHTML=Ds),An=l(G),_e=r(G,"DIV",{class:!0});var Cn=f(_e);_(ht.$$.fragment,Cn),Qn=l(Cn),Qt=r(Cn,"P",{"data-svelte-h":!0}),g(Qt)!=="svelte-48s7rv"&&(Qt.innerHTML=Ks),Cn.forEach(t),Yn=l(G),Ce=r(G,"DIV",{class:!0});var vn=f(Ce);_(mt.$$.fragment,vn),On=l(vn),Yt=r(vn,"P",{"data-svelte-h":!0}),g(Yt)!=="svelte-zkzkjx"&&(Yt.innerHTML=ea),vn.forEach(t),G.forEach(t),on=l(e),ee=r(e,"H2",{class:!0});var bn=f(ee);ve=r(bn,"A",{id:!0,class:!0,href:!0});var wa=f(ve);yo=r(wa,"SPAN",{});var Pa=f(yo);_(ft.$$.fragment,Pa),Pa.forEach(t),wa.forEach(t),Dn=l(bn),Ot=r(bn,"SPAN",{"data-svelte-h":!0}),g(Ot)!=="svelte-166e9e3"&&(Ot.textContent=ta),bn.forEach(t),nn=l(e),$=r(e,"DIV",{class:!0});var F=f($);_(gt.$$.fragment,F),Kn=l(F),Dt=r(F,"P",{"data-svelte-h":!0}),g(Dt)!=="svelte-1gjh92c"&&(Dt.innerHTML=oa),es=l(F),Z=r(F,"DIV",{class:!0});var Ue=f(Z);_(ut.$$.fragment,Ue),ts=l(Ue),Kt=r(Ue,"P",{"data-svelte-h":!0}),g(Kt)!=="svelte-10of4pr"&&(Kt.innerHTML=na),os=l(Ue),_(be.$$.fragment,Ue),ns=l(Ue),_(ye.$$.fragment,Ue),Ue.forEach(t),ss=l(F),W=r(F,"DIV",{class:!0});var Ze=f(W);_(_t.$$.fragment,Ze),as=l(Ze),eo=r(Ze,"P",{"data-svelte-h":!0}),g(eo)!=="svelte-10of4pr"&&(eo.innerHTML=sa),rs=l(Ze),_(Me.$$.fragment,Ze),is=l(Ze),_(Te.$$.fragment,Ze),Ze.forEach(t),ls=l(F),N=r(F,"DIV",{class:!0});var We=f(N);_(Ct.$$.fragment,We),cs=l(We),to=r(We,"P",{"data-svelte-h":!0}),g(to)!=="svelte-10of4pr"&&(to.innerHTML=aa),ds=l(We),_(Ie.$$.fragment,We),ps=l(We),_(we.$$.fragment,We),We.forEach(t),F.forEach(t),sn=l(e),te=r(e,"H2",{class:!0});var yn=f(te);Pe=r(yn,"A",{id:!0,class:!0,href:!0});var xa=f(Pe);Mo=r(xa,"SPAN",{});var La=f(Mo);_(vt.$$.fragment,La),La.forEach(t),xa.forEach(t),hs=l(yn),oo=r(yn,"SPAN",{"data-svelte-h":!0}),g(oo)!=="svelte-qtpsk"&&(oo.textContent=ra),yn.forEach(t),an=l(e),j=r(e,"DIV",{class:!0});var X=f(j);_(bt.$$.fragment,X),ms=l(X),no=r(X,"P",{"data-svelte-h":!0}),g(no)!=="svelte-1qchh77"&&(no.innerHTML=ia),fs=l(X),so=r(X,"P",{"data-svelte-h":!0}),g(so)!=="svelte-1du13oj"&&(so.innerHTML=la),gs=l(X),ao=r(X,"P",{"data-svelte-h":!0}),g(ao)!=="svelte-174erte"&&(ao.innerHTML=ca),us=l(X),E=r(X,"DIV",{class:!0});var Ne=f(E);_(yt.$$.fragment,Ne),_s=l(Ne),ro=r(Ne,"P",{"data-svelte-h":!0}),g(ro)!=="svelte-1njifrd"&&(ro.innerHTML=da),Cs=l(Ne),_(xe.$$.fragment,Ne),vs=l(Ne),_(Le.$$.fragment,Ne),Ne.forEach(t),X.forEach(t),rn=l(e),oe=r(e,"H2",{class:!0});var Mn=f(oe);$e=r(Mn,"A",{id:!0,class:!0,href:!0});var $a=f($e);To=r($a,"SPAN",{});var ja=f(To);_(Mt.$$.fragment,ja),ja.forEach(t),$a.forEach(t),bs=l(Mn),io=r(Mn,"SPAN",{"data-svelte-h":!0}),g(io)!=="svelte-cdosab"&&(io.textContent=pa),Mn.forEach(t),ln=l(e),S=r(e,"DIV",{class:!0});var ho=f(S);_(Tt.$$.fragment,ho),ys=l(ho),lo=r(ho,"P",{"data-svelte-h":!0}),g(lo)!=="svelte-oxx39y"&&(lo.innerHTML=ha),Ms=l(ho),V=r(ho,"DIV",{class:!0});var Ee=f(V);_(It.$$.fragment,Ee),Ts=l(Ee),co=r(Ee,"P",{"data-svelte-h":!0}),g(co)!=="svelte-7me8q7"&&(co.innerHTML=ma),Is=l(Ee),_(je.$$.fragment,Ee),ws=l(Ee),_(ke.$$.fragment,Ee),Ee.forEach(t),ho.forEach(t),cn=l(e),Io=r(e,"P",{}),f(Io).forEach(t),this.h()},h(){m(s,"name","hf:doc:metadata"),m(s,"content",JSON.stringify(Ya)),m(o,"id","chineseclip"),m(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"),m(o,"href","#chineseclip"),m(M,"class","relative group"),m(se,"id","overview"),m(se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(se,"href","#overview"),m(H,"class","relative group"),m(ae,"id","usage"),m(ae,"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"),m(ae,"href","#usage"),m(q,"class","relative group"),m(re,"id","transformers.ChineseCLIPConfig"),m(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(re,"href","#transformers.ChineseCLIPConfig"),m(A,"class","relative group"),m(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ce,"id","transformers.ChineseCLIPTextConfig"),m(ce,"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"),m(ce,"href","#transformers.ChineseCLIPTextConfig"),m(Q,"class","relative group"),m(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(pe,"id","transformers.ChineseCLIPVisionConfig"),m(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"),m(pe,"href","#transformers.ChineseCLIPVisionConfig"),m(Y,"class","relative group"),m(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(me,"id","transformers.ChineseCLIPImageProcessor"),m(me,"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"),m(me,"href","#transformers.ChineseCLIPImageProcessor"),m(O,"class","relative group"),m(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ge,"id","transformers.ChineseCLIPFeatureExtractor"),m(ge,"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"),m(ge,"href","#transformers.ChineseCLIPFeatureExtractor"),m(D,"class","relative group"),m(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ue,"id","transformers.ChineseCLIPProcessor"),m(ue,"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"),m(ue,"href","#transformers.ChineseCLIPProcessor"),m(K,"class","relative group"),m(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ve,"id","transformers.ChineseCLIPModel"),m(ve,"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"),m(ve,"href","#transformers.ChineseCLIPModel"),m(ee,"class","relative group"),m(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Pe,"id","transformers.ChineseCLIPTextModel"),m(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"),m(Pe,"href","#transformers.ChineseCLIPTextModel"),m(te,"class","relative group"),m(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($e,"id","transformers.ChineseCLIPVisionModel"),m($e,"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"),m($e,"href","#transformers.ChineseCLIPVisionModel"),m(oe,"class","relative group"),m(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,c){n(document.head,s),d(e,T,c),d(e,h,c),d(e,p,c),d(e,M,c),n(M,o),n(o,I),C(Be,I,null),n(M,Tn),n(M,$t),d(e,Uo,c),d(e,H,c),n(H,se),n(se,mo),C(Re,mo,null),n(H,In),n(H,jt),d(e,Zo,c),d(e,Se,c),d(e,Wo,c),d(e,Ge,c),d(e,No,c),d(e,Fe,c),d(e,Eo,c),d(e,q,c),n(q,ae),n(ae,fo),C(Xe,fo,null),n(q,wn),n(q,kt),d(e,Vo,c),d(e,He,c),d(e,Bo,c),C(qe,e,c),d(e,Ro,c),d(e,Ae,c),d(e,So,c),d(e,Qe,c),d(e,Go,c),d(e,Ye,c),d(e,Fo,c),d(e,A,c),n(A,re),n(re,go),C(Oe,go,null),n(A,Pn),n(A,Jt),d(e,Xo,c),d(e,x,c),C(De,x,null),n(x,xn),n(x,zt),n(x,Ln),n(x,Ut),n(x,$n),C(ie,x,null),n(x,jn),n(x,le),C(Ke,le,null),n(le,kn),n(le,Zt),d(e,Ho,c),d(e,Q,c),n(Q,ce),n(ce,uo),C(et,uo,null),n(Q,Jn),n(Q,Wt),d(e,qo,c),d(e,k,c),C(tt,k,null),n(k,zn),n(k,Nt),n(k,Un),n(k,Et),n(k,Zn),C(de,k,null),d(e,Ao,c),d(e,Y,c),n(Y,pe),n(pe,_o),C(ot,_o,null),n(Y,Wn),n(Y,Vt),d(e,Qo,c),d(e,J,c),C(nt,J,null),n(J,Nn),n(J,Bt),n(J,En),n(J,Rt),n(J,Vn),C(he,J,null),d(e,Yo,c),d(e,O,c),n(O,me),n(me,Co),C(st,Co,null),n(O,Bn),n(O,St),d(e,Oo,c),d(e,R,c),C(at,R,null),n(R,Rn),n(R,Gt),n(R,Sn),n(R,fe),C(rt,fe,null),n(fe,Gn),n(fe,Ft),d(e,Do,c),d(e,D,c),n(D,ge),n(ge,vo),C(it,vo,null),n(D,Fn),n(D,Xt),d(e,Ko,c),d(e,lt,c),C(ct,lt,null),d(e,en,c),d(e,K,c),n(K,ue),n(ue,bo),C(dt,bo,null),n(K,Xn),n(K,Ht),d(e,tn,c),d(e,L,c),C(pt,L,null),n(L,Hn),n(L,qt),n(L,qn),n(L,At),n(L,An),n(L,_e),C(ht,_e,null),n(_e,Qn),n(_e,Qt),n(L,Yn),n(L,Ce),C(mt,Ce,null),n(Ce,On),n(Ce,Yt),d(e,on,c),d(e,ee,c),n(ee,ve),n(ve,yo),C(ft,yo,null),n(ee,Dn),n(ee,Ot),d(e,nn,c),d(e,$,c),C(gt,$,null),n($,Kn),n($,Dt),n($,es),n($,Z),C(ut,Z,null),n(Z,ts),n(Z,Kt),n(Z,os),C(be,Z,null),n(Z,ns),C(ye,Z,null),n($,ss),n($,W),C(_t,W,null),n(W,as),n(W,eo),n(W,rs),C(Me,W,null),n(W,is),C(Te,W,null),n($,ls),n($,N),C(Ct,N,null),n(N,cs),n(N,to),n(N,ds),C(Ie,N,null),n(N,ps),C(we,N,null),d(e,sn,c),d(e,te,c),n(te,Pe),n(Pe,Mo),C(vt,Mo,null),n(te,hs),n(te,oo),d(e,an,c),d(e,j,c),C(bt,j,null),n(j,ms),n(j,no),n(j,fs),n(j,so),n(j,gs),n(j,ao),n(j,us),n(j,E),C(yt,E,null),n(E,_s),n(E,ro),n(E,Cs),C(xe,E,null),n(E,vs),C(Le,E,null),d(e,rn,c),d(e,oe,c),n(oe,$e),n($e,To),C(Mt,To,null),n(oe,bs),n(oe,io),d(e,ln,c),d(e,S,c),C(Tt,S,null),n(S,ys),n(S,lo),n(S,Ms),n(S,V),C(It,V,null),n(V,Ts),n(V,co),n(V,Is),C(je,V,null),n(V,ws),C(ke,V,null),d(e,cn,c),d(e,Io,c),dn=!0},p(e,[c]){const wt={};c&2&&(wt.$$scope={dirty:c,ctx:e}),ie.$set(wt);const wo={};c&2&&(wo.$$scope={dirty:c,ctx:e}),de.$set(wo);const Po={};c&2&&(Po.$$scope={dirty:c,ctx:e}),he.$set(Po);const Pt={};c&2&&(Pt.$$scope={dirty:c,ctx:e}),be.$set(Pt);const xo={};c&2&&(xo.$$scope={dirty:c,ctx:e}),ye.$set(xo);const Lo={};c&2&&(Lo.$$scope={dirty:c,ctx:e}),Me.$set(Lo);const xt={};c&2&&(xt.$$scope={dirty:c,ctx:e}),Te.$set(xt);const $o={};c&2&&($o.$$scope={dirty:c,ctx:e}),Ie.$set($o);const jo={};c&2&&(jo.$$scope={dirty:c,ctx:e}),we.$set(jo);const Lt={};c&2&&(Lt.$$scope={dirty:c,ctx:e}),xe.$set(Lt);const ko={};c&2&&(ko.$$scope={dirty:c,ctx:e}),Le.$set(ko);const Jo={};c&2&&(Jo.$$scope={dirty:c,ctx:e}),je.$set(Jo);const z={};c&2&&(z.$$scope={dirty:c,ctx:e}),ke.$set(z)},i(e){dn||(v(Be.$$.fragment,e),v(Re.$$.fragment,e),v(Xe.$$.fragment,e),v(qe.$$.fragment,e),v(Oe.$$.fragment,e),v(De.$$.fragment,e),v(ie.$$.fragment,e),v(Ke.$$.fragment,e),v(et.$$.fragment,e),v(tt.$$.fragment,e),v(de.$$.fragment,e),v(ot.$$.fragment,e),v(nt.$$.fragment,e),v(he.$$.fragment,e),v(st.$$.fragment,e),v(at.$$.fragment,e),v(rt.$$.fragment,e),v(it.$$.fragment,e),v(ct.$$.fragment,e),v(dt.$$.fragment,e),v(pt.$$.fragment,e),v(ht.$$.fragment,e),v(mt.$$.fragment,e),v(ft.$$.fragment,e),v(gt.$$.fragment,e),v(ut.$$.fragment,e),v(be.$$.fragment,e),v(ye.$$.fragment,e),v(_t.$$.fragment,e),v(Me.$$.fragment,e),v(Te.$$.fragment,e),v(Ct.$$.fragment,e),v(Ie.$$.fragment,e),v(we.$$.fragment,e),v(vt.$$.fragment,e),v(bt.$$.fragment,e),v(yt.$$.fragment,e),v(xe.$$.fragment,e),v(Le.$$.fragment,e),v(Mt.$$.fragment,e),v(Tt.$$.fragment,e),v(It.$$.fragment,e),v(je.$$.fragment,e),v(ke.$$.fragment,e),dn=!0)},o(e){b(Be.$$.fragment,e),b(Re.$$.fragment,e),b(Xe.$$.fragment,e),b(qe.$$.fragment,e),b(Oe.$$.fragment,e),b(De.$$.fragment,e),b(ie.$$.fragment,e),b(Ke.$$.fragment,e),b(et.$$.fragment,e),b(tt.$$.fragment,e),b(de.$$.fragment,e),b(ot.$$.fragment,e),b(nt.$$.fragment,e),b(he.$$.fragment,e),b(st.$$.fragment,e),b(at.$$.fragment,e),b(rt.$$.fragment,e),b(it.$$.fragment,e),b(ct.$$.fragment,e),b(dt.$$.fragment,e),b(pt.$$.fragment,e),b(ht.$$.fragment,e),b(mt.$$.fragment,e),b(ft.$$.fragment,e),b(gt.$$.fragment,e),b(ut.$$.fragment,e),b(be.$$.fragment,e),b(ye.$$.fragment,e),b(_t.$$.fragment,e),b(Me.$$.fragment,e),b(Te.$$.fragment,e),b(Ct.$$.fragment,e),b(Ie.$$.fragment,e),b(we.$$.fragment,e),b(vt.$$.fragment,e),b(bt.$$.fragment,e),b(yt.$$.fragment,e),b(xe.$$.fragment,e),b(Le.$$.fragment,e),b(Mt.$$.fragment,e),b(Tt.$$.fragment,e),b(It.$$.fragment,e),b(je.$$.fragment,e),b(ke.$$.fragment,e),dn=!1},d(e){e&&(t(T),t(h),t(p),t(M),t(Uo),t(H),t(Zo),t(Se),t(Wo),t(Ge),t(No),t(Fe),t(Eo),t(q),t(Vo),t(He),t(Bo),t(Ro),t(Ae),t(So),t(Qe),t(Go),t(Ye),t(Fo),t(A),t(Xo),t(x),t(Ho),t(Q),t(qo),t(k),t(Ao),t(Y),t(Qo),t(J),t(Yo),t(O),t(Oo),t(R),t(Do),t(D),t(Ko),t(lt),t(en),t(K),t(tn),t(L),t(on),t(ee),t(nn),t($),t(sn),t(te),t(an),t(j),t(rn),t(oe),t(ln),t(S),t(cn),t(Io)),t(s),y(Be),y(Re),y(Xe),y(qe,e),y(Oe),y(De),y(ie),y(Ke),y(et),y(tt),y(de),y(ot),y(nt),y(he),y(st),y(at),y(rt),y(it),y(ct),y(dt),y(pt),y(ht),y(mt),y(ft),y(gt),y(ut),y(be),y(ye),y(_t),y(Me),y(Te),y(Ct),y(Ie),y(we),y(vt),y(bt),y(yt),y(xe),y(Le),y(Mt),y(Tt),y(It),y(je),y(ke)}}}const Ya={local:"chineseclip",sections:[{local:"overview",title:"Overview"},{local:"usage",title:"Usage"},{local:"transformers.ChineseCLIPConfig",title:"ChineseCLIPConfig"},{local:"transformers.ChineseCLIPTextConfig",title:"ChineseCLIPTextConfig"},{local:"transformers.ChineseCLIPVisionConfig",title:"ChineseCLIPVisionConfig"},{local:"transformers.ChineseCLIPImageProcessor",title:"ChineseCLIPImageProcessor"},{local:"transformers.ChineseCLIPFeatureExtractor",title:"ChineseCLIPFeatureExtractor"},{local:"transformers.ChineseCLIPProcessor",title:"ChineseCLIPProcessor"},{local:"transformers.ChineseCLIPModel",title:"ChineseCLIPModel"},{local:"transformers.ChineseCLIPTextModel",title:"ChineseCLIPTextModel"},{local:"transformers.ChineseCLIPVisionModel",title:"ChineseCLIPVisionModel"}],title:"Chinese-CLIP"};function Oa(w){return Ja(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ar extends za{constructor(s){super(),Ua(this,s,Oa,Qa,ka,{})}}export{ar as component};
