import{s as ts,o as os,n as O}from"../chunks/scheduler.18a86fab.js";import{S as ns,i as ss,g as c,s,r as h,A as as,h as d,f as o,c as a,j as P,u as g,x as T,k as M,y as i,a as l,v as f,d as u,t as _,w as C}from"../chunks/index.98837b22.js";import{T as Cn}from"../chunks/Tip.77304350.js";import{D as w}from"../chunks/Docstring.6758ea23.js";import{C as ge}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as at}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H as R}from"../chunks/Heading.7e7e0c5b.js";import{E as rs}from"../chunks/index.92f616ba.js";function is(v){let r,y="Example:",p,m,I;return m=new ge({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(){r=c("p"),r.textContent=y,p=s(),h(m.$$.fragment)},l(t){r=d(t,"P",{"data-svelte-h":!0}),T(r)!=="svelte-11lpom8"&&(r.textContent=y),p=a(t),g(m.$$.fragment,t)},m(t,b){l(t,r,b),l(t,p,b),f(m,t,b),I=!0},p:O,i(t){I||(u(m.$$.fragment,t),I=!0)},o(t){_(m.$$.fragment,t),I=!1},d(t){t&&(o(r),o(p)),C(m,t)}}}function ls(v){let r,y="Example:",p,m,I;return m=new ge({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(){r=c("p"),r.textContent=y,p=s(),h(m.$$.fragment)},l(t){r=d(t,"P",{"data-svelte-h":!0}),T(r)!=="svelte-11lpom8"&&(r.textContent=y),p=a(t),g(m.$$.fragment,t)},m(t,b){l(t,r,b),l(t,p,b),f(m,t,b),I=!0},p:O,i(t){I||(u(m.$$.fragment,t),I=!0)},o(t){_(m.$$.fragment,t),I=!1},d(t){t&&(o(r),o(p)),C(m,t)}}}function cs(v){let r,y="Example:",p,m,I;return m=new ge({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(){r=c("p"),r.textContent=y,p=s(),h(m.$$.fragment)},l(t){r=d(t,"P",{"data-svelte-h":!0}),T(r)!=="svelte-11lpom8"&&(r.textContent=y),p=a(t),g(m.$$.fragment,t)},m(t,b){l(t,r,b),l(t,p,b),f(m,t,b),I=!0},p:O,i(t){I||(u(m.$$.fragment,t),I=!0)},o(t){_(m.$$.fragment,t),I=!1},d(t){t&&(o(r),o(p)),C(m,t)}}}function ds(v){let r,y=`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(){r=c("p"),r.innerHTML=y},l(p){r=d(p,"P",{"data-svelte-h":!0}),T(r)!=="svelte-fincs2"&&(r.innerHTML=y)},m(p,m){l(p,r,m)},p:O,d(p){p&&o(r)}}}function ms(v){let r,y="Examples:",p,m,I;return m=new ge({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(){r=c("p"),r.textContent=y,p=s(),h(m.$$.fragment)},l(t){r=d(t,"P",{"data-svelte-h":!0}),T(r)!=="svelte-kvfsh7"&&(r.textContent=y),p=a(t),g(m.$$.fragment,t)},m(t,b){l(t,r,b),l(t,p,b),f(m,t,b),I=!0},p:O,i(t){I||(u(m.$$.fragment,t),I=!0)},o(t){_(m.$$.fragment,t),I=!1},d(t){t&&(o(r),o(p)),C(m,t)}}}function ps(v){let r,y="Examples:",p,m,I;return m=new ge({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(){r=c("p"),r.textContent=y,p=s(),h(m.$$.fragment)},l(t){r=d(t,"P",{"data-svelte-h":!0}),T(r)!=="svelte-kvfsh7"&&(r.textContent=y),p=a(t),g(m.$$.fragment,t)},m(t,b){l(t,r,b),l(t,p,b),f(m,t,b),I=!0},p:O,i(t){I||(u(m.$$.fragment,t),I=!0)},o(t){_(m.$$.fragment,t),I=!1},d(t){t&&(o(r),o(p)),C(m,t)}}}function hs(v){let r,y="Examples:",p,m,I;return m=new ge({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(){r=c("p"),r.textContent=y,p=s(),h(m.$$.fragment)},l(t){r=d(t,"P",{"data-svelte-h":!0}),T(r)!=="svelte-kvfsh7"&&(r.textContent=y),p=a(t),g(m.$$.fragment,t)},m(t,b){l(t,r,b),l(t,p,b),f(m,t,b),I=!0},p:O,i(t){I||(u(m.$$.fragment,t),I=!0)},o(t){_(m.$$.fragment,t),I=!1},d(t){t&&(o(r),o(p)),C(m,t)}}}function gs(v){let r,y=`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(){r=c("p"),r.innerHTML=y},l(p){r=d(p,"P",{"data-svelte-h":!0}),T(r)!=="svelte-fincs2"&&(r.innerHTML=y)},m(p,m){l(p,r,m)},p:O,d(p){p&&o(r)}}}function fs(v){let r,y=`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(){r=c("p"),r.innerHTML=y},l(p){r=d(p,"P",{"data-svelte-h":!0}),T(r)!=="svelte-fincs2"&&(r.innerHTML=y)},m(p,m){l(p,r,m)},p:O,d(p){p&&o(r)}}}function us(v){let r,y="Examples:",p,m,I;return m=new ge({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(){r=c("p"),r.textContent=y,p=s(),h(m.$$.fragment)},l(t){r=d(t,"P",{"data-svelte-h":!0}),T(r)!=="svelte-kvfsh7"&&(r.textContent=y),p=a(t),g(m.$$.fragment,t)},m(t,b){l(t,r,b),l(t,p,b),f(m,t,b),I=!0},p:O,i(t){I||(u(m.$$.fragment,t),I=!0)},o(t){_(m.$$.fragment,t),I=!1},d(t){t&&(o(r),o(p)),C(m,t)}}}function _s(v){let r,y,p,m,I,t,b,Tn='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',Rt,fe,Vt,ue,In=`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>.`,Et,_e,bn="The abstract from the paper is the following:",qt,Ce,yn="<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>",Bt,Te,Mn='The Chinese-CLIP model was contributed by <a href="https://huggingface.co/OFA-Sys" rel="nofollow">OFA-Sys</a>.',St,Ie,Dt,be,vn="The code snippet below shows how to compute image & text features and similarities:",Gt,ye,Xt,Me,Pn="Currently, following scales of pretrained Chinese-CLIP models are available on 🤗 Hub:",Ot,ve,wn='<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>',Ht,Pe,Qt,x,we,Mo,rt,Ln=`<a href="/docs/transformers/main/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</a> is the configuration class to store the configuration of a <a href="/docs/transformers/main/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.`,vo,it,xn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Po,Q,wo,A,Le,Lo,lt,$n=`Instantiate a <a href="/docs/transformers/main/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/main/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig">ChineseCLIPConfig</a>: An instance of a configuration object`,At,xe,Yt,U,$e,xo,ct,jn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/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.`,$o,dt,zn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,jo,Y,Kt,je,eo,N,ze,zo,mt,kn=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/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
<a href="https://huggingface.co/OFA-Sys/chinese-clip-vit-base-patch16" rel="nofollow">OFA-Sys/chinese-clip-vit-base-patch16</a> architecture.`,ko,pt,Jn=`Configuration objects inherit from <a href="/docs/transformers/main/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/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Jo,K,to,ke,oo,q,Je,Uo,ht,Un="Constructs a Chinese-CLIP image processor.",No,ee,Ue,Fo,gt,Nn="Preprocess an image or batch of images.",no,Ne,so,$,Fe,Wo,ft,Fn="Constructs a fast Chinese Clip image processor.",Zo,ut,Wn=`data_format (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>):
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.
input_data_format (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>):
The channel dimension format for the input image. If unset, the channel dimension format is inferred
from the input image. Can be one of:`,Ro,_t,Zn=`<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.
device (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>):
The device to process the images on. If unset, the device is inferred from the input images.</li>`,Vo,Ct,We,ao,Ze,ro,Re,Ve,io,Ee,lo,j,qe,Eo,Tt,Rn=`Constructs a Chinese-CLIP processor which wraps a Chinese-CLIP image processor and a Chinese-CLIP tokenizer into a
single processor.`,qo,It,Vn=`<a href="/docs/transformers/main/en/model_doc/chinese_clip#transformers.ChineseCLIPProcessor">ChineseCLIPProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>.
See the <code>__call__()</code> and <a href="/docs/transformers/main/en/model_doc/chinese_clip#transformers.ChineseCLIPProcessor.decode">decode()</a> for more information.`,Bo,te,Be,So,bt,En=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,Do,oe,Se,Go,yt,qn=`This method forwards all its arguments to BertTokenizerFast’s <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.decode">decode()</a>. Please refer to
the docstring of this method for more information.`,co,De,mo,L,Ge,Xo,Mt,Bn="The bare Chinese Clip Model outputting raw hidden-states without any specific head on top.",Oo,vt,Sn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,Ho,Pt,Dn=`This model is also 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.`,Qo,V,Xe,Ao,wt,Gn='The <a href="/docs/transformers/main/en/model_doc/chinese_clip#transformers.ChineseCLIPModel">ChineseCLIPModel</a> forward method, overrides the <code>__call__</code> special method.',Yo,ne,Ko,se,en,ae,Oe,tn,re,on,ie,He,nn,le,po,Qe,ho,z,Ae,sn,Lt,Xn="The text model from CHINESE_CLIP without any head or projection on top.",an,xt,On=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,rn,$t,Hn=`This model is also 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.`,ln,D,Ye,cn,jt,Qn='The <a href="/docs/transformers/main/en/model_doc/chinese_clip#transformers.ChineseCLIPTextModel">ChineseCLIPTextModel</a> forward method, overrides the <code>__call__</code> special method.',dn,ce,go,Ke,fo,k,et,mn,zt,An="The vision model from CHINESE_CLIP without any head or projection on top.",pn,kt,Yn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,hn,Jt,Kn=`This model is also 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.`,gn,E,tt,fn,Ut,es='The <a href="/docs/transformers/main/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionModel">ChineseCLIPVisionModel</a> forward method, overrides the <code>__call__</code> special method.',un,de,_n,me,uo,ot,_o,Ft,Co;return I=new R({props:{title:"Chinese-CLIP",local:"chinese-clip",headingTag:"h1"}}),fe=new R({props:{title:"Overview",local:"overview",headingTag:"h2"}}),Ie=new R({props:{title:"Usage example",local:"usage-example",headingTag:"h2"}}),ye=new ge({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}}),Pe=new R({props:{title:"ChineseCLIPConfig",local:"transformers.ChineseCLIPConfig",headingTag:"h2"}}),we=new w({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/main/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/main/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;
Dimensionality 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 initial value of the <em>logit_scale</em> parameter. 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/main/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L236"}}),Q=new at({props:{anchor:"transformers.ChineseCLIPConfig.example",$$slots:{default:[is]},$$scope:{ctx:v}}}),Le=new w({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/main/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L375"}}),xe=new R({props:{title:"ChineseCLIPTextConfig",local:"transformers.ChineseCLIPTextConfig",headingTag:"h2"}}),$e=new w({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/main/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/main/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.initializer_factor",description:`<strong>initializer_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"},{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.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Padding token id.`,name:"pad_token_id"},{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/main/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L33"}}),Y=new at({props:{anchor:"transformers.ChineseCLIPTextConfig.example",$$slots:{default:[ls]},$$scope:{ctx:v}}}),je=new R({props:{title:"ChineseCLIPVisionConfig",local:"transformers.ChineseCLIPVisionConfig",headingTag:"h2"}}),ze=new w({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.projection_dim",description:`<strong>projection_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimensionality of text and vision projection layers.`,name:"projection_dim"},{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.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{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-05) &#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> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
A factor for initializing all weight matrices (should be kept to 1, used internally for initialization
testing).`,name:"initializer_factor"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/configuration_chinese_clip.py#L145"}}),K=new at({props:{anchor:"transformers.ChineseCLIPVisionConfig.example",$$slots:{default:[cs]},$$scope:{ctx:v}}}),ke=new R({props:{title:"ChineseCLIPImageProcessor",local:"transformers.ChineseCLIPImageProcessor",headingTag:"h2"}}),Je=new w({props:{name:"class transformers.ChineseCLIPImageProcessor",anchor:"transformers.ChineseCLIPImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"crop_size",val:": typing.Optional[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>Resampling.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.`,name:"rescale_factor"},{anchor:"transformers.ChineseCLIPImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by <code>do_normalize</code> in the <code>preprocess</code> method.`,name:"do_normalize"},{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/main/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L54"}}),Ue=new w({props:{name:"preprocess",anchor:"transformers.ChineseCLIPImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"do_resize",val:": typing.Optional[bool] = None"},{name:"size",val:": typing.Optional[typing.Dict[str, int]] = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": typing.Optional[bool] = None"},{name:"crop_size",val:": typing.Optional[int] = None"},{name:"do_rescale",val:": typing.Optional[bool] = None"},{name:"rescale_factor",val:": typing.Optional[float] = None"},{name:"do_normalize",val:": typing.Optional[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:": typing.Optional[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"}],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/main/src/transformers/models/chinese_clip/image_processing_chinese_clip.py#L168"}}),Ne=new R({props:{title:"ChineseCLIPImageProcessorFast",local:"transformers.ChineseCLIPImageProcessorFast",headingTag:"h2"}}),Fe=new w({props:{name:"class transformers.ChineseCLIPImageProcessorFast",anchor:"transformers.ChineseCLIPImageProcessorFast",parameters:[{name:"**kwargs",val:": typing_extensions.Unpack[transformers.image_processing_utils_fast.DefaultFastImageProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessorFast.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ChineseCLIPImageProcessorFast.size",description:`<strong>size</strong> (<code>dict[str, int]</code>, <em>optional</em>, defaults to <code>{&apos;shortest_edge&apos; -- 224}</code>):
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.ChineseCLIPImageProcessorFast.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to default to a square image when resizing, if size is an int.`,name:"default_to_square"},{anchor:"transformers.ChineseCLIPImageProcessorFast.resample",description:`<strong>resample</strong> (<code>Union[PILImageResampling, F.InterpolationMode, NoneType]</code>, defaults to <code>Resampling.BICUBIC</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.ChineseCLIPImageProcessorFast.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.`,name:"do_center_crop"},{anchor:"transformers.ChineseCLIPImageProcessorFast.crop_size",description:`<strong>crop_size</strong> (<code>dict[str, int]</code>, <em>optional</em>, defaults to <code>{&apos;height&apos; -- 224, &apos;width&apos;: 224}</code>):
Size of the output image after applying <code>center_crop</code>.`,name:"crop_size"},{anchor:"transformers.ChineseCLIPImageProcessorFast.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ChineseCLIPImageProcessorFast.rescale_factor",description:`<strong>rescale_factor</strong> (<code>Union[int, float, NoneType]</code>, defaults to <code>0.00392156862745098</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.ChineseCLIPImageProcessorFast.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ChineseCLIPImageProcessorFast.image_mean",description:`<strong>image_mean</strong> (<code>Union[float, list[float], NoneType]</code>, defaults to <code>[0.48145466, 0.4578275, 0.40821073]</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.ChineseCLIPImageProcessorFast.image_std",description:`<strong>image_std</strong> (<code>Union[float, list[float], NoneType]</code>, defaults to <code>[0.26862954, 0.26130258, 0.27577711]</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.ChineseCLIPImageProcessorFast.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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.return_tensors",description:"<strong>return_tensors</strong> (<code>Union[str, ~utils.generic.TensorType, NoneType]</code>, defaults to <code>None</code>) &#x2014;\nReturns stacked tensors if set to `pt, otherwise returns a list of tensors.",name:"return_tensors"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.
Returns stacked tensors if set to \`pt, otherwise returns a list of tensors.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>, defaults to <code>None</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.`,name:"device"},{anchor:"transformers.ChineseCLIPImageProcessorFast.Returns",description:"<strong>Returns</strong> stacked tensors if set to `pt, otherwise returns a list of tensors. &#x2014;",name:"Returns"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/image_processing_chinese_clip_fast.py#L22"}}),We=new w({props:{name:"preprocess",anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), list['PIL.Image.Image'], list[numpy.ndarray], list['torch.Tensor']]"},{name:"*args",val:""},{name:"**kwargs",val:": typing_extensions.Unpack[transformers.image_processing_utils_fast.DefaultFastImageProcessorKwargs]"}],parametersDescription:[{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.images",description:`<strong>images</strong> (<code>Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[&apos;PIL.Image.Image&apos;], list[numpy.ndarray], list[&apos;torch.Tensor&apos;]]</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.ChineseCLIPImageProcessorFast.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.size",description:`<strong>size</strong> (<code>dict[str, int]</code>, <em>optional</em>) &#x2014;
Describes the maximum input dimensions to the model.`,name:"size"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.default_to_square",description:`<strong>default_to_square</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to default to a square image when resizing, if size is an int.`,name:"default_to_square"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.resample",description:`<strong>resample</strong> (<code>Union[PILImageResampling, F.InterpolationMode, NoneType]</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.ChineseCLIPImageProcessorFast.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>dict[str, int]</code>, <em>optional</em>) &#x2014;
Size of the output image after applying <code>center_crop</code>.`,name:"crop_size"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to rescale the image.`,name:"do_rescale"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>Union[int, float, NoneType]</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.ChineseCLIPImageProcessorFast.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>Union[float, list[float], NoneType]</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.ChineseCLIPImageProcessorFast.preprocess.image_std",description:`<strong>image_std</strong> (<code>Union[float, list[float], NoneType]</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.ChineseCLIPImageProcessorFast.preprocess.do_convert_rgb",description:`<strong>do_convert_rgb</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to convert the image to RGB.`,name:"do_convert_rgb"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.return_tensors",description:"<strong>return_tensors</strong> (<code>Union[str, ~utils.generic.TensorType, NoneType]</code>) &#x2014;\nReturns stacked tensors if set to `pt, otherwise returns a list of tensors.",name:"return_tensors"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.data_format",description:`<strong>data_format</strong> (<code>~image_utils.ChannelDimension</code>, <em>optional</em>) &#x2014;
Only <code>ChannelDimension.FIRST</code> is supported. Added for compatibility with slow processors.`,name:"data_format"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>Union[~image_utils.ChannelDimension, str, NoneType]</code>) &#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"},{anchor:"transformers.ChineseCLIPImageProcessorFast.preprocess.device",description:`<strong>device</strong> (<code>torch.device</code>, <em>optional</em>) &#x2014;
The device to process the images on. If unset, the device is inferred from the input images.`,name:"device"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/image_processing_utils_fast.py#L571",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><strong>data</strong> (<code>dict</code>) — Dictionary of lists/arrays/tensors returned by the <strong>call</strong> method (‘pixel_values’, etc.).</li>
<li><strong>tensor_type</strong> (<code>Union[None, str, TensorType]</code>, <em>optional</em>) — You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
initialization.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>&lt;class 'transformers.image_processing_base.BatchFeature'&gt;</code></p>
`}}),Ze=new R({props:{title:"ChineseCLIPFeatureExtractor",local:"transformers.ChineseCLIPFeatureExtractor",headingTag:"h2"}}),Ve=new w({props:{name:"class transformers.ChineseCLIPFeatureExtractor",anchor:"transformers.ChineseCLIPFeatureExtractor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/feature_extraction_chinese_clip.py#L27"}}),Ee=new R({props:{title:"ChineseCLIPProcessor",local:"transformers.ChineseCLIPProcessor",headingTag:"h2"}}),qe=new w({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/main/en/model_doc/chinese_clip#transformers.ChineseCLIPImageProcessor">ChineseCLIPImageProcessor</a>, <em>optional</em>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.ChineseCLIPProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/processing_chinese_clip.py#L31"}}),Be=new w({props:{name:"batch_decode",anchor:"transformers.ChineseCLIPProcessor.batch_decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/processing_chinese_clip.py#L134"}}),Se=new w({props:{name:"decode",anchor:"transformers.ChineseCLIPProcessor.decode",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/processing_chinese_clip.py#L141"}}),De=new R({props:{title:"ChineseCLIPModel",local:"transformers.ChineseCLIPModel",headingTag:"h2"}}),Ge=new w({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/main/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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1226"}}),Xe=new w({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:"interpolate_pos_encoding",val:": bool = False"},{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>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ChineseCLIPModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,name:"pixel_values"},{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.Tensor</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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{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.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1364",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<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 (<a
  href="/docs/transformers/main/en/model_doc/chinese_clip#transformers.ChineseCLIPConfig"
>ChineseCLIPConfig</a>) 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/main/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/main/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/main/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/main/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionModel"
>ChineseCLIPVisionModel</a>.</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.chinese_clip.modeling_chinese_clip.ChineseCLIPOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new Cn({props:{$$slots:{default:[ds]},$$scope:{ctx:v}}}),se=new at({props:{anchor:"transformers.ChineseCLIPModel.forward.example",$$slots:{default:[ms]},$$scope:{ctx:v}}}),Oe=new w({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.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.ChineseCLIPModel.get_text_features.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.ChineseCLIPModel.get_text_features.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</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.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1262",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The text embeddings obtained by
applying the projection layer to the final [CLS] hidden state of Text-Transformer.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>text_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),re=new at({props:{anchor:"transformers.ChineseCLIPModel.get_text_features.example",$$slots:{default:[ps]},$$scope:{ctx:v}}}),He=new w({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:"interpolate_pos_encoding",val:": bool = False"},{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, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,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.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1312",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The image embeddings obtained by
applying the projection layer to the final [CLS] hidden state of Vision-Transformer.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>image_features (<code>torch.FloatTensor</code> of shape <code>(batch_size, output_dim</code>)</p>
`}}),le=new at({props:{anchor:"transformers.ChineseCLIPModel.get_image_features.example",$$slots:{default:[hs]},$$scope:{ctx:v}}}),Qe=new R({props:{title:"ChineseCLIPTextModel",local:"transformers.ChineseCLIPTextModel",headingTag:"h2"}}),Ae=new w({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/main/en/model_doc/chinese_clip#transformers.ChineseCLIPTextModel">ChineseCLIPTextModel</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.ChineseCLIPTextModel.add_pooling_layer",description:`<strong>add_pooling_layer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a pooling layer`,name:"add_pooling_layer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1004"}}),Ye=new w({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.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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.Tensor</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.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.ChineseCLIPTextModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.ChineseCLIPTextModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</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.ChineseCLIPTextModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.Tensor</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.Tensor</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>List[torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>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>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>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>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"},{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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1055",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/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>Cache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache"
>Cache</a> instance. For more details, see our <a
  href="https://huggingface.co/docs/transformers/en/kv_cache"
  rel="nofollow"
>kv cache guide</a>.</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new Cn({props:{$$slots:{default:[gs]},$$scope:{ctx:v}}}),Ke=new R({props:{title:"ChineseCLIPVisionModel",local:"transformers.ChineseCLIPVisionModel",headingTag:"h2"}}),et=new w({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/main/en/model_doc/chinese_clip#transformers.ChineseCLIPVisionConfig">ChineseCLIPVisionConfig</a>) &#x2014;
Model configuration class with all the parameters of the model. Initializing with a config file does not
load the weights associated with the model, only the configuration. Check out the
<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1167"}}),tt=new w({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:"interpolate_pos_encoding",val:": bool = False"},{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, image_size, image_size)</code>, <em>optional</em>) &#x2014;
The tensors corresponding to the input images. Pixel values can be obtained using
<code>{image_processor_class}</code>. See <code>{image_processor_class}.__call__</code> for details (<code>{processor_class}</code> uses
<code>{image_processor_class}</code> for processing images).`,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.interpolate_pos_encoding",description:`<strong>interpolate_pos_encoding</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to interpolate the pre-trained position encodings.`,name:"interpolate_pos_encoding"},{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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py#L1186",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/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>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),de=new Cn({props:{$$slots:{default:[fs]},$$scope:{ctx:v}}}),me=new at({props:{anchor:"transformers.ChineseCLIPVisionModel.forward.example",$$slots:{default:[us]},$$scope:{ctx:v}}}),ot=new rs({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/chinese_clip.md"}}),{c(){r=c("meta"),y=s(),p=c("p"),m=s(),h(I.$$.fragment),t=s(),b=c("div"),b.innerHTML=Tn,Rt=s(),h(fe.$$.fragment),Vt=s(),ue=c("p"),ue.innerHTML=In,Et=s(),_e=c("p"),_e.textContent=bn,qt=s(),Ce=c("p"),Ce.innerHTML=yn,Bt=s(),Te=c("p"),Te.innerHTML=Mn,St=s(),h(Ie.$$.fragment),Dt=s(),be=c("p"),be.textContent=vn,Gt=s(),h(ye.$$.fragment),Xt=s(),Me=c("p"),Me.textContent=Pn,Ot=s(),ve=c("ul"),ve.innerHTML=wn,Ht=s(),h(Pe.$$.fragment),Qt=s(),x=c("div"),h(we.$$.fragment),Mo=s(),rt=c("p"),rt.innerHTML=Ln,vo=s(),it=c("p"),it.innerHTML=xn,Po=s(),h(Q.$$.fragment),wo=s(),A=c("div"),h(Le.$$.fragment),Lo=s(),lt=c("p"),lt.innerHTML=$n,At=s(),h(xe.$$.fragment),Yt=s(),U=c("div"),h($e.$$.fragment),xo=s(),ct=c("p"),ct.innerHTML=jn,$o=s(),dt=c("p"),dt.innerHTML=zn,jo=s(),h(Y.$$.fragment),Kt=s(),h(je.$$.fragment),eo=s(),N=c("div"),h(ze.$$.fragment),zo=s(),mt=c("p"),mt.innerHTML=kn,ko=s(),pt=c("p"),pt.innerHTML=Jn,Jo=s(),h(K.$$.fragment),to=s(),h(ke.$$.fragment),oo=s(),q=c("div"),h(Je.$$.fragment),Uo=s(),ht=c("p"),ht.textContent=Un,No=s(),ee=c("div"),h(Ue.$$.fragment),Fo=s(),gt=c("p"),gt.textContent=Nn,no=s(),h(Ne.$$.fragment),so=s(),$=c("div"),h(Fe.$$.fragment),Wo=s(),ft=c("p"),ft.textContent=Fn,Zo=s(),ut=c("p"),ut.innerHTML=Wn,Ro=s(),_t=c("ul"),_t.innerHTML=Zn,Vo=s(),Ct=c("div"),h(We.$$.fragment),ao=s(),h(Ze.$$.fragment),ro=s(),Re=c("div"),h(Ve.$$.fragment),io=s(),h(Ee.$$.fragment),lo=s(),j=c("div"),h(qe.$$.fragment),Eo=s(),Tt=c("p"),Tt.textContent=Rn,qo=s(),It=c("p"),It.innerHTML=Vn,Bo=s(),te=c("div"),h(Be.$$.fragment),So=s(),bt=c("p"),bt.innerHTML=En,Do=s(),oe=c("div"),h(Se.$$.fragment),Go=s(),yt=c("p"),yt.innerHTML=qn,co=s(),h(De.$$.fragment),mo=s(),L=c("div"),h(Ge.$$.fragment),Xo=s(),Mt=c("p"),Mt.textContent=Bn,Oo=s(),vt=c("p"),vt.innerHTML=Sn,Ho=s(),Pt=c("p"),Pt.innerHTML=Dn,Qo=s(),V=c("div"),h(Xe.$$.fragment),Ao=s(),wt=c("p"),wt.innerHTML=Gn,Yo=s(),h(ne.$$.fragment),Ko=s(),h(se.$$.fragment),en=s(),ae=c("div"),h(Oe.$$.fragment),tn=s(),h(re.$$.fragment),on=s(),ie=c("div"),h(He.$$.fragment),nn=s(),h(le.$$.fragment),po=s(),h(Qe.$$.fragment),ho=s(),z=c("div"),h(Ae.$$.fragment),sn=s(),Lt=c("p"),Lt.textContent=Xn,an=s(),xt=c("p"),xt.innerHTML=On,rn=s(),$t=c("p"),$t.innerHTML=Hn,ln=s(),D=c("div"),h(Ye.$$.fragment),cn=s(),jt=c("p"),jt.innerHTML=Qn,dn=s(),h(ce.$$.fragment),go=s(),h(Ke.$$.fragment),fo=s(),k=c("div"),h(et.$$.fragment),mn=s(),zt=c("p"),zt.textContent=An,pn=s(),kt=c("p"),kt.innerHTML=Yn,hn=s(),Jt=c("p"),Jt.innerHTML=Kn,gn=s(),E=c("div"),h(tt.$$.fragment),fn=s(),Ut=c("p"),Ut.innerHTML=es,un=s(),h(de.$$.fragment),_n=s(),h(me.$$.fragment),uo=s(),h(ot.$$.fragment),_o=s(),Ft=c("p"),this.h()},l(e){const n=as("svelte-u9bgzb",document.head);r=d(n,"META",{name:!0,content:!0}),n.forEach(o),y=a(e),p=d(e,"P",{}),P(p).forEach(o),m=a(e),g(I.$$.fragment,e),t=a(e),b=d(e,"DIV",{class:!0,"data-svelte-h":!0}),T(b)!=="svelte-13t8s2t"&&(b.innerHTML=Tn),Rt=a(e),g(fe.$$.fragment,e),Vt=a(e),ue=d(e,"P",{"data-svelte-h":!0}),T(ue)!=="svelte-m8ac9v"&&(ue.innerHTML=In),Et=a(e),_e=d(e,"P",{"data-svelte-h":!0}),T(_e)!=="svelte-vfdo9a"&&(_e.textContent=bn),qt=a(e),Ce=d(e,"P",{"data-svelte-h":!0}),T(Ce)!=="svelte-22isf2"&&(Ce.innerHTML=yn),Bt=a(e),Te=d(e,"P",{"data-svelte-h":!0}),T(Te)!=="svelte-1j3nw1m"&&(Te.innerHTML=Mn),St=a(e),g(Ie.$$.fragment,e),Dt=a(e),be=d(e,"P",{"data-svelte-h":!0}),T(be)!=="svelte-1wttker"&&(be.textContent=vn),Gt=a(e),g(ye.$$.fragment,e),Xt=a(e),Me=d(e,"P",{"data-svelte-h":!0}),T(Me)!=="svelte-1a80ehl"&&(Me.textContent=Pn),Ot=a(e),ve=d(e,"UL",{"data-svelte-h":!0}),T(ve)!=="svelte-14rhxk4"&&(ve.innerHTML=wn),Ht=a(e),g(Pe.$$.fragment,e),Qt=a(e),x=d(e,"DIV",{class:!0});var F=P(x);g(we.$$.fragment,F),Mo=a(F),rt=d(F,"P",{"data-svelte-h":!0}),T(rt)!=="svelte-3wpxrs"&&(rt.innerHTML=Ln),vo=a(F),it=d(F,"P",{"data-svelte-h":!0}),T(it)!=="svelte-o55m63"&&(it.innerHTML=xn),Po=a(F),g(Q.$$.fragment,F),wo=a(F),A=d(F,"DIV",{class:!0});var nt=P(A);g(Le.$$.fragment,nt),Lo=a(nt),lt=d(nt,"P",{"data-svelte-h":!0}),T(lt)!=="svelte-1s6o7qn"&&(lt.innerHTML=$n),nt.forEach(o),F.forEach(o),At=a(e),g(xe.$$.fragment,e),Yt=a(e),U=d(e,"DIV",{class:!0});var B=P(U);g($e.$$.fragment,B),xo=a(B),ct=d(B,"P",{"data-svelte-h":!0}),T(ct)!=="svelte-f8571t"&&(ct.innerHTML=jn),$o=a(B),dt=d(B,"P",{"data-svelte-h":!0}),T(dt)!=="svelte-o55m63"&&(dt.innerHTML=zn),jo=a(B),g(Y.$$.fragment,B),B.forEach(o),Kt=a(e),g(je.$$.fragment,e),eo=a(e),N=d(e,"DIV",{class:!0});var S=P(N);g(ze.$$.fragment,S),zo=a(S),mt=d(S,"P",{"data-svelte-h":!0}),T(mt)!=="svelte-1cwq12x"&&(mt.innerHTML=kn),ko=a(S),pt=d(S,"P",{"data-svelte-h":!0}),T(pt)!=="svelte-o55m63"&&(pt.innerHTML=Jn),Jo=a(S),g(K.$$.fragment,S),S.forEach(o),to=a(e),g(ke.$$.fragment,e),oo=a(e),q=d(e,"DIV",{class:!0});var H=P(q);g(Je.$$.fragment,H),Uo=a(H),ht=d(H,"P",{"data-svelte-h":!0}),T(ht)!=="svelte-13f40b0"&&(ht.textContent=Un),No=a(H),ee=d(H,"DIV",{class:!0});var st=P(ee);g(Ue.$$.fragment,st),Fo=a(st),gt=d(st,"P",{"data-svelte-h":!0}),T(gt)!=="svelte-1x3yxsa"&&(gt.textContent=Nn),st.forEach(o),H.forEach(o),no=a(e),g(Ne.$$.fragment,e),so=a(e),$=d(e,"DIV",{class:!0});var W=P($);g(Fe.$$.fragment,W),Wo=a(W),ft=d(W,"P",{"data-svelte-h":!0}),T(ft)!=="svelte-vp3m5t"&&(ft.textContent=Fn),Zo=a(W),ut=d(W,"P",{"data-svelte-h":!0}),T(ut)!=="svelte-7883m0"&&(ut.innerHTML=Wn),Ro=a(W),_t=d(W,"UL",{"data-svelte-h":!0}),T(_t)!=="svelte-1qslv4f"&&(_t.innerHTML=Zn),Vo=a(W),Ct=d(W,"DIV",{class:!0});var Wt=P(Ct);g(We.$$.fragment,Wt),Wt.forEach(o),W.forEach(o),ao=a(e),g(Ze.$$.fragment,e),ro=a(e),Re=d(e,"DIV",{class:!0});var Zt=P(Re);g(Ve.$$.fragment,Zt),Zt.forEach(o),io=a(e),g(Ee.$$.fragment,e),lo=a(e),j=d(e,"DIV",{class:!0});var Z=P(j);g(qe.$$.fragment,Z),Eo=a(Z),Tt=d(Z,"P",{"data-svelte-h":!0}),T(Tt)!=="svelte-1qx1ch7"&&(Tt.textContent=Rn),qo=a(Z),It=d(Z,"P",{"data-svelte-h":!0}),T(It)!=="svelte-18h9lnq"&&(It.innerHTML=Vn),Bo=a(Z),te=d(Z,"DIV",{class:!0});var To=P(te);g(Be.$$.fragment,To),So=a(To),bt=d(To,"P",{"data-svelte-h":!0}),T(bt)!=="svelte-1ca4llu"&&(bt.innerHTML=En),To.forEach(o),Do=a(Z),oe=d(Z,"DIV",{class:!0});var Io=P(oe);g(Se.$$.fragment,Io),Go=a(Io),yt=d(Io,"P",{"data-svelte-h":!0}),T(yt)!=="svelte-1hyadk"&&(yt.innerHTML=qn),Io.forEach(o),Z.forEach(o),co=a(e),g(De.$$.fragment,e),mo=a(e),L=d(e,"DIV",{class:!0});var J=P(L);g(Ge.$$.fragment,J),Xo=a(J),Mt=d(J,"P",{"data-svelte-h":!0}),T(Mt)!=="svelte-1hpzgxz"&&(Mt.textContent=Bn),Oo=a(J),vt=d(J,"P",{"data-svelte-h":!0}),T(vt)!=="svelte-6pahdo"&&(vt.innerHTML=Sn),Ho=a(J),Pt=d(J,"P",{"data-svelte-h":!0}),T(Pt)!=="svelte-hswkmf"&&(Pt.innerHTML=Dn),Qo=a(J),V=d(J,"DIV",{class:!0});var pe=P(V);g(Xe.$$.fragment,pe),Ao=a(pe),wt=d(pe,"P",{"data-svelte-h":!0}),T(wt)!=="svelte-7qjxlh"&&(wt.innerHTML=Gn),Yo=a(pe),g(ne.$$.fragment,pe),Ko=a(pe),g(se.$$.fragment,pe),pe.forEach(o),en=a(J),ae=d(J,"DIV",{class:!0});var bo=P(ae);g(Oe.$$.fragment,bo),tn=a(bo),g(re.$$.fragment,bo),bo.forEach(o),on=a(J),ie=d(J,"DIV",{class:!0});var yo=P(ie);g(He.$$.fragment,yo),nn=a(yo),g(le.$$.fragment,yo),yo.forEach(o),J.forEach(o),po=a(e),g(Qe.$$.fragment,e),ho=a(e),z=d(e,"DIV",{class:!0});var G=P(z);g(Ae.$$.fragment,G),sn=a(G),Lt=d(G,"P",{"data-svelte-h":!0}),T(Lt)!=="svelte-1n3o92t"&&(Lt.textContent=Xn),an=a(G),xt=d(G,"P",{"data-svelte-h":!0}),T(xt)!=="svelte-6pahdo"&&(xt.innerHTML=On),rn=a(G),$t=d(G,"P",{"data-svelte-h":!0}),T($t)!=="svelte-hswkmf"&&($t.innerHTML=Hn),ln=a(G),D=d(G,"DIV",{class:!0});var Nt=P(D);g(Ye.$$.fragment,Nt),cn=a(Nt),jt=d(Nt,"P",{"data-svelte-h":!0}),T(jt)!=="svelte-19vc327"&&(jt.innerHTML=Qn),dn=a(Nt),g(ce.$$.fragment,Nt),Nt.forEach(o),G.forEach(o),go=a(e),g(Ke.$$.fragment,e),fo=a(e),k=d(e,"DIV",{class:!0});var X=P(k);g(et.$$.fragment,X),mn=a(X),zt=d(X,"P",{"data-svelte-h":!0}),T(zt)!=="svelte-u2fv6w"&&(zt.textContent=An),pn=a(X),kt=d(X,"P",{"data-svelte-h":!0}),T(kt)!=="svelte-6pahdo"&&(kt.innerHTML=Yn),hn=a(X),Jt=d(X,"P",{"data-svelte-h":!0}),T(Jt)!=="svelte-hswkmf"&&(Jt.innerHTML=Kn),gn=a(X),E=d(X,"DIV",{class:!0});var he=P(E);g(tt.$$.fragment,he),fn=a(he),Ut=d(he,"P",{"data-svelte-h":!0}),T(Ut)!=="svelte-18dl0o5"&&(Ut.innerHTML=es),un=a(he),g(de.$$.fragment,he),_n=a(he),g(me.$$.fragment,he),he.forEach(o),X.forEach(o),uo=a(e),g(ot.$$.fragment,e),_o=a(e),Ft=d(e,"P",{}),P(Ft).forEach(o),this.h()},h(){M(r,"name","hf:doc:metadata"),M(r,"content",Cs),M(b,"class","flex flex-wrap space-x-1"),M(A,"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(U,"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(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Ct,"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(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(oe,"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(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(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ie,"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(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(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(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(e,n){i(document.head,r),l(e,y,n),l(e,p,n),l(e,m,n),f(I,e,n),l(e,t,n),l(e,b,n),l(e,Rt,n),f(fe,e,n),l(e,Vt,n),l(e,ue,n),l(e,Et,n),l(e,_e,n),l(e,qt,n),l(e,Ce,n),l(e,Bt,n),l(e,Te,n),l(e,St,n),f(Ie,e,n),l(e,Dt,n),l(e,be,n),l(e,Gt,n),f(ye,e,n),l(e,Xt,n),l(e,Me,n),l(e,Ot,n),l(e,ve,n),l(e,Ht,n),f(Pe,e,n),l(e,Qt,n),l(e,x,n),f(we,x,null),i(x,Mo),i(x,rt),i(x,vo),i(x,it),i(x,Po),f(Q,x,null),i(x,wo),i(x,A),f(Le,A,null),i(A,Lo),i(A,lt),l(e,At,n),f(xe,e,n),l(e,Yt,n),l(e,U,n),f($e,U,null),i(U,xo),i(U,ct),i(U,$o),i(U,dt),i(U,jo),f(Y,U,null),l(e,Kt,n),f(je,e,n),l(e,eo,n),l(e,N,n),f(ze,N,null),i(N,zo),i(N,mt),i(N,ko),i(N,pt),i(N,Jo),f(K,N,null),l(e,to,n),f(ke,e,n),l(e,oo,n),l(e,q,n),f(Je,q,null),i(q,Uo),i(q,ht),i(q,No),i(q,ee),f(Ue,ee,null),i(ee,Fo),i(ee,gt),l(e,no,n),f(Ne,e,n),l(e,so,n),l(e,$,n),f(Fe,$,null),i($,Wo),i($,ft),i($,Zo),i($,ut),i($,Ro),i($,_t),i($,Vo),i($,Ct),f(We,Ct,null),l(e,ao,n),f(Ze,e,n),l(e,ro,n),l(e,Re,n),f(Ve,Re,null),l(e,io,n),f(Ee,e,n),l(e,lo,n),l(e,j,n),f(qe,j,null),i(j,Eo),i(j,Tt),i(j,qo),i(j,It),i(j,Bo),i(j,te),f(Be,te,null),i(te,So),i(te,bt),i(j,Do),i(j,oe),f(Se,oe,null),i(oe,Go),i(oe,yt),l(e,co,n),f(De,e,n),l(e,mo,n),l(e,L,n),f(Ge,L,null),i(L,Xo),i(L,Mt),i(L,Oo),i(L,vt),i(L,Ho),i(L,Pt),i(L,Qo),i(L,V),f(Xe,V,null),i(V,Ao),i(V,wt),i(V,Yo),f(ne,V,null),i(V,Ko),f(se,V,null),i(L,en),i(L,ae),f(Oe,ae,null),i(ae,tn),f(re,ae,null),i(L,on),i(L,ie),f(He,ie,null),i(ie,nn),f(le,ie,null),l(e,po,n),f(Qe,e,n),l(e,ho,n),l(e,z,n),f(Ae,z,null),i(z,sn),i(z,Lt),i(z,an),i(z,xt),i(z,rn),i(z,$t),i(z,ln),i(z,D),f(Ye,D,null),i(D,cn),i(D,jt),i(D,dn),f(ce,D,null),l(e,go,n),f(Ke,e,n),l(e,fo,n),l(e,k,n),f(et,k,null),i(k,mn),i(k,zt),i(k,pn),i(k,kt),i(k,hn),i(k,Jt),i(k,gn),i(k,E),f(tt,E,null),i(E,fn),i(E,Ut),i(E,un),f(de,E,null),i(E,_n),f(me,E,null),l(e,uo,n),f(ot,e,n),l(e,_o,n),l(e,Ft,n),Co=!0},p(e,[n]){const F={};n&2&&(F.$$scope={dirty:n,ctx:e}),Q.$set(F);const nt={};n&2&&(nt.$$scope={dirty:n,ctx:e}),Y.$set(nt);const B={};n&2&&(B.$$scope={dirty:n,ctx:e}),K.$set(B);const S={};n&2&&(S.$$scope={dirty:n,ctx:e}),ne.$set(S);const H={};n&2&&(H.$$scope={dirty:n,ctx:e}),se.$set(H);const st={};n&2&&(st.$$scope={dirty:n,ctx:e}),re.$set(st);const W={};n&2&&(W.$$scope={dirty:n,ctx:e}),le.$set(W);const Wt={};n&2&&(Wt.$$scope={dirty:n,ctx:e}),ce.$set(Wt);const Zt={};n&2&&(Zt.$$scope={dirty:n,ctx:e}),de.$set(Zt);const Z={};n&2&&(Z.$$scope={dirty:n,ctx:e}),me.$set(Z)},i(e){Co||(u(I.$$.fragment,e),u(fe.$$.fragment,e),u(Ie.$$.fragment,e),u(ye.$$.fragment,e),u(Pe.$$.fragment,e),u(we.$$.fragment,e),u(Q.$$.fragment,e),u(Le.$$.fragment,e),u(xe.$$.fragment,e),u($e.$$.fragment,e),u(Y.$$.fragment,e),u(je.$$.fragment,e),u(ze.$$.fragment,e),u(K.$$.fragment,e),u(ke.$$.fragment,e),u(Je.$$.fragment,e),u(Ue.$$.fragment,e),u(Ne.$$.fragment,e),u(Fe.$$.fragment,e),u(We.$$.fragment,e),u(Ze.$$.fragment,e),u(Ve.$$.fragment,e),u(Ee.$$.fragment,e),u(qe.$$.fragment,e),u(Be.$$.fragment,e),u(Se.$$.fragment,e),u(De.$$.fragment,e),u(Ge.$$.fragment,e),u(Xe.$$.fragment,e),u(ne.$$.fragment,e),u(se.$$.fragment,e),u(Oe.$$.fragment,e),u(re.$$.fragment,e),u(He.$$.fragment,e),u(le.$$.fragment,e),u(Qe.$$.fragment,e),u(Ae.$$.fragment,e),u(Ye.$$.fragment,e),u(ce.$$.fragment,e),u(Ke.$$.fragment,e),u(et.$$.fragment,e),u(tt.$$.fragment,e),u(de.$$.fragment,e),u(me.$$.fragment,e),u(ot.$$.fragment,e),Co=!0)},o(e){_(I.$$.fragment,e),_(fe.$$.fragment,e),_(Ie.$$.fragment,e),_(ye.$$.fragment,e),_(Pe.$$.fragment,e),_(we.$$.fragment,e),_(Q.$$.fragment,e),_(Le.$$.fragment,e),_(xe.$$.fragment,e),_($e.$$.fragment,e),_(Y.$$.fragment,e),_(je.$$.fragment,e),_(ze.$$.fragment,e),_(K.$$.fragment,e),_(ke.$$.fragment,e),_(Je.$$.fragment,e),_(Ue.$$.fragment,e),_(Ne.$$.fragment,e),_(Fe.$$.fragment,e),_(We.$$.fragment,e),_(Ze.$$.fragment,e),_(Ve.$$.fragment,e),_(Ee.$$.fragment,e),_(qe.$$.fragment,e),_(Be.$$.fragment,e),_(Se.$$.fragment,e),_(De.$$.fragment,e),_(Ge.$$.fragment,e),_(Xe.$$.fragment,e),_(ne.$$.fragment,e),_(se.$$.fragment,e),_(Oe.$$.fragment,e),_(re.$$.fragment,e),_(He.$$.fragment,e),_(le.$$.fragment,e),_(Qe.$$.fragment,e),_(Ae.$$.fragment,e),_(Ye.$$.fragment,e),_(ce.$$.fragment,e),_(Ke.$$.fragment,e),_(et.$$.fragment,e),_(tt.$$.fragment,e),_(de.$$.fragment,e),_(me.$$.fragment,e),_(ot.$$.fragment,e),Co=!1},d(e){e&&(o(y),o(p),o(m),o(t),o(b),o(Rt),o(Vt),o(ue),o(Et),o(_e),o(qt),o(Ce),o(Bt),o(Te),o(St),o(Dt),o(be),o(Gt),o(Xt),o(Me),o(Ot),o(ve),o(Ht),o(Qt),o(x),o(At),o(Yt),o(U),o(Kt),o(eo),o(N),o(to),o(oo),o(q),o(no),o(so),o($),o(ao),o(ro),o(Re),o(io),o(lo),o(j),o(co),o(mo),o(L),o(po),o(ho),o(z),o(go),o(fo),o(k),o(uo),o(_o),o(Ft)),o(r),C(I,e),C(fe,e),C(Ie,e),C(ye,e),C(Pe,e),C(we),C(Q),C(Le),C(xe,e),C($e),C(Y),C(je,e),C(ze),C(K),C(ke,e),C(Je),C(Ue),C(Ne,e),C(Fe),C(We),C(Ze,e),C(Ve),C(Ee,e),C(qe),C(Be),C(Se),C(De,e),C(Ge),C(Xe),C(ne),C(se),C(Oe),C(re),C(He),C(le),C(Qe,e),C(Ae),C(Ye),C(ce),C(Ke,e),C(et),C(tt),C(de),C(me),C(ot,e)}}}const Cs='{"title":"Chinese-CLIP","local":"chinese-clip","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage example","local":"usage-example","sections":[],"depth":2},{"title":"ChineseCLIPConfig","local":"transformers.ChineseCLIPConfig","sections":[],"depth":2},{"title":"ChineseCLIPTextConfig","local":"transformers.ChineseCLIPTextConfig","sections":[],"depth":2},{"title":"ChineseCLIPVisionConfig","local":"transformers.ChineseCLIPVisionConfig","sections":[],"depth":2},{"title":"ChineseCLIPImageProcessor","local":"transformers.ChineseCLIPImageProcessor","sections":[],"depth":2},{"title":"ChineseCLIPImageProcessorFast","local":"transformers.ChineseCLIPImageProcessorFast","sections":[],"depth":2},{"title":"ChineseCLIPFeatureExtractor","local":"transformers.ChineseCLIPFeatureExtractor","sections":[],"depth":2},{"title":"ChineseCLIPProcessor","local":"transformers.ChineseCLIPProcessor","sections":[],"depth":2},{"title":"ChineseCLIPModel","local":"transformers.ChineseCLIPModel","sections":[],"depth":2},{"title":"ChineseCLIPTextModel","local":"transformers.ChineseCLIPTextModel","sections":[],"depth":2},{"title":"ChineseCLIPVisionModel","local":"transformers.ChineseCLIPVisionModel","sections":[],"depth":2}],"depth":1}';function Ts(v){return os(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xs extends ns{constructor(r){super(),ss(this,r,Ts,_s,ts,{})}}export{xs as component};
