import{s as ro,f as so,o as ao,n as lt}from"../chunks/scheduler.9bc65507.js";import{S as io,i as lo,g as l,s as n,r as g,A as co,h as c,f as o,c as r,j as P,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 oo}from"../chunks/Tip.c2ecdbf4.js";import{D as W}from"../chunks/Docstring.17db21ae.js";import{C as Ut}from"../chunks/CodeBlock.54a9f38d.js";import{E as no}from"../chunks/ExampleCodeBlock.4f515aa9.js";import{H as Q}from"../chunks/Heading.342b1fa6.js";function mo(R){let i,T="Example:",m,b,v;return b=new Ut({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=T,m=n(),g(b.$$.fragment)},l(d){i=c(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-11lpom8"&&(i.textContent=T),m=r(d),f(b.$$.fragment,d)},m(d,w){s(d,i,w),s(d,m,w),h(b,d,w),v=!0},p:lt,i(d){v||(u(b.$$.fragment,d),v=!0)},o(d){_(b.$$.fragment,d),v=!1},d(d){d&&(o(i),o(m)),M(b,d)}}}function po(R){let i,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=T},l(m){i=c(m,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=T)},m(m,b){s(m,i,b)},p:lt,d(m){m&&o(i)}}}function go(R){let i,T=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){i=l("p"),i.innerHTML=T},l(m){i=c(m,"P",{"data-svelte-h":!0}),p(i)!=="svelte-fincs2"&&(i.innerHTML=T)},m(m,b){s(m,i,b)},p:lt,d(m){m&&o(i)}}}function fo(R){let i,T="Example:",m,b,v;return b=new Ut({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=T,m=n(),g(b.$$.fragment)},l(d){i=c(d,"P",{"data-svelte-h":!0}),p(i)!=="svelte-11lpom8"&&(i.textContent=T),m=r(d),f(b.$$.fragment,d)},m(d,w){s(d,i,w),s(d,m,w),h(b,d,w),v=!0},p:lt,i(d){v||(u(b.$$.fragment,d),v=!0)},o(d){_(b.$$.fragment,d),v=!1},d(d){d&&(o(i),o(m)),M(b,d)}}}function ho(R){let i,T,m,b,v,d,w,Ge,q,Jt='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.',Ve,X,Rt="The abstract from the paper is the following:",He,Y,Zt="<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>",Le,G,It,Fe,A,Wt='MGP-STR architecture. Taken from the <a href="https://arxiv.org/abs/2209.03592">original paper</a>.',Ne,D,Gt=`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>.`,Be,O,Ee,K,Vt=`<a href="/docs/transformers/v4.39.1/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,ee,Ht=`The <a href="/docs/transformers/v4.39.1/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> class is responsible for preprocessing the input image and
<a href="/docs/transformers/v4.39.1/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a> decodes the generated character tokens to the target string. The
<a href="/docs/transformers/v4.39.1/en/model_doc/mgp-str#transformers.MgpstrProcessor">MgpstrProcessor</a> wraps <a href="/docs/transformers/v4.39.1/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a> and <a href="/docs/transformers/v4.39.1/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,Lt="<li>Step-by-step Optical Character Recognition (OCR)</li>",Xe,oe,Ye,ne,Ae,x,re,ct,Me,Ft=`This is the configuration class to store the configuration of an <a href="/docs/transformers/v4.39.1/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.`,dt,be,Nt=`Configuration objects inherit from <a href="/docs/transformers/v4.39.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/v4.39.1/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,mt,V,De,se,Oe,k,ae,pt,ve,Bt="Construct a MGP-STR char tokenizer.",gt,Te,Et=`This tokenizer inherits from <a href="/docs/transformers/v4.39.1/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.`,ft,we,ie,Ke,le,et,y,ce,ht,ye,Qt="Constructs a MGP-STR processor which wraps an image processor and MGP-STR tokenizers into a single",ut,$e,qt=`<a href="/docs/transformers/v4.39.1/en/model_doc/mgp-str#transformers.MgpstrProcessor">MgpstrProcessor</a> offers all the functionalities of <code>ViTImageProcessor</code>] and <a href="/docs/transformers/v4.39.1/en/model_doc/mgp-str#transformers.MgpstrTokenizer">MgpstrTokenizer</a>. See the
<a href="/docs/transformers/v4.39.1/en/model_doc/mgp-str#transformers.MgpstrProcessor.__call__"><strong>call</strong>()</a> and <a href="/docs/transformers/v4.39.1/en/model_doc/mgp-str#transformers.MgpstrProcessor.batch_decode">batch_decode()</a> for more information.`,_t,H,de,Mt,xe,Xt=`When used in normal mode, this method forwards all its arguments to ViTImageProcessor’s
<a href="/docs/transformers/v4.39.1/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.39.1/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.`,bt,Z,me,vt,ke,Yt="Convert a list of lists of token ids into a list of strings by calling decode.",Tt,je,At=`This method forwards all its arguments to PreTrainedTokenizer’s <a href="/docs/transformers/v4.39.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_decode">batch_decode()</a>. Please
refer to the docstring of this method for more information.`,tt,pe,ot,S,ge,wt,Ce,Dt=`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.`,yt,I,fe,$t,ze,Ot='The <a href="/docs/transformers/v4.39.1/en/model_doc/mgp-str#transformers.MgpstrModel">MgpstrModel</a> forward method, overrides the <code>__call__</code> special method.',xt,L,nt,he,rt,j,ue,kt,Pe,Kt=`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) .`,jt,Se,eo=`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.`,Ct,z,_e,zt,Ue,to='The <a href="/docs/transformers/v4.39.1/en/model_doc/mgp-str#transformers.MgpstrForSceneTextRecognition">MgpstrForSceneTextRecognition</a> forward method, overrides the <code>__call__</code> special method.',Pt,F,St,N,st,Ie,at;return v=new Q({props:{title:"MGP-STR",local:"mgp-str",headingTag:"h1"}}),w=new Q({props:{title:"Overview",local:"overview",headingTag:"h2"}}),O=new Q({props:{title:"Inference example",local:"inference-example",headingTag:"h2"}}),oe=new Ut({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}}),ne=new Q({props:{title:"MgpstrConfig",local:"transformers.MgpstrConfig",headingTag:"h2"}}),re=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/v4.39.1/src/transformers/models/mgp_str/configuration_mgp_str.py#L28"}}),V=new no({props:{anchor:"transformers.MgpstrConfig.example",$$slots:{default:[mo]},$$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/v4.39.1/src/transformers/models/mgp_str/tokenization_mgp_str.py#L38"}}),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/v4.39.1/src/transformers/models/mgp_str/tokenization_mgp_str.py#L100"}}),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/v4.39.1/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/v4.39.1/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/v4.39.1/src/transformers/models/mgp_str/processing_mgp_str.py#L79"}}),me=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/v4.39.1/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>
`}}),pe=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/v4.39.1/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/v4.39.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/mgp_str/modeling_mgp_str.py#L364"}}),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/v4.39.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.39.1/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.39.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/mgp_str/modeling_mgp_str.py#L378"}}),L=new oo({props:{$$slots:{default:[po]},$$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/v4.39.1/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/v4.39.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.39.1/src/transformers/models/mgp_str/modeling_mgp_str.py#L413"}}),_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/v4.39.1/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See <a href="/docs/transformers/v4.39.1/en/model_doc/dpt#transformers.DPTFeatureExtractor.__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/v4.39.1/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/v4.39.1/src/transformers/models/mgp_str/modeling_mgp_str.py#L438",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 oo({props:{$$slots:{default:[go]},$$scope:{ctx:R}}}),N=new no({props:{anchor:"transformers.MgpstrForSceneTextRecognition.forward.example",$$slots:{default:[fo]},$$scope:{ctx:R}}}),{c(){i=l("meta"),T=n(),m=l("p"),b=n(),g(v.$$.fragment),d=n(),g(w.$$.fragment),Ge=n(),q=l("p"),q.innerHTML=Jt,Ve=n(),X=l("p"),X.textContent=Rt,He=n(),Y=l("p"),Y.innerHTML=Zt,Le=n(),G=l("img"),Fe=n(),A=l("small"),A.innerHTML=Wt,Ne=n(),D=l("p"),D.innerHTML=Gt,Be=n(),g(O.$$.fragment),Ee=n(),K=l("p"),K.innerHTML=Vt,Qe=n(),ee=l("p"),ee.innerHTML=Ht,qe=n(),te=l("ul"),te.innerHTML=Lt,Xe=n(),g(oe.$$.fragment),Ye=n(),g(ne.$$.fragment),Ae=n(),x=l("div"),g(re.$$.fragment),ct=n(),Me=l("p"),Me.innerHTML=Ft,dt=n(),be=l("p"),be.innerHTML=Nt,mt=n(),g(V.$$.fragment),De=n(),g(se.$$.fragment),Oe=n(),k=l("div"),g(ae.$$.fragment),pt=n(),ve=l("p"),ve.textContent=Bt,gt=n(),Te=l("p"),Te.innerHTML=Et,ft=n(),we=l("div"),g(ie.$$.fragment),Ke=n(),g(le.$$.fragment),et=n(),y=l("div"),g(ce.$$.fragment),ht=n(),ye=l("p"),ye.textContent=Qt,ut=n(),$e=l("p"),$e.innerHTML=qt,_t=n(),H=l("div"),g(de.$$.fragment),Mt=n(),xe=l("p"),xe.innerHTML=Xt,bt=n(),Z=l("div"),g(me.$$.fragment),vt=n(),ke=l("p"),ke.textContent=Yt,Tt=n(),je=l("p"),je.innerHTML=At,tt=n(),g(pe.$$.fragment),ot=n(),S=l("div"),g(ge.$$.fragment),wt=n(),Ce=l("p"),Ce.innerHTML=Dt,yt=n(),I=l("div"),g(fe.$$.fragment),$t=n(),ze=l("p"),ze.innerHTML=Ot,xt=n(),g(L.$$.fragment),nt=n(),g(he.$$.fragment),rt=n(),j=l("div"),g(ue.$$.fragment),kt=n(),Pe=l("p"),Pe.textContent=Kt,jt=n(),Se=l("p"),Se.innerHTML=eo,Ct=n(),z=l("div"),g(_e.$$.fragment),zt=n(),Ue=l("p"),Ue.innerHTML=to,Pt=n(),g(F.$$.fragment),St=n(),g(N.$$.fragment),st=n(),Ie=l("p"),this.h()},l(e){const t=co("svelte-u9bgzb",document.head);i=c(t,"META",{name:!0,content:!0}),t.forEach(o),T=r(e),m=c(e,"P",{}),P(m).forEach(o),b=r(e),f(v.$$.fragment,e),d=r(e),f(w.$$.fragment,e),Ge=r(e),q=c(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-1ojswm7"&&(q.innerHTML=Jt),Ve=r(e),X=c(e,"P",{"data-svelte-h":!0}),p(X)!=="svelte-vfdo9a"&&(X.textContent=Rt),He=r(e),Y=c(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-1h9gawp"&&(Y.innerHTML=Zt),Le=r(e),G=c(e,"IMG",{src:!0,alt:!0,width:!0}),Fe=r(e),A=c(e,"SMALL",{"data-svelte-h":!0}),p(A)!=="svelte-13av33i"&&(A.innerHTML=Wt),Ne=r(e),D=c(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-codc7u"&&(D.innerHTML=Gt),Be=r(e),f(O.$$.fragment,e),Ee=r(e),K=c(e,"P",{"data-svelte-h":!0}),p(K)!=="svelte-qbv90q"&&(K.innerHTML=Vt),Qe=r(e),ee=c(e,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-13igdtt"&&(ee.innerHTML=Ht),qe=r(e),te=c(e,"UL",{"data-svelte-h":!0}),p(te)!=="svelte-1noonjl"&&(te.innerHTML=Lt),Xe=r(e),f(oe.$$.fragment,e),Ye=r(e),f(ne.$$.fragment,e),Ae=r(e),x=c(e,"DIV",{class:!0});var U=P(x);f(re.$$.fragment,U),ct=r(U),Me=c(U,"P",{"data-svelte-h":!0}),p(Me)!=="svelte-vhol3l"&&(Me.innerHTML=Ft),dt=r(U),be=c(U,"P",{"data-svelte-h":!0}),p(be)!=="svelte-1nrxf0l"&&(be.innerHTML=Nt),mt=r(U),f(V.$$.fragment,U),U.forEach(o),De=r(e),f(se.$$.fragment,e),Oe=r(e),k=c(e,"DIV",{class:!0});var J=P(k);f(ae.$$.fragment,J),pt=r(J),ve=c(J,"P",{"data-svelte-h":!0}),p(ve)!=="svelte-17nyefl"&&(ve.textContent=Bt),gt=r(J),Te=c(J,"P",{"data-svelte-h":!0}),p(Te)!=="svelte-1lbxouy"&&(Te.innerHTML=Et),ft=r(J),we=c(J,"DIV",{class:!0});var We=P(we);f(ie.$$.fragment,We),We.forEach(o),J.forEach(o),Ke=r(e),f(le.$$.fragment,e),et=r(e),y=c(e,"DIV",{class:!0});var C=P(y);f(ce.$$.fragment,C),ht=r(C),ye=c(C,"P",{"data-svelte-h":!0}),p(ye)!=="svelte-yv8e6v"&&(ye.textContent=Qt),ut=r(C),$e=c(C,"P",{"data-svelte-h":!0}),p($e)!=="svelte-wohdjo"&&($e.innerHTML=qt),_t=r(C),H=c(C,"DIV",{class:!0});var it=P(H);f(de.$$.fragment,it),Mt=r(it),xe=c(it,"P",{"data-svelte-h":!0}),p(xe)!=="svelte-54mauz"&&(xe.innerHTML=Xt),it.forEach(o),bt=r(C),Z=c(C,"DIV",{class:!0});var Je=P(Z);f(me.$$.fragment,Je),vt=r(Je),ke=c(Je,"P",{"data-svelte-h":!0}),p(ke)!=="svelte-1deng2j"&&(ke.textContent=Yt),Tt=r(Je),je=c(Je,"P",{"data-svelte-h":!0}),p(je)!=="svelte-1w4qjzx"&&(je.innerHTML=At),Je.forEach(o),C.forEach(o),tt=r(e),f(pe.$$.fragment,e),ot=r(e),S=c(e,"DIV",{class:!0});var Re=P(S);f(ge.$$.fragment,Re),wt=r(Re),Ce=c(Re,"P",{"data-svelte-h":!0}),p(Ce)!=="svelte-1j8rfbn"&&(Ce.innerHTML=Dt),yt=r(Re),I=c(Re,"DIV",{class:!0});var Ze=P(I);f(fe.$$.fragment,Ze),$t=r(Ze),ze=c(Ze,"P",{"data-svelte-h":!0}),p(ze)!=="svelte-cfmkxv"&&(ze.innerHTML=Ot),xt=r(Ze),f(L.$$.fragment,Ze),Ze.forEach(o),Re.forEach(o),nt=r(e),f(he.$$.fragment,e),rt=r(e),j=c(e,"DIV",{class:!0});var B=P(j);f(ue.$$.fragment,B),kt=r(B),Pe=c(B,"P",{"data-svelte-h":!0}),p(Pe)!=="svelte-10o23m7"&&(Pe.textContent=Kt),jt=r(B),Se=c(B,"P",{"data-svelte-h":!0}),p(Se)!=="svelte-1gjh92c"&&(Se.innerHTML=eo),Ct=r(B),z=c(B,"DIV",{class:!0});var E=P(z);f(_e.$$.fragment,E),zt=r(E),Ue=c(E,"P",{"data-svelte-h":!0}),p(Ue)!=="svelte-1befvtn"&&(Ue.innerHTML=to),Pt=r(E),f(F.$$.fragment,E),St=r(E),f(N.$$.fragment,E),E.forEach(o),B.forEach(o),st=r(e),Ie=c(e,"P",{}),P(Ie).forEach(o),this.h()},h(){$(i,"name","hf:doc:metadata"),$(i,"content",uo),so(G.src,It="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/mgp_str_architecture.png")||$(G,"src",It),$(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"),$(y,"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,T,t),s(e,m,t),s(e,b,t),h(v,e,t),s(e,d,t),h(w,e,t),s(e,Ge,t),s(e,q,t),s(e,Ve,t),s(e,X,t),s(e,He,t),s(e,Y,t),s(e,Le,t),s(e,G,t),s(e,Fe,t),s(e,A,t),s(e,Ne,t),s(e,D,t),s(e,Be,t),h(O,e,t),s(e,Ee,t),s(e,K,t),s(e,Qe,t),s(e,ee,t),s(e,qe,t),s(e,te,t),s(e,Xe,t),h(oe,e,t),s(e,Ye,t),h(ne,e,t),s(e,Ae,t),s(e,x,t),h(re,x,null),a(x,ct),a(x,Me),a(x,dt),a(x,be),a(x,mt),h(V,x,null),s(e,De,t),h(se,e,t),s(e,Oe,t),s(e,k,t),h(ae,k,null),a(k,pt),a(k,ve),a(k,gt),a(k,Te),a(k,ft),a(k,we),h(ie,we,null),s(e,Ke,t),h(le,e,t),s(e,et,t),s(e,y,t),h(ce,y,null),a(y,ht),a(y,ye),a(y,ut),a(y,$e),a(y,_t),a(y,H),h(de,H,null),a(H,Mt),a(H,xe),a(y,bt),a(y,Z),h(me,Z,null),a(Z,vt),a(Z,ke),a(Z,Tt),a(Z,je),s(e,tt,t),h(pe,e,t),s(e,ot,t),s(e,S,t),h(ge,S,null),a(S,wt),a(S,Ce),a(S,yt),a(S,I),h(fe,I,null),a(I,$t),a(I,ze),a(I,xt),h(L,I,null),s(e,nt,t),h(he,e,t),s(e,rt,t),s(e,j,t),h(ue,j,null),a(j,kt),a(j,Pe),a(j,jt),a(j,Se),a(j,Ct),a(j,z),h(_e,z,null),a(z,zt),a(z,Ue),a(z,Pt),h(F,z,null),a(z,St),h(N,z,null),s(e,st,t),s(e,Ie,t),at=!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}),L.$set(J);const We={};t&2&&(We.$$scope={dirty:t,ctx:e}),F.$set(We);const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),N.$set(C)},i(e){at||(u(v.$$.fragment,e),u(w.$$.fragment,e),u(O.$$.fragment,e),u(oe.$$.fragment,e),u(ne.$$.fragment,e),u(re.$$.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(me.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(fe.$$.fragment,e),u(L.$$.fragment,e),u(he.$$.fragment,e),u(ue.$$.fragment,e),u(_e.$$.fragment,e),u(F.$$.fragment,e),u(N.$$.fragment,e),at=!0)},o(e){_(v.$$.fragment,e),_(w.$$.fragment,e),_(O.$$.fragment,e),_(oe.$$.fragment,e),_(ne.$$.fragment,e),_(re.$$.fragment,e),_(V.$$.fragment,e),_(se.$$.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),_(L.$$.fragment,e),_(he.$$.fragment,e),_(ue.$$.fragment,e),_(_e.$$.fragment,e),_(F.$$.fragment,e),_(N.$$.fragment,e),at=!1},d(e){e&&(o(T),o(m),o(b),o(d),o(Ge),o(q),o(Ve),o(X),o(He),o(Y),o(Le),o(G),o(Fe),o(A),o(Ne),o(D),o(Be),o(Ee),o(K),o(Qe),o(ee),o(qe),o(te),o(Xe),o(Ye),o(Ae),o(x),o(De),o(Oe),o(k),o(Ke),o(et),o(y),o(tt),o(ot),o(S),o(nt),o(rt),o(j),o(st),o(Ie)),o(i),M(v,e),M(w,e),M(O,e),M(oe,e),M(ne,e),M(re),M(V),M(se,e),M(ae),M(ie),M(le,e),M(ce),M(de),M(me),M(pe,e),M(ge),M(fe),M(L),M(he,e),M(ue),M(_e),M(F),M(N)}}}const uo='{"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 _o(R){return ao(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xo extends io{constructor(i){super(),lo(this,i,_o,ho,ro,{})}}export{xo as component};
