import{s as ln,f as cn,o as dn,n as dt}from"../chunks/scheduler.9bc65507.js";import{S as mn,i as pn,g as l,s as o,r as g,A as gn,h as c,f as n,c as r,j as S,u as f,x as p,k as $,y as a,a as s,v as h,d as u,t as _,w as M}from"../chunks/index.707bf1b6.js";import{T as sn}from"../chunks/Tip.c2ecdbf4.js";import{D as W}from"../chunks/Docstring.17db21ae.js";import{C as Rt}from"../chunks/CodeBlock.54a9f38d.js";import{E as an}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{H as Q}from"../chunks/Heading.342b1fa6.js";function fn(R){let i,v="Example:",m,b,T;return b=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1ncHN0ckNvbmZpZyUyQyUyME1ncHN0ckZvclNjZW5lVGV4dFJlY29nbml0aW9uJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyME1ncHN0ciUyMG1ncC1zdHItYmFzZSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBNZ3BzdHJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwbWdwLXN0ci1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBNZ3BzdHJGb3JTY2VuZVRleHRSZWNvZ25pdGlvbihjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MgpstrConfig, MgpstrForSceneTextRecognition

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a Mgpstr mgp-str-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MgpstrConfig()

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`,wrap:!1}}),{c(){i=l("p"),i.textContent=v,m=o(),g(b.$$.fragment)},l(d){i=c(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-11lpom8"&&(i.textContent=v),m=r(d),f(b.$$.fragment,d)},m(d,y){s(d,i,y),s(d,m,y),h(b,d,y),T=!0},p:dt,i(d){T||(u(b.$$.fragment,d),T=!0)},o(d){_(b.$$.fragment,d),T=!1},d(d){d&&(n(i),n(m)),M(b,d)}}}function hn(R){let i,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=v},l(m){i=c(m,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=v)},m(m,b){s(m,i,b)},p:dt,d(m){m&&n(i)}}}function un(R){let i,v=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=v},l(m){i=c(m,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=v)},m(m,b){s(m,i,b)},p:dt,d(m){m&&n(i)}}}function _n(R){let i,v="Example:",m,b,T;return b=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMCglMEElMjAlMjAlMjAlMjBNZ3BzdHJQcm9jZXNzb3IlMkMlMEElMjAlMjAlMjAlMjBNZ3BzdHJGb3JTY2VuZVRleHRSZWNvZ25pdGlvbiUyQyUwQSklMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQSUwQSUyMyUyMGxvYWQlMjBpbWFnZSUyMGZyb20lMjB0aGUlMjBJSUlULTVrJTIwZGF0YXNldCUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaS5wb3N0aW1nLmNjJTJGWkt3TGcyR3clMkYzNjctMTQucG5nJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQXByb2Nlc3NvciUyMCUzRCUyME1ncHN0clByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyYWxpYmFiYS1kYW1vJTJGbWdwLXN0ci1iYXNlJTIyKSUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQSUwQW1vZGVsJTIwJTNEJTIwTWdwc3RyRm9yU2NlbmVUZXh0UmVjb2duaXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmFsaWJhYmEtZGFtbyUyRm1ncC1zdHItYmFzZSUyMiklMEElMEElMjMlMjBpbmZlcmVuY2UlMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwocGl4ZWxfdmFsdWVzKSUwQW91dF9zdHJzJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShvdXRwdXRzLmxvZ2l0cyklMEFvdXRfc3RycyU1QiUyMmdlbmVyYXRlZF90ZXh0JTIyJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    MgpstrProcessor,
<span class="hljs-meta">... </span>    MgpstrForSceneTextRecognition,
<span class="hljs-meta">... </span>)
<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><span class="hljs-comment"># load image from the IIIT-5k dataset</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://i.postimg.cc/ZKwLg2Gw/367-14.png&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).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = MgpstrProcessor.from_pretrained(<span class="hljs-string">&quot;alibaba-damo/mgp-str-base&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>model = MgpstrForSceneTextRecognition.from_pretrained(<span class="hljs-string">&quot;alibaba-damo/mgp-str-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(pixel_values)
<span class="hljs-meta">&gt;&gt;&gt; </span>out_strs = processor.batch_decode(outputs.logits)
<span class="hljs-meta">&gt;&gt;&gt; </span>out_strs[<span class="hljs-string">&quot;generated_text&quot;</span>]
<span class="hljs-string">&#x27;[&quot;ticket&quot;]&#x27;</span>`,wrap:!1}}),{c(){i=l("p"),i.textContent=v,m=o(),g(b.$$.fragment)},l(d){i=c(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-11lpom8"&&(i.textContent=v),m=r(d),f(b.$$.fragment,d)},m(d,y){s(d,i,y),s(d,m,y),h(b,d,y),T=!0},p:dt,i(d){T||(u(b.$$.fragment,d),T=!0)},o(d){_(b.$$.fragment,d),T=!1},d(d){d&&(n(i),n(m)),M(b,d)}}}function Mn(R){let i,v,m,b,T,d,y,Ve,X,Zt='The MGP-STR model was proposed in <a href="https://arxiv.org/abs/2209.03592" rel="nofollow">Multi-Granularity Prediction for Scene Text Recognition</a> by Peng Wang, Cheng Da, and Cong Yao. MGP-STR is a conceptually <strong>simple</strong> yet <strong>powerful</strong> vision Scene Text Recognition (STR) model, which is built upon the <a href="vit">Vision Transformer (ViT)</a>. To integrate linguistic knowledge, Multi-Granularity Prediction (MGP) strategy is proposed to inject information from the language modality into the model in an implicit way.',He,q,It="The abstract from the paper is the following:",Le,Y,Wt="<em>Scene text recognition (STR) has been an active research topic in computer vision for years. To tackle this challenging problem, numerous innovative methods have been successively proposed and incorporating linguistic knowledge into STR models has recently become a prominent trend. In this work, we first draw inspiration from the recent progress in Vision Transformer (ViT) to construct a conceptually simple yet powerful vision STR model, which is built upon ViT and outperforms previous state-of-the-art models for scene text recognition, including both pure vision models and language-augmented methods. To integrate linguistic knowledge, we further propose a Multi-Granularity Prediction strategy to inject information from the language modality into the model in an implicit way, i.e. , subword representations (BPE and WordPiece) widely-used in NLP are introduced into the output space, in addition to the conventional character level representation, while no independent language model (LM) is adopted. The resultant algorithm (termed MGP-STR) is able to push the performance envelop of STR to an even higher level. Specifically, it achieves an average recognition accuracy of 93.35% on standard benchmarks.</em>",Fe,G,Gt,Ne,A,Vt='MGP-STR architecture. Taken from the <a href="https://arxiv.org/abs/2209.03592">original paper</a>.',Be,D,Ht="Tips:",Ee,O,Lt='<li>MGP-STR is trained on two synthetic datasets <a href="(http://www.robots.ox.ac.uk/~vgg/data/text/)">MJSynth</a> (MJ) and SynthText(<a href="http://www.robots.ox.ac.uk/~vgg/data/scenetext/" rel="nofollow">http://www.robots.ox.ac.uk/~vgg/data/scenetext/</a>) (ST) without fine-tuning on other datasets. It achieves state-of-the-art results on six standard Latin scene text benchmarks, including 3 regular text datasets (IC13, SVT, IIIT) and 3 irregular ones (IC15, SVTP, CUTE).</li> <li>This model was contributed by <a href="https://huggingface.co/yuekun" rel="nofollow">yuekun</a>. The original code can be found <a href="https://github.com/AlibabaResearch/AdvancedLiterateMachinery/tree/main/OCR/MGP-STR" rel="nofollow">here</a>.</li>',Qe,K,Xe,ee,Ft=`<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a> accepts images as input and generates three types of predictions, which represent textual information at different granularities.
The three types of predictions are fused to give the final prediction result.`,qe,te,Nt=`The <a href="/docs/transformers/main/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> class is responsible for preprocessing the input image and
<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a> decodes the generated character tokens to the target string. The
<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrProcessor">MgpstrProcessor</a> wraps <a href="/docs/transformers/main/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> and <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a>
into a single instance to both extract the input features and decode the predicted token ids.`,Ye,ne,Bt="<li>Step-by-step Optical Character Recognition (OCR)</li>",Ae,oe,De,re,Oe,x,se,mt,be,Et=`This is the configuration class to store the configuration of an <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a>. It is used to instantiate an
MGP-STR 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 MGP-STR
<a href="https://huggingface.co/alibaba-damo/mgp-str-base" rel="nofollow">alibaba-damo/mgp-str-base</a> architecture.`,pt,Te,Qt=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,gt,V,Ke,ae,et,k,ie,ft,ve,Xt="Construct a MGP-STR char tokenizer.",ht,ye,qt=`This tokenizer inherits from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`,ut,we,le,tt,ce,nt,w,de,_t,$e,Yt="Constructs a MGP-STR processor which wraps an image processor and MGP-STR tokenizers into a single",Mt,xe,At=`<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrProcessor">MgpstrProcessor</a> offers all the functionalities of <code>ViTImageProcessor</code>] and <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a>. See the
<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrProcessor.__call__"><strong>call</strong>()</a> and <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrProcessor.batch_decode">batch_decode()</a> for more information.`,bt,H,me,Tt,ke,Dt=`When used in normal mode, this method forwards all its arguments to ViTImageProcessor’s
<a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__"><strong>call</strong>()</a> and returns its output. This method also forwards the <code>text</code> and <code>kwargs</code>
arguments to MgpstrTokenizer’s <a href="/docs/transformers/main/en/model_doc/vits#transformers.VitsTokenizer.__call__"><strong>call</strong>()</a> if <code>text</code> is not <code>None</code> to encode the text. Please
refer to the doctsring of the above methods for more information.`,vt,Z,pe,yt,je,Ot="Convert a list of lists of token ids into a list of strings by calling decode.",wt,Ce,Kt=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/main/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,ot,ge,rt,U,fe,$t,ze,en=`The bare MGP-STR Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,xt,I,he,kt,Se,tn='The <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a> forward method, overrides the <code>__call__</code> special method.',jt,L,st,ue,at,j,_e,Ct,Ue,nn=`MGP-STR Model transformer with three classification heads on top (three A^3 modules and three linear layer on top
of the transformer encoder output) for scene text recognition (STR) .`,zt,Pe,on=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`,St,z,Me,Ut,Je,rn='The <a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrForSceneTextRecognition">MgpstrForSceneTextRecognition</a> forward method, overrides the <code>__call__</code> special method.',Pt,F,Jt,N,it,We,lt;return T=new Q({props:{title:"MGP-STR",local:"mgp-str",headingTag:"h1"}}),y=new Q({props:{title:"Overview",local:"overview",headingTag:"h2"}}),K=new Q({props:{title:"Inference",local:"inference",headingTag:"h2"}}),oe=new Rt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1ncHN0clByb2Nlc3NvciUyQyUyME1ncHN0ckZvclNjZW5lVGV4dFJlY29nbml0aW9uJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBNZ3BzdHJQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCdhbGliYWJhLWRhbW8lMkZtZ3Atc3RyLWJhc2UnKSUwQW1vZGVsJTIwJTNEJTIwTWdwc3RyRm9yU2NlbmVUZXh0UmVjb2duaXRpb24uZnJvbV9wcmV0cmFpbmVkKCdhbGliYWJhLWRhbW8lMkZtZ3Atc3RyLWJhc2UnKSUwQSUwQSUyMyUyMGxvYWQlMjBpbWFnZSUyMGZyb20lMjB0aGUlMjBJSUlULTVrJTIwZGF0YXNldCUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaS5wb3N0aW1nLmNjJTJGWkt3TGcyR3clMkYzNjctMTQucG5nJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQSUwQXBpeGVsX3ZhbHVlcyUyMCUzRCUyMHByb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnBpeGVsX3ZhbHVlcyUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChwaXhlbF92YWx1ZXMpJTBBJTBBZ2VuZXJhdGVkX3RleHQlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKG91dHB1dHMubG9naXRzKSU1QidnZW5lcmF0ZWRfdGV4dCclNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MgpstrProcessor, MgpstrForSceneTextRecognition
<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 = MgpstrProcessor.from_pretrained(<span class="hljs-string">&#x27;alibaba-damo/mgp-str-base&#x27;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MgpstrForSceneTextRecognition.from_pretrained(<span class="hljs-string">&#x27;alibaba-damo/mgp-str-base&#x27;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load image from the IIIT-5k dataset</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://i.postimg.cc/ZKwLg2Gw/367-14.png&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).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>outputs = model(pixel_values)

<span class="hljs-meta">&gt;&gt;&gt; </span>generated_text = processor.batch_decode(outputs.logits)[<span class="hljs-string">&#x27;generated_text&#x27;</span>]`,wrap:!1}}),re=new Q({props:{title:"MgpstrConfig",local:"transformers.MgpstrConfig",headingTag:"h2"}}),se=new W({props:{name:"class transformers.MgpstrConfig",anchor:"transformers.MgpstrConfig",parameters:[{name:"image_size",val:" = [32, 128]"},{name:"patch_size",val:" = 4"},{name:"num_channels",val:" = 3"},{name:"max_token_length",val:" = 27"},{name:"num_character_labels",val:" = 38"},{name:"num_bpe_labels",val:" = 50257"},{name:"num_wordpiece_labels",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"mlp_ratio",val:" = 4.0"},{name:"qkv_bias",val:" = True"},{name:"distilled",val:" = False"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"drop_rate",val:" = 0.0"},{name:"attn_drop_rate",val:" = 0.0"},{name:"drop_path_rate",val:" = 0.0"},{name:"output_a3_attentions",val:" = False"},{name:"initializer_range",val:" = 0.02"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MgpstrConfig.image_size",description:`<strong>image_size</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[32, 128]</code>) &#x2014;
The size (resolution) of each image.`,name:"image_size"},{anchor:"transformers.MgpstrConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.MgpstrConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.MgpstrConfig.max_token_length",description:`<strong>max_token_length</strong> (<code>int</code>, <em>optional</em>, defaults to 27) &#x2014;
The max number of output tokens.`,name:"max_token_length"},{anchor:"transformers.MgpstrConfig.num_character_labels",description:`<strong>num_character_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 38) &#x2014;
The number of classes for character head .`,name:"num_character_labels"},{anchor:"transformers.MgpstrConfig.num_bpe_labels",description:`<strong>num_bpe_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 50257) &#x2014;
The number of classes for bpe head .`,name:"num_bpe_labels"},{anchor:"transformers.MgpstrConfig.num_wordpiece_labels",description:`<strong>num_wordpiece_labels</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
The number of classes for wordpiece head .`,name:"num_wordpiece_labels"},{anchor:"transformers.MgpstrConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
The embedding dimension.`,name:"hidden_size"},{anchor:"transformers.MgpstrConfig.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.MgpstrConfig.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.MgpstrConfig.mlp_ratio",description:`<strong>mlp_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
The ratio of mlp hidden dim to embedding dim.`,name:"mlp_ratio"},{anchor:"transformers.MgpstrConfig.qkv_bias",description:`<strong>qkv_bias</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a bias to the queries, keys and values.`,name:"qkv_bias"},{anchor:"transformers.MgpstrConfig.distilled",description:`<strong>distilled</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Model includes a distillation token and head as in DeiT models.`,name:"distilled"},{anchor:"transformers.MgpstrConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-05) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.MgpstrConfig.drop_rate",description:`<strong>drop_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder.`,name:"drop_rate"},{anchor:"transformers.MgpstrConfig.attn_drop_rate",description:`<strong>attn_drop_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attn_drop_rate"},{anchor:"transformers.MgpstrConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The stochastic depth rate.`,name:"drop_path_rate"},{anchor:"transformers.MgpstrConfig.output_a3_attentions",description:`<strong>output_a3_attentions</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should returns A^3 module attentions.`,name:"output_a3_attentions"},{anchor:"transformers.MgpstrConfig.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/main/src/transformers/models/mgp_str/configuration_mgp_str.py#L28"}}),V=new an({props:{anchor:"transformers.MgpstrConfig.example",$$slots:{default:[fn]},$$scope:{ctx:R}}}),ae=new Q({props:{title:"MgpstrTokenizer",local:"transformers.MgpstrTokenizer",headingTag:"h2"}}),ie=new W({props:{name:"class transformers.MgpstrTokenizer",anchor:"transformers.MgpstrTokenizer",parameters:[{name:"vocab_file",val:""},{name:"unk_token",val:" = '[GO]'"},{name:"bos_token",val:" = '[GO]'"},{name:"eos_token",val:" = '[s]'"},{name:"pad_token",val:" = '[GO]'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MgpstrTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.MgpstrTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[GO]&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.MgpstrTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[GO]&quot;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.MgpstrTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[s]&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.MgpstrTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>, defaults to <code>&quot;[GO]&quot;</code>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation.`,name:"pad_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/tokenization_mgp_str.py#L38"}}),le=new W({props:{name:"save_vocabulary",anchor:"transformers.MgpstrTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/tokenization_mgp_str.py#L100"}}),ce=new Q({props:{title:"MgpstrProcessor",local:"transformers.MgpstrProcessor",headingTag:"h2"}}),de=new W({props:{name:"class transformers.MgpstrProcessor",anchor:"transformers.MgpstrProcessor",parameters:[{name:"image_processor",val:" = None"},{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MgpstrProcessor.image_processor",description:`<strong>image_processor</strong> (<code>ViTImageProcessor</code>, <em>optional</em>) &#x2014;
An instance of <code>ViTImageProcessor</code>. The image processor is a required input.`,name:"image_processor"},{anchor:"transformers.MgpstrProcessor.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a>, <em>optional</em>) &#x2014;
The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/processing_mgp_str.py#L39"}}),me=new W({props:{name:"__call__",anchor:"transformers.MgpstrProcessor.__call__",parameters:[{name:"text",val:" = None"},{name:"images",val:" = None"},{name:"return_tensors",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/processing_mgp_str.py#L78"}}),pe=new W({props:{name:"batch_decode",anchor:"transformers.MgpstrProcessor.batch_decode",parameters:[{name:"sequences",val:""}],parametersDescription:[{anchor:"transformers.MgpstrProcessor.batch_decode.sequences",description:`<strong>sequences</strong> (<code>torch.Tensor</code>) &#x2014;
List of tokenized input ids.`,name:"sequences"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/processing_mgp_str.py#L101",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Dictionary of all the outputs of the decoded results.
generated_text (<code>List[str]</code>): The final results after fusion of char, bpe, and wp. scores
(<code>List[float]</code>): The final scores after fusion of char, bpe, and wp. char_preds (<code>List[str]</code>): The list
of character decoded sentences. bpe_preds (<code>List[str]</code>): The list of bpe decoded sentences. wp_preds
(<code>List[str]</code>): The list of wp decoded sentences.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Dict[str, any]</code></p>
`}}),ge=new Q({props:{title:"MgpstrModel",local:"transformers.MgpstrModel",headingTag:"h2"}}),fe=new W({props:{name:"class transformers.MgpstrModel",anchor:"transformers.MgpstrModel",parameters:[{name:"config",val:": MgpstrConfig"}],parametersDescription:[{anchor:"transformers.MgpstrModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrConfig">MgpstrConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/modeling_mgp_str.py#L372"}}),he=new W({props:{name:"forward",anchor:"transformers.MgpstrModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{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.MgpstrModel.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.MgpstrModel.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.MgpstrModel.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.MgpstrModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/modeling_mgp_str.py#L382"}}),L=new sn({props:{$$slots:{default:[hn]},$$scope:{ctx:R}}}),ue=new Q({props:{title:"MgpstrForSceneTextRecognition",local:"transformers.MgpstrForSceneTextRecognition",headingTag:"h2"}}),_e=new W({props:{name:"class transformers.MgpstrForSceneTextRecognition",anchor:"transformers.MgpstrForSceneTextRecognition",parameters:[{name:"config",val:": MgpstrConfig"}],parametersDescription:[{anchor:"transformers.MgpstrForSceneTextRecognition.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/mgp-str#transformers.MgpstrConfig">MgpstrConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/modeling_mgp_str.py#L424"}}),Me=new W({props:{name:"forward",anchor:"transformers.MgpstrForSceneTextRecognition.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_a3_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.MgpstrForSceneTextRecognition.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/main/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/main/en/model_doc/deit#transformers.DeiTFeatureExtractor.__call__">ViTImageProcessor.<strong>call</strong>()</a>
for details.`,name:"pixel_values"},{anchor:"transformers.MgpstrForSceneTextRecognition.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.MgpstrForSceneTextRecognition.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.MgpstrForSceneTextRecognition.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MgpstrForSceneTextRecognition.forward.output_a3_attentions",description:`<strong>output_a3_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of a3 modules. See <code>a3_attentions</code> under returned tensors
for more detail.`,name:"output_a3_attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/mgp_str/modeling_mgp_str.py#L442",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.mgp_str.modeling_mgp_str.MgpstrModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<code>&lt;class 'transformers.models.mgp_str.configuration_mgp_str.MgpstrConfig'&gt;</code>) and inputs.</p>
<ul>
<li>
<p><strong>logits</strong> (<code>tuple(torch.FloatTensor)</code> of shape <code>(batch_size, config.num_character_labels)</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of character of shape <code>(batch_size, config.max_token_length, config.num_character_labels)</code>, + one for the output of bpe of shape <code>(batch_size, config.max_token_length, config.num_bpe_labels)</code>, + one for the output of wordpiece of shape <code>(batch_size, config.max_token_length, config.num_wordpiece_labels)</code>) .</p>
<p>Classification scores (before SoftMax) of character, bpe and wordpiece.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, config.max_token_length, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>a3_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_a3_attentions=True</code> is passed or when <code>config.output_a3_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for the attention of character, + one for the attention of bpe<code>, + one for the attention of wordpiece) of shape </code>(batch_size, config.max_token_length, sequence_length)\`.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.mgp_str.modeling_mgp_str.MgpstrModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),F=new sn({props:{$$slots:{default:[un]},$$scope:{ctx:R}}}),N=new an({props:{anchor:"transformers.MgpstrForSceneTextRecognition.forward.example",$$slots:{default:[_n]},$$scope:{ctx:R}}}),{c(){i=l("meta"),v=o(),m=l("p"),b=o(),g(T.$$.fragment),d=o(),g(y.$$.fragment),Ve=o(),X=l("p"),X.innerHTML=Zt,He=o(),q=l("p"),q.textContent=It,Le=o(),Y=l("p"),Y.innerHTML=Wt,Fe=o(),G=l("img"),Ne=o(),A=l("small"),A.innerHTML=Vt,Be=o(),D=l("p"),D.textContent=Ht,Ee=o(),O=l("ul"),O.innerHTML=Lt,Qe=o(),g(K.$$.fragment),Xe=o(),ee=l("p"),ee.innerHTML=Ft,qe=o(),te=l("p"),te.innerHTML=Nt,Ye=o(),ne=l("ul"),ne.innerHTML=Bt,Ae=o(),g(oe.$$.fragment),De=o(),g(re.$$.fragment),Oe=o(),x=l("div"),g(se.$$.fragment),mt=o(),be=l("p"),be.innerHTML=Et,pt=o(),Te=l("p"),Te.innerHTML=Qt,gt=o(),g(V.$$.fragment),Ke=o(),g(ae.$$.fragment),et=o(),k=l("div"),g(ie.$$.fragment),ft=o(),ve=l("p"),ve.textContent=Xt,ht=o(),ye=l("p"),ye.innerHTML=qt,ut=o(),we=l("div"),g(le.$$.fragment),tt=o(),g(ce.$$.fragment),nt=o(),w=l("div"),g(de.$$.fragment),_t=o(),$e=l("p"),$e.textContent=Yt,Mt=o(),xe=l("p"),xe.innerHTML=At,bt=o(),H=l("div"),g(me.$$.fragment),Tt=o(),ke=l("p"),ke.innerHTML=Dt,vt=o(),Z=l("div"),g(pe.$$.fragment),yt=o(),je=l("p"),je.textContent=Ot,wt=o(),Ce=l("p"),Ce.innerHTML=Kt,ot=o(),g(ge.$$.fragment),rt=o(),U=l("div"),g(fe.$$.fragment),$t=o(),ze=l("p"),ze.innerHTML=en,xt=o(),I=l("div"),g(he.$$.fragment),kt=o(),Se=l("p"),Se.innerHTML=tn,jt=o(),g(L.$$.fragment),st=o(),g(ue.$$.fragment),at=o(),j=l("div"),g(_e.$$.fragment),Ct=o(),Ue=l("p"),Ue.textContent=nn,zt=o(),Pe=l("p"),Pe.innerHTML=on,St=o(),z=l("div"),g(Me.$$.fragment),Ut=o(),Je=l("p"),Je.innerHTML=rn,Pt=o(),g(F.$$.fragment),Jt=o(),g(N.$$.fragment),it=o(),We=l("p"),this.h()},l(e){const t=gn("svelte-u9bgzb",document.head);i=c(t,"META",{name:!0,content:!0}),t.forEach(n),v=r(e),m=c(e,"P",{}),S(m).forEach(n),b=r(e),f(T.$$.fragment,e),d=r(e),f(y.$$.fragment,e),Ve=r(e),X=c(e,"P",{"data-svelte-h":!0}),p(X)!=="svelte-1ojswm7"&&(X.innerHTML=Zt),He=r(e),q=c(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-vfdo9a"&&(q.textContent=It),Le=r(e),Y=c(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-1h9gawp"&&(Y.innerHTML=Wt),Fe=r(e),G=c(e,"IMG",{src:!0,alt:!0,width:!0}),Ne=r(e),A=c(e,"SMALL",{"data-svelte-h":!0}),p(A)!=="svelte-13av33i"&&(A.innerHTML=Vt),Be=r(e),D=c(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-axv494"&&(D.textContent=Ht),Ee=r(e),O=c(e,"UL",{"data-svelte-h":!0}),p(O)!=="svelte-6tfeht"&&(O.innerHTML=Lt),Qe=r(e),f(K.$$.fragment,e),Xe=r(e),ee=c(e,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-v5kn8o"&&(ee.innerHTML=Ft),qe=r(e),te=c(e,"P",{"data-svelte-h":!0}),p(te)!=="svelte-xkotox"&&(te.innerHTML=Nt),Ye=r(e),ne=c(e,"UL",{"data-svelte-h":!0}),p(ne)!=="svelte-1noonjl"&&(ne.innerHTML=Bt),Ae=r(e),f(oe.$$.fragment,e),De=r(e),f(re.$$.fragment,e),Oe=r(e),x=c(e,"DIV",{class:!0});var P=S(x);f(se.$$.fragment,P),mt=r(P),be=c(P,"P",{"data-svelte-h":!0}),p(be)!=="svelte-1tz4a1x"&&(be.innerHTML=Et),pt=r(P),Te=c(P,"P",{"data-svelte-h":!0}),p(Te)!=="svelte-o55m63"&&(Te.innerHTML=Qt),gt=r(P),f(V.$$.fragment,P),P.forEach(n),Ke=r(e),f(ae.$$.fragment,e),et=r(e),k=c(e,"DIV",{class:!0});var J=S(k);f(ie.$$.fragment,J),ft=r(J),ve=c(J,"P",{"data-svelte-h":!0}),p(ve)!=="svelte-17nyefl"&&(ve.textContent=Xt),ht=r(J),ye=c(J,"P",{"data-svelte-h":!0}),p(ye)!=="svelte-1c3t5ty"&&(ye.innerHTML=qt),ut=r(J),we=c(J,"DIV",{class:!0});var Ge=S(we);f(le.$$.fragment,Ge),Ge.forEach(n),J.forEach(n),tt=r(e),f(ce.$$.fragment,e),nt=r(e),w=c(e,"DIV",{class:!0});var C=S(w);f(de.$$.fragment,C),_t=r(C),$e=c(C,"P",{"data-svelte-h":!0}),p($e)!=="svelte-yv8e6v"&&($e.textContent=Yt),Mt=r(C),xe=c(C,"P",{"data-svelte-h":!0}),p(xe)!=="svelte-21m5ls"&&(xe.innerHTML=At),bt=r(C),H=c(C,"DIV",{class:!0});var ct=S(H);f(me.$$.fragment,ct),Tt=r(ct),ke=c(ct,"P",{"data-svelte-h":!0}),p(ke)!=="svelte-1o06via"&&(ke.innerHTML=Dt),ct.forEach(n),vt=r(C),Z=c(C,"DIV",{class:!0});var Re=S(Z);f(pe.$$.fragment,Re),yt=r(Re),je=c(Re,"P",{"data-svelte-h":!0}),p(je)!=="svelte-1deng2j"&&(je.textContent=Ot),wt=r(Re),Ce=c(Re,"P",{"data-svelte-h":!0}),p(Ce)!=="svelte-pqmfqu"&&(Ce.innerHTML=Kt),Re.forEach(n),C.forEach(n),ot=r(e),f(ge.$$.fragment,e),rt=r(e),U=c(e,"DIV",{class:!0});var Ze=S(U);f(fe.$$.fragment,Ze),$t=r(Ze),ze=c(Ze,"P",{"data-svelte-h":!0}),p(ze)!=="svelte-1j8rfbn"&&(ze.innerHTML=en),xt=r(Ze),I=c(Ze,"DIV",{class:!0});var Ie=S(I);f(he.$$.fragment,Ie),kt=r(Ie),Se=c(Ie,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-hakjn5"&&(Se.innerHTML=tn),jt=r(Ie),f(L.$$.fragment,Ie),Ie.forEach(n),Ze.forEach(n),st=r(e),f(ue.$$.fragment,e),at=r(e),j=c(e,"DIV",{class:!0});var B=S(j);f(_e.$$.fragment,B),Ct=r(B),Ue=c(B,"P",{"data-svelte-h":!0}),p(Ue)!=="svelte-10o23m7"&&(Ue.textContent=nn),zt=r(B),Pe=c(B,"P",{"data-svelte-h":!0}),p(Pe)!=="svelte-1gjh92c"&&(Pe.innerHTML=on),St=r(B),z=c(B,"DIV",{class:!0});var E=S(z);f(Me.$$.fragment,E),Ut=r(E),Je=c(E,"P",{"data-svelte-h":!0}),p(Je)!=="svelte-6aw6t5"&&(Je.innerHTML=rn),Pt=r(E),f(F.$$.fragment,E),Jt=r(E),f(N.$$.fragment,E),E.forEach(n),B.forEach(n),it=r(e),We=c(e,"P",{}),S(We).forEach(n),this.h()},h(){$(i,"name","hf:doc:metadata"),$(i,"content",bn),cn(G.src,Gt="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/mgp_str_architecture.png")||$(G,"src",Gt),$(G,"alt","drawing"),$(G,"width","600"),$(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),$(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){a(document.head,i),s(e,v,t),s(e,m,t),s(e,b,t),h(T,e,t),s(e,d,t),h(y,e,t),s(e,Ve,t),s(e,X,t),s(e,He,t),s(e,q,t),s(e,Le,t),s(e,Y,t),s(e,Fe,t),s(e,G,t),s(e,Ne,t),s(e,A,t),s(e,Be,t),s(e,D,t),s(e,Ee,t),s(e,O,t),s(e,Qe,t),h(K,e,t),s(e,Xe,t),s(e,ee,t),s(e,qe,t),s(e,te,t),s(e,Ye,t),s(e,ne,t),s(e,Ae,t),h(oe,e,t),s(e,De,t),h(re,e,t),s(e,Oe,t),s(e,x,t),h(se,x,null),a(x,mt),a(x,be),a(x,pt),a(x,Te),a(x,gt),h(V,x,null),s(e,Ke,t),h(ae,e,t),s(e,et,t),s(e,k,t),h(ie,k,null),a(k,ft),a(k,ve),a(k,ht),a(k,ye),a(k,ut),a(k,we),h(le,we,null),s(e,tt,t),h(ce,e,t),s(e,nt,t),s(e,w,t),h(de,w,null),a(w,_t),a(w,$e),a(w,Mt),a(w,xe),a(w,bt),a(w,H),h(me,H,null),a(H,Tt),a(H,ke),a(w,vt),a(w,Z),h(pe,Z,null),a(Z,yt),a(Z,je),a(Z,wt),a(Z,Ce),s(e,ot,t),h(ge,e,t),s(e,rt,t),s(e,U,t),h(fe,U,null),a(U,$t),a(U,ze),a(U,xt),a(U,I),h(he,I,null),a(I,kt),a(I,Se),a(I,jt),h(L,I,null),s(e,st,t),h(ue,e,t),s(e,at,t),s(e,j,t),h(_e,j,null),a(j,Ct),a(j,Ue),a(j,zt),a(j,Pe),a(j,St),a(j,z),h(Me,z,null),a(z,Ut),a(z,Je),a(z,Pt),h(F,z,null),a(z,Jt),h(N,z,null),s(e,it,t),s(e,We,t),lt=!0},p(e,[t]){const P={};t&2&&(P.$$scope={dirty:t,ctx:e}),V.$set(P);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),L.$set(J);const Ge={};t&2&&(Ge.$$scope={dirty:t,ctx:e}),F.$set(Ge);const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),N.$set(C)},i(e){lt||(u(T.$$.fragment,e),u(y.$$.fragment,e),u(K.$$.fragment,e),u(oe.$$.fragment,e),u(re.$$.fragment,e),u(se.$$.fragment,e),u(V.$$.fragment,e),u(ae.$$.fragment,e),u(ie.$$.fragment,e),u(le.$$.fragment,e),u(ce.$$.fragment,e),u(de.$$.fragment,e),u(me.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(fe.$$.fragment,e),u(he.$$.fragment,e),u(L.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(Me.$$.fragment,e),u(F.$$.fragment,e),u(N.$$.fragment,e),lt=!0)},o(e){_(T.$$.fragment,e),_(y.$$.fragment,e),_(K.$$.fragment,e),_(oe.$$.fragment,e),_(re.$$.fragment,e),_(se.$$.fragment,e),_(V.$$.fragment,e),_(ae.$$.fragment,e),_(ie.$$.fragment,e),_(le.$$.fragment,e),_(ce.$$.fragment,e),_(de.$$.fragment,e),_(me.$$.fragment,e),_(pe.$$.fragment,e),_(ge.$$.fragment,e),_(fe.$$.fragment,e),_(he.$$.fragment,e),_(L.$$.fragment,e),_(ue.$$.fragment,e),_(_e.$$.fragment,e),_(Me.$$.fragment,e),_(F.$$.fragment,e),_(N.$$.fragment,e),lt=!1},d(e){e&&(n(v),n(m),n(b),n(d),n(Ve),n(X),n(He),n(q),n(Le),n(Y),n(Fe),n(G),n(Ne),n(A),n(Be),n(D),n(Ee),n(O),n(Qe),n(Xe),n(ee),n(qe),n(te),n(Ye),n(ne),n(Ae),n(De),n(Oe),n(x),n(Ke),n(et),n(k),n(tt),n(nt),n(w),n(ot),n(rt),n(U),n(st),n(at),n(j),n(it),n(We)),n(i),M(T,e),M(y,e),M(K,e),M(oe,e),M(re,e),M(se),M(V),M(ae,e),M(ie),M(le),M(ce,e),M(de),M(me),M(pe),M(ge,e),M(fe),M(he),M(L),M(ue,e),M(_e),M(Me),M(F),M(N)}}}const bn='{"title":"MGP-STR","local":"mgp-str","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2},{"title":"MgpstrConfig","local":"transformers.MgpstrConfig","sections":[],"depth":2},{"title":"MgpstrTokenizer","local":"transformers.MgpstrTokenizer","sections":[],"depth":2},{"title":"MgpstrProcessor","local":"transformers.MgpstrProcessor","sections":[],"depth":2},{"title":"MgpstrModel","local":"transformers.MgpstrModel","sections":[],"depth":2},{"title":"MgpstrForSceneTextRecognition","local":"transformers.MgpstrForSceneTextRecognition","sections":[],"depth":2}],"depth":1}';function Tn(R){return dn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Cn extends mn{constructor(i){super(),pn(this,i,Tn,Mn,ln,{})}}export{Cn as component};
