import{s as ar,f as ir,o as lr,n as dt}from"../chunks/scheduler.25b97de1.js";import{S as cr,i as dr,g as l,s as o,r as m,A as pr,h as c,f as r,c as n,j as P,u as g,x as M,k as $,y as a,a as s,v as f,d as h,t as u,w as _}from"../chunks/index.d9030fc9.js";import{T as nr}from"../chunks/Tip.baa67368.js";import{D as W}from"../chunks/Docstring.e257edda.js";import{C as Rt}from"../chunks/CodeBlock.e6cd0d95.js";import{E as sr}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as Q,E as mr}from"../chunks/EditOnGithub.91d95064.js";function gr(R){let i,v="Example:",p,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,p=o(),m(b.$$.fragment)},l(d){i=c(d,"P",{"data-svelte-h":!0}),M(i)!=="svelte-11lpom8"&&(i.textContent=v),p=n(d),g(b.$$.fragment,d)},m(d,y){s(d,i,y),s(d,p,y),f(b,d,y),T=!0},p:dt,i(d){T||(h(b.$$.fragment,d),T=!0)},o(d){u(b.$$.fragment,d),T=!1},d(d){d&&(r(i),r(p)),_(b,d)}}}function fr(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(p){i=c(p,"P",{"data-svelte-h":!0}),M(i)!=="svelte-fincs2"&&(i.innerHTML=v)},m(p,b){s(p,i,b)},p:dt,d(p){p&&r(i)}}}function hr(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(p){i=c(p,"P",{"data-svelte-h":!0}),M(i)!=="svelte-fincs2"&&(i.innerHTML=v)},m(p,b){s(p,i,b)},p:dt,d(p){p&&r(i)}}}function ur(R){let i,v="Example:",p,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,p=o(),m(b.$$.fragment)},l(d){i=c(d,"P",{"data-svelte-h":!0}),M(i)!=="svelte-11lpom8"&&(i.textContent=v),p=n(d),g(b.$$.fragment,d)},m(d,y){s(d,i,y),s(d,p,y),f(b,d,y),T=!0},p:dt,i(d){T||(h(b.$$.fragment,d),T=!0)},o(d){u(b.$$.fragment,d),T=!1},d(d){d&&(r(i),r(p)),_(b,d)}}}function _r(R){let i,v,p,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.',Le,q,It="The abstract from the paper is the following:",He,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,Lt=`MGP-STR is trained on two synthetic datasets <a href="(http://www.robots.ox.ac.uk/~vgg/data/text/)">MJSynth</a> (MJ) and <a href="http://www.robots.ox.ac.uk/~vgg/data/scenetext/" rel="nofollow">SynthText</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).
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>.`,Ee,O,Qe,K,Ht=`<a href="/docs/transformers/pr_30530/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.`,Xe,ee,Ft=`The <a href="/docs/transformers/pr_30530/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> class is responsible for preprocessing the input image and
<a href="/docs/transformers/pr_30530/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a> decodes the generated character tokens to the target string. The
<a href="/docs/transformers/pr_30530/en/model_doc/mgp-str#transformers.MgpstrProcessor">MgpstrProcessor</a> wraps <a href="/docs/transformers/pr_30530/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> and <a href="/docs/transformers/pr_30530/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.`,qe,te,Nt="<li>Step-by-step Optical Character Recognition (OCR)</li>",Ye,re,Ae,oe,De,x,ne,pt,be,Bt=`This is the configuration class to store the configuration of an <a href="/docs/transformers/pr_30530/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.`,mt,Te,Et=`Configuration objects inherit from <a href="/docs/transformers/pr_30530/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/pr_30530/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,gt,V,Oe,se,Ke,k,ae,ft,ve,Qt="Construct a MGP-STR char tokenizer.",ht,ye,Xt=`This tokenizer inherits from <a href="/docs/transformers/pr_30530/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,ie,et,le,tt,w,ce,_t,$e,qt="Constructs a MGP-STR processor which wraps an image processor and MGP-STR tokenizers into a single",Mt,xe,Yt=`<a href="/docs/transformers/pr_30530/en/model_doc/mgp-str#transformers.MgpstrProcessor">MgpstrProcessor</a> offers all the functionalities of <code>ViTImageProcessor</code>] and <a href="/docs/transformers/pr_30530/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a>. See the
<a href="/docs/transformers/pr_30530/en/model_doc/mgp-str#transformers.MgpstrProcessor.__call__"><strong>call</strong>()</a> and <a href="/docs/transformers/pr_30530/en/model_doc/mgp-str#transformers.MgpstrProcessor.batch_decode">batch_decode()</a> for more information.`,bt,L,de,Tt,ke,At=`When used in normal mode, this method forwards all its arguments to ViTImageProcessor’s
<a href="/docs/transformers/pr_30530/en/model_doc/levit#transformers.LevitFeatureExtractor.__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/pr_30530/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__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,Dt="Convert a list of lists of token ids into a list of strings by calling decode.",wt,Ce,Ot=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/pr_30530/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,rt,me,ot,S,ge,$t,ze,Kt=`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,fe,kt,Pe,er='The <a href="/docs/transformers/pr_30530/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a> forward method, overrides the <code>__call__</code> special method.',jt,H,nt,he,st,j,ue,Ct,Se,tr=`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,Ue,rr=`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.`,Pt,z,_e,St,Je,or='The <a href="/docs/transformers/pr_30530/en/model_doc/mgp-str#transformers.MgpstrForSceneTextRecognition">MgpstrForSceneTextRecognition</a> forward method, overrides the <code>__call__</code> special method.',Ut,F,Jt,N,at,Me,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"}}),O=new Q({props:{title:"Inference example",local:"inference-example",headingTag:"h2"}}),re=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}}),oe=new Q({props:{title:"MgpstrConfig",local:"transformers.MgpstrConfig",headingTag:"h2"}}),ne=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/vr_30530/src/transformers/models/mgp_str/configuration_mgp_str.py#L24"}}),V=new sr({props:{anchor:"transformers.MgpstrConfig.example",$$slots:{default:[gr]},$$scope:{ctx:R}}}),se=new Q({props:{title:"MgpstrTokenizer",local:"transformers.MgpstrTokenizer",headingTag:"h2"}}),ae=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/vr_30530/src/transformers/models/mgp_str/tokenization_mgp_str.py#L30"}}),ie=new W({props:{name:"save_vocabulary",anchor:"transformers.MgpstrTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/mgp_str/tokenization_mgp_str.py#L90"}}),le=new Q({props:{title:"MgpstrProcessor",local:"transformers.MgpstrProcessor",headingTag:"h2"}}),ce=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/pr_30530/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/vr_30530/src/transformers/models/mgp_str/processing_mgp_str.py#L39"}}),de=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/vr_30530/src/transformers/models/mgp_str/processing_mgp_str.py#L79"}}),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/vr_30530/src/transformers/models/mgp_str/processing_mgp_str.py#L102",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>
`}}),me=new Q({props:{title:"MgpstrModel",local:"transformers.MgpstrModel",headingTag:"h2"}}),ge=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/pr_30530/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/pr_30530/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/vr_30530/src/transformers/models/mgp_str/modeling_mgp_str.py#L360"}}),fe=new W({props:{name:"forward",anchor:"transformers.MgpstrModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30530/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30530/en/model_doc/levit#transformers.LevitFeatureExtractor.__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/pr_30530/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_30530/src/transformers/models/mgp_str/modeling_mgp_str.py#L374"}}),H=new nr({props:{$$slots:{default:[fr]},$$scope:{ctx:R}}}),he=new Q({props:{title:"MgpstrForSceneTextRecognition",local:"transformers.MgpstrForSceneTextRecognition",headingTag:"h2"}}),ue=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/pr_30530/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/pr_30530/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/vr_30530/src/transformers/models/mgp_str/modeling_mgp_str.py#L409"}}),_e=new W({props:{name:"forward",anchor:"transformers.MgpstrForSceneTextRecognition.forward",parameters:[{name:"pixel_values",val:": FloatTensor"},{name:"output_attentions",val:": Optional = None"},{name:"output_a3_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = 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/pr_30530/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/pr_30530/en/model_doc/levit#transformers.LevitFeatureExtractor.__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/pr_30530/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/vr_30530/src/transformers/models/mgp_str/modeling_mgp_str.py#L434",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 nr({props:{$$slots:{default:[hr]},$$scope:{ctx:R}}}),N=new sr({props:{anchor:"transformers.MgpstrForSceneTextRecognition.forward.example",$$slots:{default:[ur]},$$scope:{ctx:R}}}),Me=new mr({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/mgp-str.md"}}),{c(){i=l("meta"),v=o(),p=l("p"),b=o(),m(T.$$.fragment),d=o(),m(y.$$.fragment),Ve=o(),X=l("p"),X.innerHTML=Zt,Le=o(),q=l("p"),q.textContent=It,He=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.innerHTML=Lt,Ee=o(),m(O.$$.fragment),Qe=o(),K=l("p"),K.innerHTML=Ht,Xe=o(),ee=l("p"),ee.innerHTML=Ft,qe=o(),te=l("ul"),te.innerHTML=Nt,Ye=o(),m(re.$$.fragment),Ae=o(),m(oe.$$.fragment),De=o(),x=l("div"),m(ne.$$.fragment),pt=o(),be=l("p"),be.innerHTML=Bt,mt=o(),Te=l("p"),Te.innerHTML=Et,gt=o(),m(V.$$.fragment),Oe=o(),m(se.$$.fragment),Ke=o(),k=l("div"),m(ae.$$.fragment),ft=o(),ve=l("p"),ve.textContent=Qt,ht=o(),ye=l("p"),ye.innerHTML=Xt,ut=o(),we=l("div"),m(ie.$$.fragment),et=o(),m(le.$$.fragment),tt=o(),w=l("div"),m(ce.$$.fragment),_t=o(),$e=l("p"),$e.textContent=qt,Mt=o(),xe=l("p"),xe.innerHTML=Yt,bt=o(),L=l("div"),m(de.$$.fragment),Tt=o(),ke=l("p"),ke.innerHTML=At,vt=o(),Z=l("div"),m(pe.$$.fragment),yt=o(),je=l("p"),je.textContent=Dt,wt=o(),Ce=l("p"),Ce.innerHTML=Ot,rt=o(),m(me.$$.fragment),ot=o(),S=l("div"),m(ge.$$.fragment),$t=o(),ze=l("p"),ze.innerHTML=Kt,xt=o(),I=l("div"),m(fe.$$.fragment),kt=o(),Pe=l("p"),Pe.innerHTML=er,jt=o(),m(H.$$.fragment),nt=o(),m(he.$$.fragment),st=o(),j=l("div"),m(ue.$$.fragment),Ct=o(),Se=l("p"),Se.textContent=tr,zt=o(),Ue=l("p"),Ue.innerHTML=rr,Pt=o(),z=l("div"),m(_e.$$.fragment),St=o(),Je=l("p"),Je.innerHTML=or,Ut=o(),m(F.$$.fragment),Jt=o(),m(N.$$.fragment),at=o(),m(Me.$$.fragment),it=o(),We=l("p"),this.h()},l(e){const t=pr("svelte-u9bgzb",document.head);i=c(t,"META",{name:!0,content:!0}),t.forEach(r),v=n(e),p=c(e,"P",{}),P(p).forEach(r),b=n(e),g(T.$$.fragment,e),d=n(e),g(y.$$.fragment,e),Ve=n(e),X=c(e,"P",{"data-svelte-h":!0}),M(X)!=="svelte-1ojswm7"&&(X.innerHTML=Zt),Le=n(e),q=c(e,"P",{"data-svelte-h":!0}),M(q)!=="svelte-vfdo9a"&&(q.textContent=It),He=n(e),Y=c(e,"P",{"data-svelte-h":!0}),M(Y)!=="svelte-1h9gawp"&&(Y.innerHTML=Wt),Fe=n(e),G=c(e,"IMG",{src:!0,alt:!0,width:!0}),Ne=n(e),A=c(e,"SMALL",{"data-svelte-h":!0}),M(A)!=="svelte-13av33i"&&(A.innerHTML=Vt),Be=n(e),D=c(e,"P",{"data-svelte-h":!0}),M(D)!=="svelte-codc7u"&&(D.innerHTML=Lt),Ee=n(e),g(O.$$.fragment,e),Qe=n(e),K=c(e,"P",{"data-svelte-h":!0}),M(K)!=="svelte-13g3w2v"&&(K.innerHTML=Ht),Xe=n(e),ee=c(e,"P",{"data-svelte-h":!0}),M(ee)!=="svelte-tiay28"&&(ee.innerHTML=Ft),qe=n(e),te=c(e,"UL",{"data-svelte-h":!0}),M(te)!=="svelte-1noonjl"&&(te.innerHTML=Nt),Ye=n(e),g(re.$$.fragment,e),Ae=n(e),g(oe.$$.fragment,e),De=n(e),x=c(e,"DIV",{class:!0});var U=P(x);g(ne.$$.fragment,U),pt=n(U),be=c(U,"P",{"data-svelte-h":!0}),M(be)!=="svelte-1ue2bn0"&&(be.innerHTML=Bt),mt=n(U),Te=c(U,"P",{"data-svelte-h":!0}),M(Te)!=="svelte-l1blo3"&&(Te.innerHTML=Et),gt=n(U),g(V.$$.fragment,U),U.forEach(r),Oe=n(e),g(se.$$.fragment,e),Ke=n(e),k=c(e,"DIV",{class:!0});var J=P(k);g(ae.$$.fragment,J),ft=n(J),ve=c(J,"P",{"data-svelte-h":!0}),M(ve)!=="svelte-17nyefl"&&(ve.textContent=Qt),ht=n(J),ye=c(J,"P",{"data-svelte-h":!0}),M(ye)!=="svelte-1ybv3az"&&(ye.innerHTML=Xt),ut=n(J),we=c(J,"DIV",{class:!0});var Ge=P(we);g(ie.$$.fragment,Ge),Ge.forEach(r),J.forEach(r),et=n(e),g(le.$$.fragment,e),tt=n(e),w=c(e,"DIV",{class:!0});var C=P(w);g(ce.$$.fragment,C),_t=n(C),$e=c(C,"P",{"data-svelte-h":!0}),M($e)!=="svelte-yv8e6v"&&($e.textContent=qt),Mt=n(C),xe=c(C,"P",{"data-svelte-h":!0}),M(xe)!=="svelte-1kc7tvy"&&(xe.innerHTML=Yt),bt=n(C),L=c(C,"DIV",{class:!0});var ct=P(L);g(de.$$.fragment,ct),Tt=n(ct),ke=c(ct,"P",{"data-svelte-h":!0}),M(ke)!=="svelte-1a8hfy7"&&(ke.innerHTML=At),ct.forEach(r),vt=n(C),Z=c(C,"DIV",{class:!0});var Re=P(Z);g(pe.$$.fragment,Re),yt=n(Re),je=c(Re,"P",{"data-svelte-h":!0}),M(je)!=="svelte-1deng2j"&&(je.textContent=Dt),wt=n(Re),Ce=c(Re,"P",{"data-svelte-h":!0}),M(Ce)!=="svelte-86uk2u"&&(Ce.innerHTML=Ot),Re.forEach(r),C.forEach(r),rt=n(e),g(me.$$.fragment,e),ot=n(e),S=c(e,"DIV",{class:!0});var Ze=P(S);g(ge.$$.fragment,Ze),$t=n(Ze),ze=c(Ze,"P",{"data-svelte-h":!0}),M(ze)!=="svelte-1j8rfbn"&&(ze.innerHTML=Kt),xt=n(Ze),I=c(Ze,"DIV",{class:!0});var Ie=P(I);g(fe.$$.fragment,Ie),kt=n(Ie),Pe=c(Ie,"P",{"data-svelte-h":!0}),M(Pe)!=="svelte-8i8qjy"&&(Pe.innerHTML=er),jt=n(Ie),g(H.$$.fragment,Ie),Ie.forEach(r),Ze.forEach(r),nt=n(e),g(he.$$.fragment,e),st=n(e),j=c(e,"DIV",{class:!0});var B=P(j);g(ue.$$.fragment,B),Ct=n(B),Se=c(B,"P",{"data-svelte-h":!0}),M(Se)!=="svelte-10o23m7"&&(Se.textContent=tr),zt=n(B),Ue=c(B,"P",{"data-svelte-h":!0}),M(Ue)!=="svelte-1gjh92c"&&(Ue.innerHTML=rr),Pt=n(B),z=c(B,"DIV",{class:!0});var E=P(z);g(_e.$$.fragment,E),St=n(E),Je=c(E,"P",{"data-svelte-h":!0}),M(Je)!=="svelte-w47t12"&&(Je.innerHTML=or),Ut=n(E),g(F.$$.fragment,E),Jt=n(E),g(N.$$.fragment,E),E.forEach(r),B.forEach(r),at=n(e),g(Me.$$.fragment,e),it=n(e),We=c(e,"P",{}),P(We).forEach(r),this.h()},h(){$(i,"name","hf:doc:metadata"),$(i,"content",Mr),ir(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"),$(L,"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"),$(S,"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,p,t),s(e,b,t),f(T,e,t),s(e,d,t),f(y,e,t),s(e,Ve,t),s(e,X,t),s(e,Le,t),s(e,q,t),s(e,He,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),f(O,e,t),s(e,Qe,t),s(e,K,t),s(e,Xe,t),s(e,ee,t),s(e,qe,t),s(e,te,t),s(e,Ye,t),f(re,e,t),s(e,Ae,t),f(oe,e,t),s(e,De,t),s(e,x,t),f(ne,x,null),a(x,pt),a(x,be),a(x,mt),a(x,Te),a(x,gt),f(V,x,null),s(e,Oe,t),f(se,e,t),s(e,Ke,t),s(e,k,t),f(ae,k,null),a(k,ft),a(k,ve),a(k,ht),a(k,ye),a(k,ut),a(k,we),f(ie,we,null),s(e,et,t),f(le,e,t),s(e,tt,t),s(e,w,t),f(ce,w,null),a(w,_t),a(w,$e),a(w,Mt),a(w,xe),a(w,bt),a(w,L),f(de,L,null),a(L,Tt),a(L,ke),a(w,vt),a(w,Z),f(pe,Z,null),a(Z,yt),a(Z,je),a(Z,wt),a(Z,Ce),s(e,rt,t),f(me,e,t),s(e,ot,t),s(e,S,t),f(ge,S,null),a(S,$t),a(S,ze),a(S,xt),a(S,I),f(fe,I,null),a(I,kt),a(I,Pe),a(I,jt),f(H,I,null),s(e,nt,t),f(he,e,t),s(e,st,t),s(e,j,t),f(ue,j,null),a(j,Ct),a(j,Se),a(j,zt),a(j,Ue),a(j,Pt),a(j,z),f(_e,z,null),a(z,St),a(z,Je),a(z,Ut),f(F,z,null),a(z,Jt),f(N,z,null),s(e,at,t),f(Me,e,t),s(e,it,t),s(e,We,t),lt=!0},p(e,[t]){const U={};t&2&&(U.$$scope={dirty:t,ctx:e}),V.$set(U);const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),H.$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||(h(T.$$.fragment,e),h(y.$$.fragment,e),h(O.$$.fragment,e),h(re.$$.fragment,e),h(oe.$$.fragment,e),h(ne.$$.fragment,e),h(V.$$.fragment,e),h(se.$$.fragment,e),h(ae.$$.fragment,e),h(ie.$$.fragment,e),h(le.$$.fragment,e),h(ce.$$.fragment,e),h(de.$$.fragment,e),h(pe.$$.fragment,e),h(me.$$.fragment,e),h(ge.$$.fragment,e),h(fe.$$.fragment,e),h(H.$$.fragment,e),h(he.$$.fragment,e),h(ue.$$.fragment,e),h(_e.$$.fragment,e),h(F.$$.fragment,e),h(N.$$.fragment,e),h(Me.$$.fragment,e),lt=!0)},o(e){u(T.$$.fragment,e),u(y.$$.fragment,e),u(O.$$.fragment,e),u(re.$$.fragment,e),u(oe.$$.fragment,e),u(ne.$$.fragment,e),u(V.$$.fragment,e),u(se.$$.fragment,e),u(ae.$$.fragment,e),u(ie.$$.fragment,e),u(le.$$.fragment,e),u(ce.$$.fragment,e),u(de.$$.fragment,e),u(pe.$$.fragment,e),u(me.$$.fragment,e),u(ge.$$.fragment,e),u(fe.$$.fragment,e),u(H.$$.fragment,e),u(he.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(F.$$.fragment,e),u(N.$$.fragment,e),u(Me.$$.fragment,e),lt=!1},d(e){e&&(r(v),r(p),r(b),r(d),r(Ve),r(X),r(Le),r(q),r(He),r(Y),r(Fe),r(G),r(Ne),r(A),r(Be),r(D),r(Ee),r(Qe),r(K),r(Xe),r(ee),r(qe),r(te),r(Ye),r(Ae),r(De),r(x),r(Oe),r(Ke),r(k),r(et),r(tt),r(w),r(rt),r(ot),r(S),r(nt),r(st),r(j),r(at),r(it),r(We)),r(i),_(T,e),_(y,e),_(O,e),_(re,e),_(oe,e),_(ne),_(V),_(se,e),_(ae),_(ie),_(le,e),_(ce),_(de),_(pe),_(me,e),_(ge),_(fe),_(H),_(he,e),_(ue),_(_e),_(F),_(N),_(Me,e)}}}const Mr='{"title":"MGP-STR","local":"mgp-str","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Inference example","local":"inference-example","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 br(R){return lr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class jr extends cr{constructor(i){super(),dr(this,i,br,_r,ar,{})}}export{jr as component};
