import{S as Ni,i as Ri,s as Xi,e as a,k as p,w as M,t as s,M as Pi,c as r,d as o,m,a as l,x as v,h as n,b as d,N as Ai,G as e,g,y as w,q as T,o as J,B as j,v as qi,L as Ut}from"../../chunks/vendor-hf-doc-builder.js";import{T as gl}from"../../chunks/Tip-hf-doc-builder.js";import{D as Y}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ct}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as pe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as kt}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Si(I){let c,b,_,h,y;return h=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdpdFZpc2lvbkNvbmZpZyUyQyUyMEdpdFZpc2lvbk1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEdpdFZpc2lvbkNvbmZpZyUyMHdpdGglMjBtaWNyb3NvZnQlMkZnaXQtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBHaXRWaXNpb25Db25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBHaXRWaXNpb25Nb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwbWljcm9zb2Z0JTJGZ2l0LWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMEdpdFZpc2lvbk1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GitVisionConfig, GitVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GitVisionConfig with microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GitVisionConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GitVisionModel (with random weights) from the microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GitVisionModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){c=a("p"),b=s("Example:"),_=p(),M(h.$$.fragment)},l(i){c=r(i,"P",{});var f=l(c);b=n(f,"Example:"),f.forEach(o),_=m(i),v(h.$$.fragment,i)},m(i,f){g(i,c,f),e(c,b),g(i,_,f),w(h,i,f),y=!0},p:Ut,i(i){y||(T(h.$$.fragment,i),y=!0)},o(i){J(h.$$.fragment,i),y=!1},d(i){i&&o(c),i&&o(_),j(h,i)}}}function Yi(I){let c,b,_,h,y;return{c(){c=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),y=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var f=l(c);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var E=l(_);h=n(E,"Module"),E.forEach(o),y=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(i,f){g(i,c,f),e(c,b),e(c,_),e(_,h),e(c,y)},d(i){i&&o(c)}}}function Li(I){let c,b,_,h,y;return h=new Ct({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Byb2Nlc3NvciUyQyUyMEdpdFZpc2lvbk1vZGVsJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGZ2l0LWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBHaXRWaXNpb25Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGZ2l0LWJhc2UlMjIpJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQSUwQWlucHV0cyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxhc3RfaGlkZGVuX3N0YXRlJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",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, GitVisionModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GitVisionModel.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_state = outputs.last_hidden_state`}}),{c(){c=a("p"),b=s("Examples:"),_=p(),M(h.$$.fragment)},l(i){c=r(i,"P",{});var f=l(c);b=n(f,"Examples:"),f.forEach(o),_=m(i),v(h.$$.fragment,i)},m(i,f){g(i,c,f),e(c,b),g(i,_,f),w(h,i,f),y=!0},p:Ut,i(i){y||(T(h.$$.fragment,i),y=!0)},o(i){J(h.$$.fragment,i),y=!1},d(i){i&&o(c),i&&o(_),j(h,i)}}}function Qi(I){let c,b,_,h,y;return h=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEdpdENvbmZpZyUyQyUyMEdpdE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEdJVCUyMG1pY3Jvc29mdCUyRmdpdC1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEdpdENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwKHdpdGglMjByYW5kb20lMjB3ZWlnaHRzKSUyMGZyb20lMjB0aGUlMjBtaWNyb3NvZnQlMkZnaXQtYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwR2l0TW9kZWwoY29uZmlndXJhdGlvbiklMEElMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GitConfig, GitModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GIT microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GitConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the microsoft/git-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GitModel(configuration)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;this is an image of two cats&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(text, 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`}}),{c(){c=a("p"),b=s("Examples:"),_=p(),M(h.$$.fragment)},l(i){c=r(i,"P",{});var f=l(c);b=n(f,"Examples:"),f.forEach(o),_=m(i),v(h.$$.fragment,i)},m(i,f){g(i,c,f),e(c,b),g(i,_,f),w(h,i,f),y=!0},p:Ut,i(i){y||(T(h.$$.fragment,i),y=!0)},o(i){J(h.$$.fragment,i),y=!1},d(i){i&&o(c),i&&o(_),j(h,i)}}}function Oi(I){let c,b,_,h,y;return{c(){c=a("p"),b=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),h=s("Module"),y=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(i){c=r(i,"P",{});var f=l(c);b=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var E=l(_);h=n(E,"Module"),E.forEach(o),y=n(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(i,f){g(i,c,f),e(c,b),e(c,_),e(_,h),e(c,y)},d(i){i&&o(c)}}}function Ki(I){let c,b,_,h,y;return h=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGZ2l0LWJhc2UtY29jbyUyMiklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZnaXQtYmFzZS1jb2NvJTIyKSUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHAlM0ElMkYlMkZpbWFnZXMuY29jb2RhdGFzZXQub3JnJTJGdmFsMjAxNyUyRjAwMDAwMDAzOTc2OS5qcGclMjIlMEFpbWFnZSUyMCUzRCUyMEltYWdlLm9wZW4ocmVxdWVzdHMuZ2V0KHVybCUyQyUyMHN0cmVhbSUzRFRydWUpLnJhdyklMEElMEFwaXhlbF92YWx1ZXMlMjAlM0QlMjBwcm9jZXNzb3IoaW1hZ2VzJTNEaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKS5waXhlbF92YWx1ZXMlMEElMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUocGl4ZWxfdmFsdWVzJTNEcGl4ZWxfdmFsdWVzJTJDJTIwbWF4X2xlbmd0aCUzRDUwKSUwQWdlbmVyYXRlZF9jYXB0aW9uJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShnZW5lcmF0ZWRfaWRzJTJDJTIwc2tpcF9zcGVjaWFsX3Rva2VucyUzRFRydWUpJTVCMCU1RCUwQXByaW50KGdlbmVyYXRlZF9jYXB0aW9uKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM
<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> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-coco&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-coco&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, max_length=<span class="hljs-number">50</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(generated_caption)
two cats sleeping on a pink blanket <span class="hljs-built_in">next</span> to remotes.`}}),{c(){c=a("p"),b=s("Image captioning example:"),_=p(),M(h.$$.fragment)},l(i){c=r(i,"P",{});var f=l(c);b=n(f,"Image captioning example:"),f.forEach(o),_=m(i),v(h.$$.fragment,i)},m(i,f){g(i,c,f),e(c,b),g(i,_,f),w(h,i,f),y=!0},p:Ut,i(i){y||(T(h.$$.fragment,i),y=!0)},o(i){J(h.$$.fragment,i),y=!1},d(i){i&&o(c),i&&o(_),j(h,i)}}}function ed(I){let c,b,_,h,y;return h=new Ct({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTSUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBoZl9odWJfZG93bmxvYWQlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZnaXQtYmFzZS10ZXh0dnFhJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRmdpdC1iYXNlLXRleHR2cWElMjIpJTBBJTBBZmlsZV9wYXRoJTIwJTNEJTIwaGZfaHViX2Rvd25sb2FkKHJlcG9faWQlM0QlMjJuaWVsc3IlMkZ0ZXh0dnFhLXNhbXBsZSUyMiUyQyUyMGZpbGVuYW1lJTNEJTIyYnVzLnBuZyUyMiUyQyUyMHJlcG9fdHlwZSUzRCUyMmRhdGFzZXQlMjIpJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKGZpbGVfcGF0aCkuY29udmVydCglMjJSR0IlMjIpJTBBJTBBcGl4ZWxfdmFsdWVzJTIwJTNEJTIwcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMikucGl4ZWxfdmFsdWVzJTBBJTBBcXVlc3Rpb24lMjAlM0QlMjAlMjJ3aGF0JTIwZG9lcyUyMHRoZSUyMGZyb250JTIwb2YlMjB0aGUlMjBidXMlMjBzYXklMjBhdCUyMHRoZSUyMHRvcCUzRiUyMiUwQSUwQWlucHV0X2lkcyUyMCUzRCUyMHByb2Nlc3Nvcih0ZXh0JTNEcXVlc3Rpb24lMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSkuaW5wdXRfaWRzJTBBaW5wdXRfaWRzJTIwJTNEJTIwJTVCcHJvY2Vzc29yLnRva2VuaXplci5jbHNfdG9rZW5faWQlNUQlMjAlMkIlMjBpbnB1dF9pZHMlMEFpbnB1dF9pZHMlMjAlM0QlMjB0b3JjaC50ZW5zb3IoaW5wdXRfaWRzKS51bnNxdWVlemUoMCklMEElMEFnZW5lcmF0ZWRfaWRzJTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUocGl4ZWxfdmFsdWVzJTNEcGl4ZWxfdmFsdWVzJTJDJTIwaW5wdXRfaWRzJTNEaW5wdXRfaWRzJTJDJTIwbWF4X2xlbmd0aCUzRDUwKSUwQXByaW50KHByb2Nlc3Nvci5iYXRjaF9kZWNvZGUoZ2VuZXJhdGVkX2lkcyUyQyUyMHNraXBfc3BlY2lhbF90b2tlbnMlM0RUcnVlKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<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>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-textvqa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-textvqa&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(repo_id=<span class="hljs-string">&quot;nielsr/textvqa-sample&quot;</span>, filename=<span class="hljs-string">&quot;bus.png&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(file_path).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>question = <span class="hljs-string">&quot;what does the front of the bus say at the top?&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = processor(text=question, add_special_tokens=<span class="hljs-literal">False</span>).input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = [processor.tokenizer.cls_token_id] + input_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(input_ids).unsqueeze(<span class="hljs-number">0</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, input_ids=input_ids, max_length=<span class="hljs-number">50</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>))
[<span class="hljs-string">&#x27;what does the front of the bus say at the top? special&#x27;</span>]`}}),{c(){c=a("p"),b=s("Visual question answering (VQA) example:"),_=p(),M(h.$$.fragment)},l(i){c=r(i,"P",{});var f=l(c);b=n(f,"Visual question answering (VQA) example:"),f.forEach(o),_=m(i),v(h.$$.fragment,i)},m(i,f){g(i,c,f),e(c,b),g(i,_,f),w(h,i,f),y=!0},p:Ut,i(i){y||(T(h.$$.fragment,i),y=!0)},o(i){J(h.$$.fragment,i),y=!1},d(i){i&&o(c),i&&o(_),j(h,i)}}}function td(I){let c,b,_,h,y;return h=new Ct({props:{code:" ",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> av
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<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">from</span> huggingface_hub <span class="hljs-keyword">import</span> hf_hub_download
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-vatex&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;microsoft/git-base-vatex&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># set seed for reproducability</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>np.random.seed(<span class="hljs-number">45</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">read_video_pyav</span>(<span class="hljs-params">container, indices</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Decode the video with PyAV decoder.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        container (\`av.container.input.InputContainer\`): PyAV container.
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of frame indices to decode.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        result (np.ndarray): np array of decoded frames of shape (num_frames, height, width, 3).
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</span>
<span class="hljs-meta">... </span>    frames = []
<span class="hljs-meta">... </span>    container.seek(<span class="hljs-number">0</span>)
<span class="hljs-meta">... </span>    start_index = indices[<span class="hljs-number">0</span>]
<span class="hljs-meta">... </span>    end_index = indices[-<span class="hljs-number">1</span>]
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> i, frame <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(container.decode(video=<span class="hljs-number">0</span>)):
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt; end_index:
<span class="hljs-meta">... </span>            <span class="hljs-keyword">break</span>
<span class="hljs-meta">... </span>        <span class="hljs-keyword">if</span> i &gt;= start_index <span class="hljs-keyword">and</span> i <span class="hljs-keyword">in</span> indices:
<span class="hljs-meta">... </span>            frames.append(frame)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> np.stack([x.to_ndarray(<span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;rgb24&quot;</span>) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> frames])


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">sample_frame_indices</span>(<span class="hljs-params">clip_len, frame_sample_rate, seg_len</span>):
<span class="hljs-meta">... </span>    <span class="hljs-string">&#x27;&#x27;&#x27;
<span class="hljs-meta">... </span>    Sample a given number of frame indices from the video.
<span class="hljs-meta">... </span>    Args:
<span class="hljs-meta">... </span>        clip_len (\`int\`): Total number of frames to sample.
<span class="hljs-meta">... </span>        frame_sample_rate (\`int\`): Sample every n-th frame.
<span class="hljs-meta">... </span>        seg_len (\`int\`): Maximum allowed index of sample&#x27;s last frame.
<span class="hljs-meta">... </span>    Returns:
<span class="hljs-meta">... </span>        indices (\`List[int]\`): List of sampled frame indices
<span class="hljs-meta">... </span>    &#x27;&#x27;&#x27;</span>
<span class="hljs-meta">... </span>    converted_len = <span class="hljs-built_in">int</span>(clip_len * frame_sample_rate)
<span class="hljs-meta">... </span>    end_idx = np.random.randint(converted_len, seg_len)
<span class="hljs-meta">... </span>    start_idx = end_idx - converted_len
<span class="hljs-meta">... </span>    indices = np.linspace(start_idx, end_idx, num=clip_len)
<span class="hljs-meta">... </span>    indices = np.clip(indices, start_idx, end_idx - <span class="hljs-number">1</span>).astype(np.int64)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> indices


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load video</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>file_path = hf_hub_download(
<span class="hljs-meta">... </span>    repo_id=<span class="hljs-string">&quot;nielsr/video-demo&quot;</span>, filename=<span class="hljs-string">&quot;eating_spaghetti.mp4&quot;</span>, repo_type=<span class="hljs-string">&quot;dataset&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>container = av.<span class="hljs-built_in">open</span>(file_path)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># sample frames</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_frames = model.config.num_image_with_embedding
<span class="hljs-meta">&gt;&gt;&gt; </span>indices = sample_frame_indices(
<span class="hljs-meta">... </span>    clip_len=num_frames, frame_sample_rate=<span class="hljs-number">4</span>, seg_len=container.streams.video[<span class="hljs-number">0</span>].frames
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>frames = read_video_pyav(container, indices)

<span class="hljs-meta">&gt;&gt;&gt; </span>pixel_values = processor(images=<span class="hljs-built_in">list</span>(frames), return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).pixel_values

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_ids = model.generate(pixel_values=pixel_values, max_length=<span class="hljs-number">50</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Generated caption:&quot;</span>, processor.batch_decode(generated_ids, skip_special_tokens=<span class="hljs-literal">True</span>))
Generated caption: [<span class="hljs-string">&#x27;a woman is sitting at a table and she is talking about the food she is holding.&#x27;</span>]`}}),{c(){c=a("p"),b=s("Video captioning example:"),_=p(),M(h.$$.fragment)},l(i){c=r(i,"P",{});var f=l(c);b=n(f,"Video captioning example:"),f.forEach(o),_=m(i),v(h.$$.fragment,i)},m(i,f){g(i,c,f),e(c,b),g(i,_,f),w(h,i,f),y=!0},p:Ut,i(i){y||(T(h.$$.fragment,i),y=!0)},o(i){J(h.$$.fragment,i),y=!1},d(i){i&&o(c),i&&o(_),j(h,i)}}}function od(I){let c,b,_,h,y,i,f,E,Qs,ss,L,me,po,Ne,Hs,mo,Ds,ns,X,Os,Re,Ks,en,Zt,tn,on,as,$t,sn,rs,Et,ho,nn,ls,Wt,an,is,he,Xe,rn,uo,ln,dn,cn,Q,pn,xt,mn,hn,fo,un,fn,ds,ue,_l,cs,fe,gn,Pe,_n,yn,ps,P,bn,Ae,Mn,vn,qe,wn,Tn,ms,H,ge,go,Se,Jn,_o,jn,hs,Bt,Gn,us,_e,Ye,In,Le,kn,Un,Cn,zt,Zn,Vt,$n,fs,Ft,En,gs,D,ye,yo,Qe,Wn,bo,xn,_s,B,He,Bn,O,zn,Nt,Vn,Fn,De,Nn,Rn,Xn,K,Pn,Rt,An,qn,Xt,Sn,Yn,Ln,be,ys,ee,Me,Mo,Oe,Qn,vo,Hn,bs,C,Ke,Dn,wo,On,Kn,et,ea,Pt,ta,oa,sa,tt,na,ot,aa,ra,la,F,st,ia,te,da,At,ca,pa,To,ma,ha,ua,ve,fa,we,Ms,oe,Te,Jo,nt,ga,jo,_a,vs,z,at,ya,se,ba,qt,Ma,va,rt,wa,Ta,Ja,ne,ja,St,Ga,Ia,Yt,ka,Ua,Ca,Je,ws,ae,je,Go,lt,Za,Io,$a,Ts,V,it,Ea,ko,Wa,xa,W,Lt,Ba,za,Qt,Va,Fa,Ht,Na,Ra,dt,Uo,Xa,Pa,Aa,Co,qa,Sa,Ya,Ge,ct,La,G,Qa,Zo,Ha,Da,$o,Oa,Ka,pt,Eo,er,tr,or,Wo,sr,nr,xo,ar,rr,Bo,lr,ir,zo,dr,cr,mt,Vo,pr,mr,hr,Fo,ur,fr,No,gr,_r,Js,re,Ie,Ro,ht,yr,Xo,br,js,Z,ut,Mr,Po,vr,wr,ft,Tr,Dt,Jr,jr,Gr,gt,Ir,_t,kr,Ur,Cr,N,yt,Zr,le,$r,Ot,Er,Wr,Ao,xr,Br,zr,ke,Vr,Ue,Gs,ie,Ce,qo,bt,Fr,So,Nr,Is,$,Mt,Rr,vt,Xr,Yo,Pr,Ar,qr,wt,Sr,Kt,Yr,Lr,Qr,Tt,Hr,Jt,Dr,Or,Kr,U,jt,el,de,tl,eo,ol,sl,Lo,nl,al,rl,Ze,ll,Qo,il,dl,$e,cl,Ee,pl,We,ks;return i=new pe({}),Ne=new pe({}),Se=new pe({}),Qe=new pe({}),He=new Y({props:{name:"class transformers.GitVisionConfig",anchor:"transformers.GitVisionConfig",parameters:[{name:"hidden_size",val:" = 768"},{name:"intermediate_size",val:" = 3072"},{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:" = 16"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.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.GitVisionConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.GitVisionConfig.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.GitVisionConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GitVisionConfig.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.GitVisionConfig.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"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/configuration_git.py#L30"}}),be=new kt({props:{anchor:"transformers.GitVisionConfig.example",$$slots:{default:[Si]},$$scope:{ctx:I}}}),Oe=new pe({}),Ke=new Y({props:{name:"class transformers.GitVisionModel",anchor:"transformers.GitVisionModel",parameters:[{name:"config",val:": GitVisionConfig"}],parametersDescription:[{anchor:"transformers.GitVisionModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitConfig">GitConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/modeling_git.py#L995"}}),st=new Y({props:{name:"forward",anchor:"transformers.GitVisionModel.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GitVisionModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using
<a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitVisionModel.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.GitVisionModel.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.GitVisionModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/modeling_git.py#L1009",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.git.configuration_git.GitVisionConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutput"
>transformers.modeling_outputs.BaseModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new gl({props:{$$slots:{default:[Yi]},$$scope:{ctx:I}}}),we=new kt({props:{anchor:"transformers.GitVisionModel.forward.example",$$slots:{default:[Li]},$$scope:{ctx:I}}}),nt=new pe({}),at=new Y({props:{name:"class transformers.GitConfig",anchor:"transformers.GitConfig",parameters:[{name:"vision_config",val:" = None"},{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 6"},{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:" = 1024"},{name:"initializer_range",val:" = 0.02"},{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:"tie_word_embeddings",val:" = False"},{name:"bos_token_id",val:" = 101"},{name:"eos_token_id",val:" = 102"},{name:"num_image_with_embedding",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GitConfig.vision_config",description:`<strong>vision_config</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Dictionary of configuration options used to initialize <a href="/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitVisionConfig">GitVisionConfig</a>.`,name:"vision_config"},{anchor:"transformers.GitConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the GIT model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitModel">GitModel</a>.`,name:"vocab_size"},{anchor:"transformers.GitConfig.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.GitConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 6) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.GitConfig.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.GitConfig.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.GitConfig.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.GitConfig.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.GitConfig.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.GitConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#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.GitConfig.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.GitConfig.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.GitConfig.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.GitConfig.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).`,name:"use_cache"},{anchor:"transformers.GitConfig.num_image_with_embedding",description:`<strong>num_image_with_embedding</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of temporal embeddings to add, in case the model is used for video captioning/VQA.`,name:"num_image_with_embedding"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/configuration_git.py#L128"}}),Je=new kt({props:{anchor:"transformers.GitConfig.example",$$slots:{default:[Qi]},$$scope:{ctx:I}}}),lt=new pe({}),it=new Y({props:{name:"class transformers.GitProcessor",anchor:"transformers.GitProcessor",parameters:[{name:"image_processor",val:""},{name:"tokenizer",val:""}],parametersDescription:[{anchor:"transformers.GitProcessor.image_processor",description:`<strong>image_processor</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>) &#x2014;
The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.GitProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/processing_git.py#L23"}}),ct=new Y({props:{name:"__call__",anchor:"transformers.GitProcessor.__call__",parameters:[{name:"text",val:" = None"},{name:"images",val:" = None"},{name:"return_tensors",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GitProcessor.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.GitProcessor.__call__.images",description:`<strong>images</strong> (<code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>torch.Tensor</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, <code>List[torch.Tensor]</code>) &#x2014;
The image or batch of images to be prepared. Each image can be a PIL image, NumPy array or PyTorch
tensor. In case of a NumPy array/PyTorch tensor, each image should be of shape (C, H, W), where C is a
number of channels, H and W are image height and width.`,name:"images"},{anchor:"transformers.GitProcessor.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.33.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors of a particular framework. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return NumPy <code>np.ndarray</code> objects.</li>
<li><code>&apos;jax&apos;</code>: Return JAX <code>jnp.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/processing_git.py#L44",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li><strong>input_ids</strong> \u2014 List of token ids to be fed to a model. Returned when <code>text</code> is not <code>None</code>.</li>
<li><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code> and if <code>text</code> is not
<code>None</code>).</li>
<li><strong>pixel_values</strong> \u2014 Pixel values to be fed to a model. Returned when <code>images</code> is not <code>None</code>.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),ht=new pe({}),ut=new Y({props:{name:"class transformers.GitModel",anchor:"transformers.GitModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GitModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitConfig">GitConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/modeling_git.py#L1067"}}),yt=new Y({props:{name:"forward",anchor:"transformers.GitModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"pixel_values",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:"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.GitModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.GitModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GitModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GitModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.GitModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GitModel.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.GitModel.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.GitModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GitModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GitModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/modeling_git.py#L1157",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitConfig"
>GitConfig</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>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ke=new gl({props:{$$slots:{default:[Hi]},$$scope:{ctx:I}}}),Ue=new kt({props:{anchor:"transformers.GitModel.forward.example",$$slots:{default:[Di]},$$scope:{ctx:I}}}),bt=new pe({}),Mt=new Y({props:{name:"class transformers.GitForCausalLM",anchor:"transformers.GitForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GitForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitConfig">GitConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/modeling_git.py#L1329"}}),jt=new Y({props:{name:"forward",anchor:"transformers.GitForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"pixel_values",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:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = 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.GitForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.GitForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.GitForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.GitForCausalLM.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">CLIPImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.GitForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.GitForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GitForCausalLM.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.GitForCausalLM.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.GitForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GitForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.GitForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GitForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/git/modeling_git.py#L1347",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitConfig"
>GitConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 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>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ze=new gl({props:{$$slots:{default:[Oi]},$$scope:{ctx:I}}}),$e=new kt({props:{anchor:"transformers.GitForCausalLM.forward.example",$$slots:{default:[Ki]},$$scope:{ctx:I}}}),Ee=new kt({props:{anchor:"transformers.GitForCausalLM.forward.example-2",$$slots:{default:[ed]},$$scope:{ctx:I}}}),We=new kt({props:{anchor:"transformers.GitForCausalLM.forward.example-3",$$slots:{default:[td]},$$scope:{ctx:I}}}),{c(){c=a("meta"),b=p(),_=a("h1"),h=a("a"),y=a("span"),M(i.$$.fragment),f=p(),E=a("span"),Qs=s("GIT"),ss=p(),L=a("h2"),me=a("a"),po=a("span"),M(Ne.$$.fragment),Hs=p(),mo=a("span"),Ds=s("Overview"),ns=p(),X=a("p"),Os=s("The GIT model was proposed in "),Re=a("a"),Ks=s("GIT: A Generative Image-to-text Transformer for Vision and Language"),en=s(` by
Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, Lijuan Wang. GIT is a decoder-only Transformer
that leverages `),Zt=a("a"),tn=s("CLIP"),on=s(`\u2019s vision encoder to condition the model on vision inputs besides text. The model obtains state-of-the-art results on
image captioning and visual question answering benchmarks.`),as=p(),$t=a("p"),sn=s("The abstract from the paper is the following:"),rs=p(),Et=a("p"),ho=a("em"),nn=s("In this paper, we design and train a Generative Image-to-text Transformer, GIT, to unify vision-language tasks such as image/video captioning and question answering. While generative models provide a consistent network architecture between pre-training and fine-tuning, existing work typically contains complex structures (uni/multi-modal encoder/decoder) and depends on external modules such as object detectors/taggers and optical character recognition (OCR). In GIT, we simplify the architecture as one image encoder and one text decoder under a single language modeling task. We also scale up the pre-training data and the model size to boost the model performance. Without bells and whistles, our GIT establishes new state of the arts on 12 challenging benchmarks with a large margin. For instance, our model surpasses the human performance for the first time on TextCaps (138.2 vs. 125.5 in CIDEr). Furthermore, we present a new scheme of generation-based image classification and scene text recognition, achieving decent performance on standard benchmarks."),ls=p(),Wt=a("p"),an=s("Tips:"),is=p(),he=a("ul"),Xe=a("li"),rn=s("GIT is implemented in a very similar way to GPT-2, the only difference being that the model is also conditioned on "),uo=a("code"),ln=s("pixel_values"),dn=s("."),cn=p(),Q=a("li"),pn=s("One can use "),xt=a("a"),mn=s("GitProcessor"),hn=s(" to prepare images for the model, and the "),fo=a("code"),un=s("generate"),fn=s(" method for autoregressive generation."),ds=p(),ue=a("img"),cs=p(),fe=a("small"),gn=s("GIT architecture. Taken from the "),Pe=a("a"),_n=s("original paper"),yn=s("."),ps=p(),P=a("p"),bn=s("This model was contributed by "),Ae=a("a"),Mn=s("nielsr"),vn=s(`.
The original code can be found `),qe=a("a"),wn=s("here"),Tn=s("."),ms=p(),H=a("h2"),ge=a("a"),go=a("span"),M(Se.$$.fragment),Jn=p(),_o=a("span"),jn=s("Resources"),hs=p(),Bt=a("p"),Gn=s("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with GIT."),us=p(),_e=a("ul"),Ye=a("li"),In=s("Demo notebooks regarding inference + fine-tuning GIT on custom data can be found "),Le=a("a"),kn=s("here"),Un=s("."),Cn=p(),zt=a("li"),Zn=s("See also: "),Vt=a("a"),$n=s("Causal language modeling task guide"),fs=p(),Ft=a("p"),En=s(`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),gs=p(),D=a("h2"),ye=a("a"),yo=a("span"),M(Qe.$$.fragment),Wn=p(),bo=a("span"),xn=s("GitVisionConfig"),_s=p(),B=a("div"),M(He.$$.fragment),Bn=p(),O=a("p"),zn=s("This is the configuration class to store the configuration of a "),Nt=a("a"),Vn=s("GitVisionModel"),Fn=s(`. It is used to instantiate a GIT
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the GIT
`),De=a("a"),Nn=s("microsoft/git-base"),Rn=s(" architecture."),Xn=p(),K=a("p"),Pn=s("Configuration objects inherit from "),Rt=a("a"),An=s("PretrainedConfig"),qn=s(` and can be used to control the model outputs. Read the
documentation from `),Xt=a("a"),Sn=s("PretrainedConfig"),Yn=s(" for more information."),Ln=p(),M(be.$$.fragment),ys=p(),ee=a("h2"),Me=a("a"),Mo=a("span"),M(Oe.$$.fragment),Qn=p(),vo=a("span"),Hn=s("GitVisionModel"),bs=p(),C=a("div"),M(Ke.$$.fragment),Dn=p(),wo=a("p"),On=s("The vision model from CLIP, used in GIT, without any head or projection on top."),Kn=p(),et=a("p"),ea=s("This model inherits from "),Pt=a("a"),ta=s("PreTrainedModel"),oa=s(`. 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.)`),sa=p(),tt=a("p"),na=s("This model is also a PyTorch "),ot=a("a"),aa=s("torch.nn.Module"),ra=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),la=p(),F=a("div"),M(st.$$.fragment),ia=p(),te=a("p"),da=s("The "),At=a("a"),ca=s("GitVisionModel"),pa=s(" forward method, overrides the "),To=a("code"),ma=s("__call__"),ha=s(" special method."),ua=p(),M(ve.$$.fragment),fa=p(),M(we.$$.fragment),Ms=p(),oe=a("h2"),Te=a("a"),Jo=a("span"),M(nt.$$.fragment),ga=p(),jo=a("span"),_a=s("GitConfig"),vs=p(),z=a("div"),M(at.$$.fragment),ya=p(),se=a("p"),ba=s("This is the configuration class to store the configuration of a "),qt=a("a"),Ma=s("GitModel"),va=s(`. It is used to instantiate a GIT 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 GIT
`),rt=a("a"),wa=s("microsoft/git-base"),Ta=s(" architecture."),Ja=p(),ne=a("p"),ja=s("Configuration objects inherit from "),St=a("a"),Ga=s("PretrainedConfig"),Ia=s(` and can be used to control the model outputs. Read the
documentation from `),Yt=a("a"),ka=s("PretrainedConfig"),Ua=s(" for more information."),Ca=p(),M(Je.$$.fragment),ws=p(),ae=a("h2"),je=a("a"),Go=a("span"),M(lt.$$.fragment),Za=p(),Io=a("span"),$a=s("GitProcessor"),Ts=p(),V=a("div"),M(it.$$.fragment),Ea=p(),ko=a("p"),Wa=s("Constructs a GIT processor which wraps a CLIP image processor and a BERT tokenizer into a single processor."),xa=p(),W=a("p"),Lt=a("a"),Ba=s("GitProcessor"),za=s(" offers all the functionalities of "),Qt=a("a"),Va=s("CLIPImageProcessor"),Fa=s(" and "),Ht=a("a"),Na=s("BertTokenizerFast"),Ra=s(`. See the
`),dt=a("a"),Uo=a("strong"),Xa=s("call"),Pa=s("()"),Aa=s(" and "),Co=a("code"),qa=s("decode()"),Sa=s(" for more information."),Ya=p(),Ge=a("div"),M(ct.$$.fragment),La=p(),G=a("p"),Qa=s("Main method to prepare for the model one or several sequences(s) and image(s). This method forwards the "),Zo=a("code"),Ha=s("text"),Da=s(`
and `),$o=a("code"),Oa=s("kwargs"),Ka=s(" arguments to BertTokenizerFast\u2019s "),pt=a("a"),Eo=a("strong"),er=s("call"),tr=s("()"),or=s(" if "),Wo=a("code"),sr=s("text"),nr=s(" is not "),xo=a("code"),ar=s("None"),rr=s(` to encode
the text. To prepare the image(s), this method forwards the `),Bo=a("code"),lr=s("images"),ir=s(" and "),zo=a("code"),dr=s("kwrags"),cr=s(` arguments to
CLIPImageProcessor\u2019s `),mt=a("a"),Vo=a("strong"),pr=s("call"),mr=s("()"),hr=s(" if "),Fo=a("code"),ur=s("images"),fr=s(" is not "),No=a("code"),gr=s("None"),_r=s(`. Please refer to the doctsring
of the above two methods for more information.`),Js=p(),re=a("h2"),Ie=a("a"),Ro=a("span"),M(ht.$$.fragment),yr=p(),Xo=a("span"),br=s("GitModel"),js=p(),Z=a("div"),M(ut.$$.fragment),Mr=p(),Po=a("p"),vr=s("The bare GIT Model transformer consisting of a CLIP image encoder and text decoder outputting raw hidden-states without any specific head on top."),wr=p(),ft=a("p"),Tr=s("This model inherits from "),Dt=a("a"),Jr=s("PreTrainedModel"),jr=s(`. 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.)`),Gr=p(),gt=a("p"),Ir=s("This model is also a PyTorch "),_t=a("a"),kr=s("torch.nn.Module"),Ur=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Cr=p(),N=a("div"),M(yt.$$.fragment),Zr=p(),le=a("p"),$r=s("The "),Ot=a("a"),Er=s("GitModel"),Wr=s(" forward method, overrides the "),Ao=a("code"),xr=s("__call__"),Br=s(" special method."),zr=p(),M(ke.$$.fragment),Vr=p(),M(Ue.$$.fragment),Gs=p(),ie=a("h2"),Ce=a("a"),qo=a("span"),M(bt.$$.fragment),Fr=p(),So=a("span"),Nr=s("GitForCausalLM"),Is=p(),$=a("div"),M(Mt.$$.fragment),Rr=p(),vt=a("p"),Xr=s("GIT Model with a "),Yo=a("code"),Pr=s("language modeling"),Ar=s(" head on top for autoregressive language modeling."),qr=p(),wt=a("p"),Sr=s("This model inherits from "),Kt=a("a"),Yr=s("PreTrainedModel"),Lr=s(`. 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.)`),Qr=p(),Tt=a("p"),Hr=s("This model is also a PyTorch "),Jt=a("a"),Dr=s("torch.nn.Module"),Or=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kr=p(),U=a("div"),M(jt.$$.fragment),el=p(),de=a("p"),tl=s("The "),eo=a("a"),ol=s("GitForCausalLM"),sl=s(" forward method, overrides the "),Lo=a("code"),nl=s("__call__"),al=s(" special method."),rl=p(),M(Ze.$$.fragment),ll=p(),Qo=a("p"),il=s("Examples:"),dl=p(),M($e.$$.fragment),cl=p(),M(Ee.$$.fragment),pl=p(),M(We.$$.fragment),this.h()},l(t){const u=Pi('[data-svelte="svelte-1phssyn"]',document.head);c=r(u,"META",{name:!0,content:!0}),u.forEach(o),b=m(t),_=r(t,"H1",{class:!0});var Gt=l(_);h=r(Gt,"A",{id:!0,class:!0,href:!0});var Ho=l(h);y=r(Ho,"SPAN",{});var Do=l(y);v(i.$$.fragment,Do),Do.forEach(o),Ho.forEach(o),f=m(Gt),E=r(Gt,"SPAN",{});var Oo=l(E);Qs=n(Oo,"GIT"),Oo.forEach(o),Gt.forEach(o),ss=m(t),L=r(t,"H2",{class:!0});var It=l(L);me=r(It,"A",{id:!0,class:!0,href:!0});var Ko=l(me);po=r(Ko,"SPAN",{});var es=l(po);v(Ne.$$.fragment,es),es.forEach(o),Ko.forEach(o),Hs=m(It),mo=r(It,"SPAN",{});var ts=l(mo);Ds=n(ts,"Overview"),ts.forEach(o),It.forEach(o),ns=m(t),X=r(t,"P",{});var ce=l(X);Os=n(ce,"The GIT model was proposed in "),Re=r(ce,"A",{href:!0,rel:!0});var os=l(Re);Ks=n(os,"GIT: A Generative Image-to-text Transformer for Vision and Language"),os.forEach(o),en=n(ce,` by
Jianfeng Wang, Zhengyuan Yang, Xiaowei Hu, Linjie Li, Kevin Lin, Zhe Gan, Zicheng Liu, Ce Liu, Lijuan Wang. GIT is a decoder-only Transformer
that leverages `),Zt=r(ce,"A",{href:!0});var yl=l(Zt);tn=n(yl,"CLIP"),yl.forEach(o),on=n(ce,`\u2019s vision encoder to condition the model on vision inputs besides text. The model obtains state-of-the-art results on
image captioning and visual question answering benchmarks.`),ce.forEach(o),as=m(t),$t=r(t,"P",{});var bl=l($t);sn=n(bl,"The abstract from the paper is the following:"),bl.forEach(o),rs=m(t),Et=r(t,"P",{});var Ml=l(Et);ho=r(Ml,"EM",{});var vl=l(ho);nn=n(vl,"In this paper, we design and train a Generative Image-to-text Transformer, GIT, to unify vision-language tasks such as image/video captioning and question answering. While generative models provide a consistent network architecture between pre-training and fine-tuning, existing work typically contains complex structures (uni/multi-modal encoder/decoder) and depends on external modules such as object detectors/taggers and optical character recognition (OCR). In GIT, we simplify the architecture as one image encoder and one text decoder under a single language modeling task. We also scale up the pre-training data and the model size to boost the model performance. Without bells and whistles, our GIT establishes new state of the arts on 12 challenging benchmarks with a large margin. For instance, our model surpasses the human performance for the first time on TextCaps (138.2 vs. 125.5 in CIDEr). Furthermore, we present a new scheme of generation-based image classification and scene text recognition, achieving decent performance on standard benchmarks."),vl.forEach(o),Ml.forEach(o),ls=m(t),Wt=r(t,"P",{});var wl=l(Wt);an=n(wl,"Tips:"),wl.forEach(o),is=m(t),he=r(t,"UL",{});var Us=l(he);Xe=r(Us,"LI",{});var Cs=l(Xe);rn=n(Cs,"GIT is implemented in a very similar way to GPT-2, the only difference being that the model is also conditioned on "),uo=r(Cs,"CODE",{});var Tl=l(uo);ln=n(Tl,"pixel_values"),Tl.forEach(o),dn=n(Cs,"."),Cs.forEach(o),cn=m(Us),Q=r(Us,"LI",{});var to=l(Q);pn=n(to,"One can use "),xt=r(to,"A",{href:!0});var Jl=l(xt);mn=n(Jl,"GitProcessor"),Jl.forEach(o),hn=n(to," to prepare images for the model, and the "),fo=r(to,"CODE",{});var jl=l(fo);un=n(jl,"generate"),jl.forEach(o),fn=n(to," method for autoregressive generation."),to.forEach(o),Us.forEach(o),ds=m(t),ue=r(t,"IMG",{src:!0,alt:!0,width:!0}),cs=m(t),fe=r(t,"SMALL",{});var Zs=l(fe);gn=n(Zs,"GIT architecture. Taken from the "),Pe=r(Zs,"A",{href:!0,target:!0});var Gl=l(Pe);_n=n(Gl,"original paper"),Gl.forEach(o),yn=n(Zs,"."),Zs.forEach(o),ps=m(t),P=r(t,"P",{});var oo=l(P);bn=n(oo,"This model was contributed by "),Ae=r(oo,"A",{href:!0,rel:!0});var Il=l(Ae);Mn=n(Il,"nielsr"),Il.forEach(o),vn=n(oo,`.
The original code can be found `),qe=r(oo,"A",{href:!0,rel:!0});var kl=l(qe);wn=n(kl,"here"),kl.forEach(o),Tn=n(oo,"."),oo.forEach(o),ms=m(t),H=r(t,"H2",{class:!0});var $s=l(H);ge=r($s,"A",{id:!0,class:!0,href:!0});var Ul=l(ge);go=r(Ul,"SPAN",{});var Cl=l(go);v(Se.$$.fragment,Cl),Cl.forEach(o),Ul.forEach(o),Jn=m($s),_o=r($s,"SPAN",{});var Zl=l(_o);jn=n(Zl,"Resources"),Zl.forEach(o),$s.forEach(o),hs=m(t),Bt=r(t,"P",{});var $l=l(Bt);Gn=n($l,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with GIT."),$l.forEach(o),us=m(t),_e=r(t,"UL",{});var Es=l(_e);Ye=r(Es,"LI",{});var Ws=l(Ye);In=n(Ws,"Demo notebooks regarding inference + fine-tuning GIT on custom data can be found "),Le=r(Ws,"A",{href:!0,rel:!0});var El=l(Le);kn=n(El,"here"),El.forEach(o),Un=n(Ws,"."),Ws.forEach(o),Cn=m(Es),zt=r(Es,"LI",{});var ml=l(zt);Zn=n(ml,"See also: "),Vt=r(ml,"A",{href:!0});var Wl=l(Vt);$n=n(Wl,"Causal language modeling task guide"),Wl.forEach(o),ml.forEach(o),Es.forEach(o),fs=m(t),Ft=r(t,"P",{});var xl=l(Ft);En=n(xl,`If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we will review it.
The resource should ideally demonstrate something new instead of duplicating an existing resource.`),xl.forEach(o),gs=m(t),D=r(t,"H2",{class:!0});var xs=l(D);ye=r(xs,"A",{id:!0,class:!0,href:!0});var Bl=l(ye);yo=r(Bl,"SPAN",{});var zl=l(yo);v(Qe.$$.fragment,zl),zl.forEach(o),Bl.forEach(o),Wn=m(xs),bo=r(xs,"SPAN",{});var Vl=l(bo);xn=n(Vl,"GitVisionConfig"),Vl.forEach(o),xs.forEach(o),_s=m(t),B=r(t,"DIV",{class:!0});var xe=l(B);v(He.$$.fragment,xe),Bn=m(xe),O=r(xe,"P",{});var so=l(O);zn=n(so,"This is the configuration class to store the configuration of a "),Nt=r(so,"A",{href:!0});var Fl=l(Nt);Vn=n(Fl,"GitVisionModel"),Fl.forEach(o),Fn=n(so,`. It is used to instantiate a GIT
vision encoder according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the vision encoder of the GIT
`),De=r(so,"A",{href:!0,rel:!0});var Nl=l(De);Nn=n(Nl,"microsoft/git-base"),Nl.forEach(o),Rn=n(so," architecture."),so.forEach(o),Xn=m(xe),K=r(xe,"P",{});var no=l(K);Pn=n(no,"Configuration objects inherit from "),Rt=r(no,"A",{href:!0});var Rl=l(Rt);An=n(Rl,"PretrainedConfig"),Rl.forEach(o),qn=n(no,` and can be used to control the model outputs. Read the
documentation from `),Xt=r(no,"A",{href:!0});var Xl=l(Xt);Sn=n(Xl,"PretrainedConfig"),Xl.forEach(o),Yn=n(no," for more information."),no.forEach(o),Ln=m(xe),v(be.$$.fragment,xe),xe.forEach(o),ys=m(t),ee=r(t,"H2",{class:!0});var Bs=l(ee);Me=r(Bs,"A",{id:!0,class:!0,href:!0});var Pl=l(Me);Mo=r(Pl,"SPAN",{});var Al=l(Mo);v(Oe.$$.fragment,Al),Al.forEach(o),Pl.forEach(o),Qn=m(Bs),vo=r(Bs,"SPAN",{});var ql=l(vo);Hn=n(ql,"GitVisionModel"),ql.forEach(o),Bs.forEach(o),bs=m(t),C=r(t,"DIV",{class:!0});var A=l(C);v(Ke.$$.fragment,A),Dn=m(A),wo=r(A,"P",{});var Sl=l(wo);On=n(Sl,"The vision model from CLIP, used in GIT, without any head or projection on top."),Sl.forEach(o),Kn=m(A),et=r(A,"P",{});var zs=l(et);ea=n(zs,"This model inherits from "),Pt=r(zs,"A",{href:!0});var Yl=l(Pt);ta=n(Yl,"PreTrainedModel"),Yl.forEach(o),oa=n(zs,`. 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.)`),zs.forEach(o),sa=m(A),tt=r(A,"P",{});var Vs=l(tt);na=n(Vs,"This model is also a PyTorch "),ot=r(Vs,"A",{href:!0,rel:!0});var Ll=l(ot);aa=n(Ll,"torch.nn.Module"),Ll.forEach(o),ra=n(Vs,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vs.forEach(o),la=m(A),F=r(A,"DIV",{class:!0});var Be=l(F);v(st.$$.fragment,Be),ia=m(Be),te=r(Be,"P",{});var ao=l(te);da=n(ao,"The "),At=r(ao,"A",{href:!0});var Ql=l(At);ca=n(Ql,"GitVisionModel"),Ql.forEach(o),pa=n(ao," forward method, overrides the "),To=r(ao,"CODE",{});var Hl=l(To);ma=n(Hl,"__call__"),Hl.forEach(o),ha=n(ao," special method."),ao.forEach(o),ua=m(Be),v(ve.$$.fragment,Be),fa=m(Be),v(we.$$.fragment,Be),Be.forEach(o),A.forEach(o),Ms=m(t),oe=r(t,"H2",{class:!0});var Fs=l(oe);Te=r(Fs,"A",{id:!0,class:!0,href:!0});var Dl=l(Te);Jo=r(Dl,"SPAN",{});var Ol=l(Jo);v(nt.$$.fragment,Ol),Ol.forEach(o),Dl.forEach(o),ga=m(Fs),jo=r(Fs,"SPAN",{});var Kl=l(jo);_a=n(Kl,"GitConfig"),Kl.forEach(o),Fs.forEach(o),vs=m(t),z=r(t,"DIV",{class:!0});var ze=l(z);v(at.$$.fragment,ze),ya=m(ze),se=r(ze,"P",{});var ro=l(se);ba=n(ro,"This is the configuration class to store the configuration of a "),qt=r(ro,"A",{href:!0});var ei=l(qt);Ma=n(ei,"GitModel"),ei.forEach(o),va=n(ro,`. It is used to instantiate a GIT 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 GIT
`),rt=r(ro,"A",{href:!0,rel:!0});var ti=l(rt);wa=n(ti,"microsoft/git-base"),ti.forEach(o),Ta=n(ro," architecture."),ro.forEach(o),Ja=m(ze),ne=r(ze,"P",{});var lo=l(ne);ja=n(lo,"Configuration objects inherit from "),St=r(lo,"A",{href:!0});var oi=l(St);Ga=n(oi,"PretrainedConfig"),oi.forEach(o),Ia=n(lo,` and can be used to control the model outputs. Read the
documentation from `),Yt=r(lo,"A",{href:!0});var si=l(Yt);ka=n(si,"PretrainedConfig"),si.forEach(o),Ua=n(lo," for more information."),lo.forEach(o),Ca=m(ze),v(Je.$$.fragment,ze),ze.forEach(o),ws=m(t),ae=r(t,"H2",{class:!0});var Ns=l(ae);je=r(Ns,"A",{id:!0,class:!0,href:!0});var ni=l(je);Go=r(ni,"SPAN",{});var ai=l(Go);v(lt.$$.fragment,ai),ai.forEach(o),ni.forEach(o),Za=m(Ns),Io=r(Ns,"SPAN",{});var ri=l(Io);$a=n(ri,"GitProcessor"),ri.forEach(o),Ns.forEach(o),Ts=m(t),V=r(t,"DIV",{class:!0});var Ve=l(V);v(it.$$.fragment,Ve),Ea=m(Ve),ko=r(Ve,"P",{});var li=l(ko);Wa=n(li,"Constructs a GIT processor which wraps a CLIP image processor and a BERT tokenizer into a single processor."),li.forEach(o),xa=m(Ve),W=r(Ve,"P",{});var R=l(W);Lt=r(R,"A",{href:!0});var ii=l(Lt);Ba=n(ii,"GitProcessor"),ii.forEach(o),za=n(R," offers all the functionalities of "),Qt=r(R,"A",{href:!0});var di=l(Qt);Va=n(di,"CLIPImageProcessor"),di.forEach(o),Fa=n(R," and "),Ht=r(R,"A",{href:!0});var ci=l(Ht);Na=n(ci,"BertTokenizerFast"),ci.forEach(o),Ra=n(R,`. See the
`),dt=r(R,"A",{href:!0});var hl=l(dt);Uo=r(hl,"STRONG",{});var pi=l(Uo);Xa=n(pi,"call"),pi.forEach(o),Pa=n(hl,"()"),hl.forEach(o),Aa=n(R," and "),Co=r(R,"CODE",{});var mi=l(Co);qa=n(mi,"decode()"),mi.forEach(o),Sa=n(R," for more information."),R.forEach(o),Ya=m(Ve),Ge=r(Ve,"DIV",{class:!0});var Rs=l(Ge);v(ct.$$.fragment,Rs),La=m(Rs),G=r(Rs,"P",{});var k=l(G);Qa=n(k,"Main method to prepare for the model one or several sequences(s) and image(s). This method forwards the "),Zo=r(k,"CODE",{});var hi=l(Zo);Ha=n(hi,"text"),hi.forEach(o),Da=n(k,`
and `),$o=r(k,"CODE",{});var ui=l($o);Oa=n(ui,"kwargs"),ui.forEach(o),Ka=n(k," arguments to BertTokenizerFast\u2019s "),pt=r(k,"A",{href:!0});var ul=l(pt);Eo=r(ul,"STRONG",{});var fi=l(Eo);er=n(fi,"call"),fi.forEach(o),tr=n(ul,"()"),ul.forEach(o),or=n(k," if "),Wo=r(k,"CODE",{});var gi=l(Wo);sr=n(gi,"text"),gi.forEach(o),nr=n(k," is not "),xo=r(k,"CODE",{});var _i=l(xo);ar=n(_i,"None"),_i.forEach(o),rr=n(k,` to encode
the text. To prepare the image(s), this method forwards the `),Bo=r(k,"CODE",{});var yi=l(Bo);lr=n(yi,"images"),yi.forEach(o),ir=n(k," and "),zo=r(k,"CODE",{});var bi=l(zo);dr=n(bi,"kwrags"),bi.forEach(o),cr=n(k,` arguments to
CLIPImageProcessor\u2019s `),mt=r(k,"A",{href:!0});var fl=l(mt);Vo=r(fl,"STRONG",{});var Mi=l(Vo);pr=n(Mi,"call"),Mi.forEach(o),mr=n(fl,"()"),fl.forEach(o),hr=n(k," if "),Fo=r(k,"CODE",{});var vi=l(Fo);ur=n(vi,"images"),vi.forEach(o),fr=n(k," is not "),No=r(k,"CODE",{});var wi=l(No);gr=n(wi,"None"),wi.forEach(o),_r=n(k,`. Please refer to the doctsring
of the above two methods for more information.`),k.forEach(o),Rs.forEach(o),Ve.forEach(o),Js=m(t),re=r(t,"H2",{class:!0});var Xs=l(re);Ie=r(Xs,"A",{id:!0,class:!0,href:!0});var Ti=l(Ie);Ro=r(Ti,"SPAN",{});var Ji=l(Ro);v(ht.$$.fragment,Ji),Ji.forEach(o),Ti.forEach(o),yr=m(Xs),Xo=r(Xs,"SPAN",{});var ji=l(Xo);br=n(ji,"GitModel"),ji.forEach(o),Xs.forEach(o),js=m(t),Z=r(t,"DIV",{class:!0});var q=l(Z);v(ut.$$.fragment,q),Mr=m(q),Po=r(q,"P",{});var Gi=l(Po);vr=n(Gi,"The bare GIT Model transformer consisting of a CLIP image encoder and text decoder outputting raw hidden-states without any specific head on top."),Gi.forEach(o),wr=m(q),ft=r(q,"P",{});var Ps=l(ft);Tr=n(Ps,"This model inherits from "),Dt=r(Ps,"A",{href:!0});var Ii=l(Dt);Jr=n(Ii,"PreTrainedModel"),Ii.forEach(o),jr=n(Ps,`. 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.)`),Ps.forEach(o),Gr=m(q),gt=r(q,"P",{});var As=l(gt);Ir=n(As,"This model is also a PyTorch "),_t=r(As,"A",{href:!0,rel:!0});var ki=l(_t);kr=n(ki,"torch.nn.Module"),ki.forEach(o),Ur=n(As,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),As.forEach(o),Cr=m(q),N=r(q,"DIV",{class:!0});var Fe=l(N);v(yt.$$.fragment,Fe),Zr=m(Fe),le=r(Fe,"P",{});var io=l(le);$r=n(io,"The "),Ot=r(io,"A",{href:!0});var Ui=l(Ot);Er=n(Ui,"GitModel"),Ui.forEach(o),Wr=n(io," forward method, overrides the "),Ao=r(io,"CODE",{});var Ci=l(Ao);xr=n(Ci,"__call__"),Ci.forEach(o),Br=n(io," special method."),io.forEach(o),zr=m(Fe),v(ke.$$.fragment,Fe),Vr=m(Fe),v(Ue.$$.fragment,Fe),Fe.forEach(o),q.forEach(o),Gs=m(t),ie=r(t,"H2",{class:!0});var qs=l(ie);Ce=r(qs,"A",{id:!0,class:!0,href:!0});var Zi=l(Ce);qo=r(Zi,"SPAN",{});var $i=l(qo);v(bt.$$.fragment,$i),$i.forEach(o),Zi.forEach(o),Fr=m(qs),So=r(qs,"SPAN",{});var Ei=l(So);Nr=n(Ei,"GitForCausalLM"),Ei.forEach(o),qs.forEach(o),Is=m(t),$=r(t,"DIV",{class:!0});var S=l($);v(Mt.$$.fragment,S),Rr=m(S),vt=r(S,"P",{});var Ss=l(vt);Xr=n(Ss,"GIT Model with a "),Yo=r(Ss,"CODE",{});var Wi=l(Yo);Pr=n(Wi,"language modeling"),Wi.forEach(o),Ar=n(Ss," head on top for autoregressive language modeling."),Ss.forEach(o),qr=m(S),wt=r(S,"P",{});var Ys=l(wt);Sr=n(Ys,"This model inherits from "),Kt=r(Ys,"A",{href:!0});var xi=l(Kt);Yr=n(xi,"PreTrainedModel"),xi.forEach(o),Lr=n(Ys,`. 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.)`),Ys.forEach(o),Qr=m(S),Tt=r(S,"P",{});var Ls=l(Tt);Hr=n(Ls,"This model is also a PyTorch "),Jt=r(Ls,"A",{href:!0,rel:!0});var Bi=l(Jt);Dr=n(Bi,"torch.nn.Module"),Bi.forEach(o),Or=n(Ls,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ls.forEach(o),Kr=m(S),U=r(S,"DIV",{class:!0});var x=l(U);v(jt.$$.fragment,x),el=m(x),de=r(x,"P",{});var co=l(de);tl=n(co,"The "),eo=r(co,"A",{href:!0});var zi=l(eo);ol=n(zi,"GitForCausalLM"),zi.forEach(o),sl=n(co," forward method, overrides the "),Lo=r(co,"CODE",{});var Vi=l(Lo);nl=n(Vi,"__call__"),Vi.forEach(o),al=n(co," special method."),co.forEach(o),rl=m(x),v(Ze.$$.fragment,x),ll=m(x),Qo=r(x,"P",{});var Fi=l(Qo);il=n(Fi,"Examples:"),Fi.forEach(o),dl=m(x),v($e.$$.fragment,x),cl=m(x),v(Ee.$$.fragment,x),pl=m(x),v(We.$$.fragment,x),x.forEach(o),S.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(sd)),d(h,"id","git"),d(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(h,"href","#git"),d(_,"class","relative group"),d(me,"id","overview"),d(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(me,"href","#overview"),d(L,"class","relative group"),d(Re,"href","https://arxiv.org/abs/2205.14100"),d(Re,"rel","nofollow"),d(Zt,"href","clip"),d(xt,"href","/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitProcessor"),Ai(ue.src,_l="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/git_architecture.jpg")||d(ue,"src",_l),d(ue,"alt","drawing"),d(ue,"width","600"),d(Pe,"href","https://arxiv.org/abs/2205.14100"),d(Pe,"target","_blank"),d(Ae,"href","https://huggingface.co/nielsr"),d(Ae,"rel","nofollow"),d(qe,"href","https://github.com/microsoft/GenerativeImage2Text"),d(qe,"rel","nofollow"),d(ge,"id","resources"),d(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ge,"href","#resources"),d(H,"class","relative group"),d(Le,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/GIT"),d(Le,"rel","nofollow"),d(Vt,"href","../tasks/language_modeling"),d(ye,"id","transformers.GitVisionConfig"),d(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ye,"href","#transformers.GitVisionConfig"),d(D,"class","relative group"),d(Nt,"href","/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitVisionModel"),d(De,"href","https://huggingface.co/microsoft/git-base"),d(De,"rel","nofollow"),d(Rt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Xt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Me,"id","transformers.GitVisionModel"),d(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Me,"href","#transformers.GitVisionModel"),d(ee,"class","relative group"),d(Pt,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),d(ot,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ot,"rel","nofollow"),d(At,"href","/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitVisionModel"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Te,"id","transformers.GitConfig"),d(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Te,"href","#transformers.GitConfig"),d(oe,"class","relative group"),d(qt,"href","/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitModel"),d(rt,"href","https://huggingface.co/microsoft/git-base"),d(rt,"rel","nofollow"),d(St,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Yt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(je,"id","transformers.GitProcessor"),d(je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(je,"href","#transformers.GitProcessor"),d(ae,"class","relative group"),d(Lt,"href","/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitProcessor"),d(Qt,"href","/docs/transformers/v4.33.0/en/model_doc/clip#transformers.CLIPImageProcessor"),d(Ht,"href","/docs/transformers/v4.33.0/en/model_doc/bert#transformers.BertTokenizerFast"),d(dt,"href","/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitProcessor.__call__"),d(pt,"href","/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__"),d(mt,"href","/docs/transformers/v4.33.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__"),d(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ie,"id","transformers.GitModel"),d(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ie,"href","#transformers.GitModel"),d(re,"class","relative group"),d(Dt,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),d(_t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(_t,"rel","nofollow"),d(Ot,"href","/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitModel"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ce,"id","transformers.GitForCausalLM"),d(Ce,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ce,"href","#transformers.GitForCausalLM"),d(ie,"class","relative group"),d(Kt,"href","/docs/transformers/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),d(Jt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Jt,"rel","nofollow"),d(eo,"href","/docs/transformers/v4.33.0/en/model_doc/git#transformers.GitForCausalLM"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(t,u){e(document.head,c),g(t,b,u),g(t,_,u),e(_,h),e(h,y),w(i,y,null),e(_,f),e(_,E),e(E,Qs),g(t,ss,u),g(t,L,u),e(L,me),e(me,po),w(Ne,po,null),e(L,Hs),e(L,mo),e(mo,Ds),g(t,ns,u),g(t,X,u),e(X,Os),e(X,Re),e(Re,Ks),e(X,en),e(X,Zt),e(Zt,tn),e(X,on),g(t,as,u),g(t,$t,u),e($t,sn),g(t,rs,u),g(t,Et,u),e(Et,ho),e(ho,nn),g(t,ls,u),g(t,Wt,u),e(Wt,an),g(t,is,u),g(t,he,u),e(he,Xe),e(Xe,rn),e(Xe,uo),e(uo,ln),e(Xe,dn),e(he,cn),e(he,Q),e(Q,pn),e(Q,xt),e(xt,mn),e(Q,hn),e(Q,fo),e(fo,un),e(Q,fn),g(t,ds,u),g(t,ue,u),g(t,cs,u),g(t,fe,u),e(fe,gn),e(fe,Pe),e(Pe,_n),e(fe,yn),g(t,ps,u),g(t,P,u),e(P,bn),e(P,Ae),e(Ae,Mn),e(P,vn),e(P,qe),e(qe,wn),e(P,Tn),g(t,ms,u),g(t,H,u),e(H,ge),e(ge,go),w(Se,go,null),e(H,Jn),e(H,_o),e(_o,jn),g(t,hs,u),g(t,Bt,u),e(Bt,Gn),g(t,us,u),g(t,_e,u),e(_e,Ye),e(Ye,In),e(Ye,Le),e(Le,kn),e(Ye,Un),e(_e,Cn),e(_e,zt),e(zt,Zn),e(zt,Vt),e(Vt,$n),g(t,fs,u),g(t,Ft,u),e(Ft,En),g(t,gs,u),g(t,D,u),e(D,ye),e(ye,yo),w(Qe,yo,null),e(D,Wn),e(D,bo),e(bo,xn),g(t,_s,u),g(t,B,u),w(He,B,null),e(B,Bn),e(B,O),e(O,zn),e(O,Nt),e(Nt,Vn),e(O,Fn),e(O,De),e(De,Nn),e(O,Rn),e(B,Xn),e(B,K),e(K,Pn),e(K,Rt),e(Rt,An),e(K,qn),e(K,Xt),e(Xt,Sn),e(K,Yn),e(B,Ln),w(be,B,null),g(t,ys,u),g(t,ee,u),e(ee,Me),e(Me,Mo),w(Oe,Mo,null),e(ee,Qn),e(ee,vo),e(vo,Hn),g(t,bs,u),g(t,C,u),w(Ke,C,null),e(C,Dn),e(C,wo),e(wo,On),e(C,Kn),e(C,et),e(et,ea),e(et,Pt),e(Pt,ta),e(et,oa),e(C,sa),e(C,tt),e(tt,na),e(tt,ot),e(ot,aa),e(tt,ra),e(C,la),e(C,F),w(st,F,null),e(F,ia),e(F,te),e(te,da),e(te,At),e(At,ca),e(te,pa),e(te,To),e(To,ma),e(te,ha),e(F,ua),w(ve,F,null),e(F,fa),w(we,F,null),g(t,Ms,u),g(t,oe,u),e(oe,Te),e(Te,Jo),w(nt,Jo,null),e(oe,ga),e(oe,jo),e(jo,_a),g(t,vs,u),g(t,z,u),w(at,z,null),e(z,ya),e(z,se),e(se,ba),e(se,qt),e(qt,Ma),e(se,va),e(se,rt),e(rt,wa),e(se,Ta),e(z,Ja),e(z,ne),e(ne,ja),e(ne,St),e(St,Ga),e(ne,Ia),e(ne,Yt),e(Yt,ka),e(ne,Ua),e(z,Ca),w(Je,z,null),g(t,ws,u),g(t,ae,u),e(ae,je),e(je,Go),w(lt,Go,null),e(ae,Za),e(ae,Io),e(Io,$a),g(t,Ts,u),g(t,V,u),w(it,V,null),e(V,Ea),e(V,ko),e(ko,Wa),e(V,xa),e(V,W),e(W,Lt),e(Lt,Ba),e(W,za),e(W,Qt),e(Qt,Va),e(W,Fa),e(W,Ht),e(Ht,Na),e(W,Ra),e(W,dt),e(dt,Uo),e(Uo,Xa),e(dt,Pa),e(W,Aa),e(W,Co),e(Co,qa),e(W,Sa),e(V,Ya),e(V,Ge),w(ct,Ge,null),e(Ge,La),e(Ge,G),e(G,Qa),e(G,Zo),e(Zo,Ha),e(G,Da),e(G,$o),e($o,Oa),e(G,Ka),e(G,pt),e(pt,Eo),e(Eo,er),e(pt,tr),e(G,or),e(G,Wo),e(Wo,sr),e(G,nr),e(G,xo),e(xo,ar),e(G,rr),e(G,Bo),e(Bo,lr),e(G,ir),e(G,zo),e(zo,dr),e(G,cr),e(G,mt),e(mt,Vo),e(Vo,pr),e(mt,mr),e(G,hr),e(G,Fo),e(Fo,ur),e(G,fr),e(G,No),e(No,gr),e(G,_r),g(t,Js,u),g(t,re,u),e(re,Ie),e(Ie,Ro),w(ht,Ro,null),e(re,yr),e(re,Xo),e(Xo,br),g(t,js,u),g(t,Z,u),w(ut,Z,null),e(Z,Mr),e(Z,Po),e(Po,vr),e(Z,wr),e(Z,ft),e(ft,Tr),e(ft,Dt),e(Dt,Jr),e(ft,jr),e(Z,Gr),e(Z,gt),e(gt,Ir),e(gt,_t),e(_t,kr),e(gt,Ur),e(Z,Cr),e(Z,N),w(yt,N,null),e(N,Zr),e(N,le),e(le,$r),e(le,Ot),e(Ot,Er),e(le,Wr),e(le,Ao),e(Ao,xr),e(le,Br),e(N,zr),w(ke,N,null),e(N,Vr),w(Ue,N,null),g(t,Gs,u),g(t,ie,u),e(ie,Ce),e(Ce,qo),w(bt,qo,null),e(ie,Fr),e(ie,So),e(So,Nr),g(t,Is,u),g(t,$,u),w(Mt,$,null),e($,Rr),e($,vt),e(vt,Xr),e(vt,Yo),e(Yo,Pr),e(vt,Ar),e($,qr),e($,wt),e(wt,Sr),e(wt,Kt),e(Kt,Yr),e(wt,Lr),e($,Qr),e($,Tt),e(Tt,Hr),e(Tt,Jt),e(Jt,Dr),e(Tt,Or),e($,Kr),e($,U),w(jt,U,null),e(U,el),e(U,de),e(de,tl),e(de,eo),e(eo,ol),e(de,sl),e(de,Lo),e(Lo,nl),e(de,al),e(U,rl),w(Ze,U,null),e(U,ll),e(U,Qo),e(Qo,il),e(U,dl),w($e,U,null),e(U,cl),w(Ee,U,null),e(U,pl),w(We,U,null),ks=!0},p(t,[u]){const Gt={};u&2&&(Gt.$$scope={dirty:u,ctx:t}),be.$set(Gt);const Ho={};u&2&&(Ho.$$scope={dirty:u,ctx:t}),ve.$set(Ho);const Do={};u&2&&(Do.$$scope={dirty:u,ctx:t}),we.$set(Do);const Oo={};u&2&&(Oo.$$scope={dirty:u,ctx:t}),Je.$set(Oo);const It={};u&2&&(It.$$scope={dirty:u,ctx:t}),ke.$set(It);const Ko={};u&2&&(Ko.$$scope={dirty:u,ctx:t}),Ue.$set(Ko);const es={};u&2&&(es.$$scope={dirty:u,ctx:t}),Ze.$set(es);const ts={};u&2&&(ts.$$scope={dirty:u,ctx:t}),$e.$set(ts);const ce={};u&2&&(ce.$$scope={dirty:u,ctx:t}),Ee.$set(ce);const os={};u&2&&(os.$$scope={dirty:u,ctx:t}),We.$set(os)},i(t){ks||(T(i.$$.fragment,t),T(Ne.$$.fragment,t),T(Se.$$.fragment,t),T(Qe.$$.fragment,t),T(He.$$.fragment,t),T(be.$$.fragment,t),T(Oe.$$.fragment,t),T(Ke.$$.fragment,t),T(st.$$.fragment,t),T(ve.$$.fragment,t),T(we.$$.fragment,t),T(nt.$$.fragment,t),T(at.$$.fragment,t),T(Je.$$.fragment,t),T(lt.$$.fragment,t),T(it.$$.fragment,t),T(ct.$$.fragment,t),T(ht.$$.fragment,t),T(ut.$$.fragment,t),T(yt.$$.fragment,t),T(ke.$$.fragment,t),T(Ue.$$.fragment,t),T(bt.$$.fragment,t),T(Mt.$$.fragment,t),T(jt.$$.fragment,t),T(Ze.$$.fragment,t),T($e.$$.fragment,t),T(Ee.$$.fragment,t),T(We.$$.fragment,t),ks=!0)},o(t){J(i.$$.fragment,t),J(Ne.$$.fragment,t),J(Se.$$.fragment,t),J(Qe.$$.fragment,t),J(He.$$.fragment,t),J(be.$$.fragment,t),J(Oe.$$.fragment,t),J(Ke.$$.fragment,t),J(st.$$.fragment,t),J(ve.$$.fragment,t),J(we.$$.fragment,t),J(nt.$$.fragment,t),J(at.$$.fragment,t),J(Je.$$.fragment,t),J(lt.$$.fragment,t),J(it.$$.fragment,t),J(ct.$$.fragment,t),J(ht.$$.fragment,t),J(ut.$$.fragment,t),J(yt.$$.fragment,t),J(ke.$$.fragment,t),J(Ue.$$.fragment,t),J(bt.$$.fragment,t),J(Mt.$$.fragment,t),J(jt.$$.fragment,t),J(Ze.$$.fragment,t),J($e.$$.fragment,t),J(Ee.$$.fragment,t),J(We.$$.fragment,t),ks=!1},d(t){o(c),t&&o(b),t&&o(_),j(i),t&&o(ss),t&&o(L),j(Ne),t&&o(ns),t&&o(X),t&&o(as),t&&o($t),t&&o(rs),t&&o(Et),t&&o(ls),t&&o(Wt),t&&o(is),t&&o(he),t&&o(ds),t&&o(ue),t&&o(cs),t&&o(fe),t&&o(ps),t&&o(P),t&&o(ms),t&&o(H),j(Se),t&&o(hs),t&&o(Bt),t&&o(us),t&&o(_e),t&&o(fs),t&&o(Ft),t&&o(gs),t&&o(D),j(Qe),t&&o(_s),t&&o(B),j(He),j(be),t&&o(ys),t&&o(ee),j(Oe),t&&o(bs),t&&o(C),j(Ke),j(st),j(ve),j(we),t&&o(Ms),t&&o(oe),j(nt),t&&o(vs),t&&o(z),j(at),j(Je),t&&o(ws),t&&o(ae),j(lt),t&&o(Ts),t&&o(V),j(it),j(ct),t&&o(Js),t&&o(re),j(ht),t&&o(js),t&&o(Z),j(ut),j(yt),j(ke),j(Ue),t&&o(Gs),t&&o(ie),j(bt),t&&o(Is),t&&o($),j(Mt),j(jt),j(Ze),j($e),j(Ee),j(We)}}}const sd={local:"git",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.GitVisionConfig",title:"GitVisionConfig"},{local:"transformers.GitVisionModel",title:"GitVisionModel"},{local:"transformers.GitConfig",title:"GitConfig"},{local:"transformers.GitProcessor",title:"GitProcessor"},{local:"transformers.GitModel",title:"GitModel"},{local:"transformers.GitForCausalLM",title:"GitForCausalLM"}],title:"GIT"};function nd(I){return qi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pd extends Ni{constructor(c){super();Ri(this,c,nd,od,Xi,{})}}export{pd as default,sd as metadata};
