import{S as ys,i as ws,s as $s,e as n,k as p,w as T,t as r,M as Ps,c as a,d as o,m as h,a as s,x as k,h as i,b as l,G as e,g,y,q as w,o as $,B as P,v as js,L as To}from"../../chunks/vendor-hf-doc-builder.js";import{T as ks}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ye}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ht}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as be}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as vo}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ns(G){let c,b;return c=new Ht({props:{code:`from transformers import GPTNeoXJapaneseConfig, GPTNeoXJapaneseModel

# Initializing a GPTNeoXJapanese gpt-neox-japanese-2.7b style configuration
configuration = GPTNeoXJapaneseConfig()

# Initializing a model (with random weights) from the gpt-neox-japanese-2.7b style configuration
model = GPTNeoXJapaneseModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXJapaneseConfig, GPTNeoXJapaneseModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a GPTNeoXJapanese gpt-neox-japanese-2.7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = GPTNeoXJapaneseConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the gpt-neox-japanese-2.7b style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXJapaneseModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){T(c.$$.fragment)},l(m){k(c.$$.fragment,m)},m(m,f){y(c,m,f),b=!0},p:To,i(m){b||(w(c.$$.fragment,m),b=!0)},o(m){$(c.$$.fragment,m),b=!1},d(m){P(c,m)}}}function xs(G){let c,b,m,f,v;return f=new Ht({props:{code:`from transformers import GPTNeoXJapaneseTokenizer

tokenizer = GPTNeoXJapaneseTokenizer.from_pretrained("abeja/gpt-neox-japanese-2.7b")
# You can confirm both \u6176\u5FDC and \u6176\u61C9 are encoded to 17749
tokenizer("\u543E\u8F29\u306F\u732B\u3067\u3042\u308B\u{1F42F}\u3002\u5B9F\u306F\u6176\u5FDC(\u6176\u61C9)\u5927\u5B66\u51FA\u8EAB")["input_ids"]

# Both \u6176\u5FDC and \u6176\u61C9 are decoded to \u6176\u5FDC
tokenizer.decode(tokenizer("\u543E\u8F29\u306F\u732B\u3067\u3042\u308B\u{1F42F}\u3002\u5B9F\u306F\u6176\u5FDC(\u6176\u61C9)\u5927\u5B66\u51FA\u8EAB")["input_ids"])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXJapaneseTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = GPTNeoXJapaneseTokenizer.from_pretrained(<span class="hljs-string">&quot;abeja/gpt-neox-japanese-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># You can confirm both \u6176\u5FDC and \u6176\u61C9 are encoded to 17749</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer(<span class="hljs-string">&quot;\u543E\u8F29\u306F\u732B\u3067\u3042\u308B\u{1F42F}\u3002\u5B9F\u306F\u6176\u5FDC(\u6176\u61C9)\u5927\u5B66\u51FA\u8EAB&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
[<span class="hljs-number">30014</span>, <span class="hljs-number">26883</span>, <span class="hljs-number">26638</span>, <span class="hljs-number">27228</span>, <span class="hljs-number">25</span>, <span class="hljs-number">26650</span>, <span class="hljs-number">31732</span>, <span class="hljs-number">31679</span>, <span class="hljs-number">27809</span>, <span class="hljs-number">26638</span>, <span class="hljs-number">17749</span>, <span class="hljs-number">31592</span>, <span class="hljs-number">17749</span>, <span class="hljs-number">31593</span>, <span class="hljs-number">321</span>, <span class="hljs-number">1281</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Both \u6176\u5FDC and \u6176\u61C9 are decoded to \u6176\u5FDC</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(tokenizer(<span class="hljs-string">&quot;\u543E\u8F29\u306F\u732B\u3067\u3042\u308B\u{1F42F}\u3002\u5B9F\u306F\u6176\u5FDC(\u6176\u61C9)\u5927\u5B66\u51FA\u8EAB&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>])
<span class="hljs-string">&#x27;\u543E\u8F29\u306F\u732B\u3067\u3042\u308B\u{1F42F}\u3002\u5B9F\u306F\u6176\u5FDC(\u6176\u5FDC)\u5927\u5B66\u51FA\u8EAB&#x27;</span>`}}),{c(){c=n("p"),b=r("Example:"),m=p(),T(f.$$.fragment)},l(d){c=a(d,"P",{});var _=s(c);b=i(_,"Example:"),_.forEach(o),m=h(d),k(f.$$.fragment,d)},m(d,_){g(d,c,_),e(c,b),g(d,m,_),y(f,d,_),v=!0},p:To,i(d){v||(w(f.$$.fragment,d),v=!0)},o(d){$(f.$$.fragment,d),v=!1},d(d){d&&o(c),d&&o(m),P(f,d)}}}function Js(G){let c,b,m,f,v;return{c(){c=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),f=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){c=a(d,"P",{});var _=s(c);b=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(_,"CODE",{});var A=s(m);f=i(A,"Module"),A.forEach(o),v=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(o)},m(d,_){g(d,c,_),e(c,b),e(c,m),e(m,f),e(c,v)},d(d){d&&o(c)}}}function Gs(G){let c,b,m,f,v;return f=new Ht({props:{code:`from transformers import AutoTokenizer, GPTNeoXJapaneseModel
import torch

tokenizer = AutoTokenizer.from_pretrained("abeja/gpt-neox-japanese-2.7b")
model = GPTNeoXJapaneseModel.from_pretrained("abeja/gpt-neox-japanese-2.7b")

inputs = tokenizer("\u65E5\u672C\u8A9E\u306EGPT-neox\u304CHugging Face\u3067\u4F7F\u3048\u307E\u3059\u{1F600}", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXJapaneseModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;abeja/gpt-neox-japanese-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXJapaneseModel.from_pretrained(<span class="hljs-string">&quot;abeja/gpt-neox-japanese-2.7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;\u65E5\u672C\u8A9E\u306EGPT-neox\u304CHugging Face\u3067\u4F7F\u3048\u307E\u3059\u{1F600}&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){c=n("p"),b=r("Example:"),m=p(),T(f.$$.fragment)},l(d){c=a(d,"P",{});var _=s(c);b=i(_,"Example:"),_.forEach(o),m=h(d),k(f.$$.fragment,d)},m(d,_){g(d,c,_),e(c,b),g(d,m,_),y(f,d,_),v=!0},p:To,i(d){v||(w(f.$$.fragment,d),v=!0)},o(d){$(f.$$.fragment,d),v=!1},d(d){d&&o(c),d&&o(m),P(f,d)}}}function Xs(G){let c,b,m,f,v;return{c(){c=n("p"),b=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=n("code"),f=r("Module"),v=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(d){c=a(d,"P",{});var _=s(c);b=i(_,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=a(_,"CODE",{});var A=s(m);f=i(A,"Module"),A.forEach(o),v=i(_,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),_.forEach(o)},m(d,_){g(d,c,_),e(c,b),e(c,m),e(m,f),e(c,v)},d(d){d&&o(c)}}}function zs(G){let c,b,m,f,v;return f=new Ht({props:{code:`from transformers import AutoTokenizer, GPTNeoXJapaneseForCausalLM, GPTNeoXJapaneseConfig
import torch

tokenizer = AutoTokenizer.from_pretrained("abeja/gpt-neox-japanese-2.7b")
config = GPTNeoXJapaneseConfig.from_pretrained("abeja/gpt-neox-japanese-2.7b")
config.is_decoder = True
model = GPTNeoXJapaneseForCausalLM.from_pretrained("abeja/gpt-neox-japanese-2.7b", config=config)

inputs = tokenizer("\u65E5\u672C\u8A9E\u306EGPT-neox\u304CHugging Face\u3067\u4F7F\u3048\u307E\u3059\u{1F600}", return_tensors="pt")
outputs = model(**inputs)

prediction_logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, GPTNeoXJapaneseForCausalLM, GPTNeoXJapaneseConfig
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;abeja/gpt-neox-japanese-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = GPTNeoXJapaneseConfig.from_pretrained(<span class="hljs-string">&quot;abeja/gpt-neox-japanese-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXJapaneseForCausalLM.from_pretrained(<span class="hljs-string">&quot;abeja/gpt-neox-japanese-2.7b&quot;</span>, config=config)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;\u65E5\u672C\u8A9E\u306EGPT-neox\u304CHugging Face\u3067\u4F7F\u3048\u307E\u3059\u{1F600}&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.logits`}}),{c(){c=n("p"),b=r("Example:"),m=p(),T(f.$$.fragment)},l(d){c=a(d,"P",{});var _=s(c);b=i(_,"Example:"),_.forEach(o),m=h(d),k(f.$$.fragment,d)},m(d,_){g(d,c,_),e(c,b),g(d,m,_),y(f,d,_),v=!0},p:To,i(d){v||(w(f.$$.fragment,d),v=!0)},o(d){$(f.$$.fragment,d),v=!1},d(d){d&&o(c),d&&o(m),P(f,d)}}}function Es(G){let c,b,m,f,v,d,_,A,ko,Wt,O,ee,ut,ve,yo,mt,wo,Vt,N,$o,Te,Po,jo,ke,No,xo,ft,Jo,Go,ye,Xo,zo,we,Eo,Mo,Kt,j,Co,$e,qo,Ao,Pe,Fo,Lo,je,Io,Oo,Ne,So,Do,xe,Bo,Ho,Je,Wo,Vo,Ut,S,te,gt,Ge,Ko,_t,Uo,Rt,oe,Ro,bt,Yo,Qo,Yt,Xe,Qt,D,ne,vt,ze,Zo,Tt,en,Zt,Qe,kt,Ze,tn,eo,B,ae,yt,Ee,on,wt,nn,to,z,Me,an,H,sn,$t,rn,ln,Ce,dn,cn,pn,W,hn,et,un,mn,tt,fn,gn,_n,se,oo,V,re,Pt,qe,bn,jt,vn,no,x,Ae,Tn,K,kn,ot,yn,wn,Fe,$n,Pn,jn,J,Nt,Nn,xn,xt,Jn,Gn,Jt,Xn,zn,Gt,En,Mn,Xt,Cn,qn,zt,An,Fn,ie,Ln,le,Le,In,Et,On,ao,U,de,Mt,Ie,Sn,Ct,Dn,so,F,Oe,Bn,Se,Hn,De,Wn,Vn,Kn,E,Be,Un,R,Rn,nt,Yn,Qn,qt,Zn,ea,ta,ce,oa,pe,ro,Y,he,At,He,na,Ft,aa,io,L,We,sa,Q,ra,Lt,ia,la,Ve,da,ca,pa,M,Ke,ha,Z,ua,at,ma,fa,It,ga,_a,ba,ue,va,me,lo;return d=new be({}),ve=new be({}),Ge=new be({}),Xe=new Ht({props:{code:`from transformers import GPTNeoXJapaneseForCausalLM, GPTNeoXJapaneseTokenizer

model = GPTNeoXJapaneseForCausalLM.from_pretrained("abeja/gpt-neox-japanese-2.7b")
tokenizer = GPTNeoXJapaneseTokenizer.from_pretrained("abeja/gpt-neox-japanese-2.7b")

prompt = "\u4EBA\u3068AI\u304C\u5354\u8ABF\u3059\u308B\u305F\u3081\u306B\u306F\u3001"

input_ids = tokenizer(prompt, return_tensors="pt").input_ids

gen_tokens = model.generate(
    input_ids,
    do_sample=True,
    temperature=0.9,
    max_length=100,
)
gen_text = tokenizer.batch_decode(gen_tokens, skip_special_tokens=True)[0]

print(gen_text)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> GPTNeoXJapaneseForCausalLM, GPTNeoXJapaneseTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = GPTNeoXJapaneseForCausalLM.from_pretrained(<span class="hljs-string">&quot;abeja/gpt-neox-japanese-2.7b&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = GPTNeoXJapaneseTokenizer.from_pretrained(<span class="hljs-string">&quot;abeja/gpt-neox-japanese-2.7b&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;\u4EBA\u3068AI\u304C\u5354\u8ABF\u3059\u308B\u305F\u3081\u306B\u306F\u3001&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tokenizer(prompt, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).input_ids

<span class="hljs-meta">&gt;&gt;&gt; </span>gen_tokens = model.generate(
<span class="hljs-meta">... </span>    input_ids,
<span class="hljs-meta">... </span>    do_sample=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    temperature=<span class="hljs-number">0.9</span>,
<span class="hljs-meta">... </span>    max_length=<span class="hljs-number">100</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>gen_text = tokenizer.batch_decode(gen_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(gen_text)
\u4EBA\u3068AI\u304C\u5354\u8ABF\u3059\u308B\u305F\u3081\u306B\u306F\u3001AI\u3068\u4EBA\u304C\u5171\u5B58\u3057\u3001AI\u3092\u6B63\u3057\u304F\u7406\u89E3\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002`}}),ze=new be({}),Ee=new be({}),Me=new Ye({props:{name:"class transformers.GPTNeoXJapaneseConfig",anchor:"transformers.GPTNeoXJapaneseConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"hidden_size",val:" = 2560"},{name:"num_hidden_layers",val:" = 32"},{name:"num_attention_heads",val:" = 32"},{name:"intermediate_multiple_size",val:" = 4"},{name:"hidden_act",val:" = 'gelu'"},{name:"rotary_pct",val:" = 1.0"},{name:"rotary_emb_base",val:" = 10000"},{name:"max_position_embeddings",val:" = 2048"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-05"},{name:"use_cache",val:" = True"},{name:"bos_token_id",val:" = 31996"},{name:"eos_token_id",val:" = 31999"},{name:"attention_dropout",val:" = 0.1"},{name:"hidden_dropout",val:" = 0.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXJapaneseConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the GPTNeoXJapanese model. Defines the number of different tokens that can be
represented by the <code>inputs_ids</code> passed when calling <code>GPTNeoXJapanese</code>.`,name:"vocab_size"},{anchor:"transformers.GPTNeoXJapaneseConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2560) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.GPTNeoXJapaneseConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.GPTNeoXJapaneseConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.GPTNeoXJapaneseConfig.intermediate_multiple_size",description:`<strong>intermediate_multiple_size</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; layer in the Transformer encoder is calculated by hidden_size *
intermediate_multiple_size.`,name:"intermediate_multiple_size"},{anchor:"transformers.GPTNeoXJapaneseConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler.`,name:"hidden_act"},{anchor:"transformers.GPTNeoXJapaneseConfig.rotary_pct",description:`<strong>rotary_pct</strong> (<code>float</code>, <em>optional</em>, defaults to 1.00) &#x2014;
percentage of hidden dimensions to allocate to rotary embeddings`,name:"rotary_pct"},{anchor:"transformers.GPTNeoXJapaneseConfig.rotary_emb_base",description:`<strong>rotary_emb_base</strong> (<code>int</code>, <em>optional</em>, defaults to 10000) &#x2014;
base for computing rotary embeddings frequency`,name:"rotary_emb_base"},{anchor:"transformers.GPTNeoXJapaneseConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The maximum sequence length that this model might ever be used with.`,name:"max_position_embeddings"},{anchor:"transformers.GPTNeoXJapaneseConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.GPTNeoXJapaneseConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.GPTNeoXJapaneseConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.GPTNeoXJapaneseConfig.attention_dropout",description:`<strong>attention_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention.`,name:"attention_dropout"},{anchor:"transformers.GPTNeoXJapaneseConfig.hidden_dropout",description:`<strong>hidden_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The dropout ratio for the hidden layer.
Example &#x2014;`,name:"hidden_dropout"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox_japanese/configuration_gpt_neox_japanese.py#L28"}}),se=new vo({props:{anchor:"transformers.GPTNeoXJapaneseConfig.example",$$slots:{default:[Ns]},$$scope:{ctx:G}}}),qe=new be({}),Ae=new Ye({props:{name:"class transformers.GPTNeoXJapaneseTokenizer",anchor:"transformers.GPTNeoXJapaneseTokenizer",parameters:[{name:"vocab_file",val:""},{name:"emoji_file",val:""},{name:"unk_token",val:" = '<|endoftext|>'"},{name:"pad_token",val:" = '<|endoftext|>'"},{name:"bos_token",val:" = '<|startoftext|>'"},{name:"eos_token",val:" = '<|endoftext|>'"},{name:"do_clean_text",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXJapaneseTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.GPTNeoXJapaneseTokenizer.emoji_file",description:`<strong>emoji_file</strong> (<code>str</code>) &#x2014;
File containing the emoji.`,name:"emoji_file"},{anchor:"transformers.GPTNeoXJapaneseTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&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.GPTNeoXJapaneseTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The token used for padding`,name:"pad_token"},{anchor:"transformers.GPTNeoXJapaneseTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|startoftext|&gt;&quot;</code>) &#x2014;
The beginning of sequence token.`,name:"bos_token"},{anchor:"transformers.GPTNeoXJapaneseTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;|endoftext|&gt;&quot;</code>) &#x2014;
The end of sequence token.`,name:"eos_token"},{anchor:"transformers.GPTNeoXJapaneseTokenizer.do_clean_text",description:`<strong>do_clean_text</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clean text for URL, EMAIL, TEL, Japanese DATE and Japanese PRICE.`,name:"do_clean_text"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox_japanese/tokenization_gpt_neox_japanese.py#L70"}}),ie=new vo({props:{anchor:"transformers.GPTNeoXJapaneseTokenizer.example",$$slots:{default:[xs]},$$scope:{ctx:G}}}),Le=new Ye({props:{name:"convert_tokens_to_string",anchor:"transformers.GPTNeoXJapaneseTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox_japanese/tokenization_gpt_neox_japanese.py#L177"}}),Ie=new be({}),Oe=new Ye({props:{name:"class transformers.GPTNeoXJapaneseModel",anchor:"transformers.GPTNeoXJapaneseModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXJapaneseModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neox_japanese#transformers.GPTNeoXJapaneseConfig">~GPTNeoXJapaneseConfig</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.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py#L438"}}),Be=new Ye({props:{name:"forward",anchor:"transformers.GPTNeoXJapaneseModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXJapaneseModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>.`,name:"input_ids"},{anchor:"transformers.GPTNeoXJapaneseModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXJapaneseModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoXJapaneseModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.GPTNeoXJapaneseModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXJapaneseModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXJapaneseModel.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.GPTNeoXJapaneseModel.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.GPTNeoXJapaneseModel.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXJapaneseModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXJapaneseModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py#L458",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/gpt_neox_japanese#transformers.GPTNeoXJapaneseConfig"
>GPTNeoXJapaneseConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
<p>If <code>past_key_values</code> is used only the last hidden-state of the sequences of shape <code>(batch_size, 1, hidden_size)</code> is output.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPast"
>transformers.modeling_outputs.BaseModelOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ce=new ks({props:{$$slots:{default:[Js]},$$scope:{ctx:G}}}),pe=new vo({props:{anchor:"transformers.GPTNeoXJapaneseModel.forward.example",$$slots:{default:[Gs]},$$scope:{ctx:G}}}),He=new be({}),We=new Ye({props:{name:"class transformers.GPTNeoXJapaneseForCausalLM",anchor:"transformers.GPTNeoXJapaneseForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.GPTNeoXJapaneseForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.29.0/en/model_doc/gpt_neox_japanese#transformers.GPTNeoXJapaneseConfig">~GPTNeoXJapaneseConfig</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.29.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py#L592"}}),Ke=new Ye({props:{name:"forward",anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.Tuple[typing.Tuple[torch.FloatTensor]]] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.29.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>.`,name:"input_ids"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"attention_mask"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>`,name:"token_type_ids"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"position_ids"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.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.GPTNeoXJapaneseForCausalLM.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.GPTNeoXJapaneseForCausalLM.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.29.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional tensors are
only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/models/gpt_neox_japanese/modeling_gpt_neox_japanese.py#L611",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.29.0/en/model_doc/gpt_neox_japanese#transformers.GPTNeoXJapaneseConfig"
>GPTNeoXJapaneseConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>)</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithPast"
>transformers.modeling_outputs.CausalLMOutputWithPast</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ue=new ks({props:{$$slots:{default:[Xs]},$$scope:{ctx:G}}}),me=new vo({props:{anchor:"transformers.GPTNeoXJapaneseForCausalLM.forward.example",$$slots:{default:[zs]},$$scope:{ctx:G}}}),{c(){c=n("meta"),b=p(),m=n("h1"),f=n("a"),v=n("span"),T(d.$$.fragment),_=p(),A=n("span"),ko=r("GPT-NeoX-Japanese"),Wt=p(),O=n("h2"),ee=n("a"),ut=n("span"),T(ve.$$.fragment),yo=p(),mt=n("span"),wo=r("Overview"),Vt=p(),N=n("p"),$o=r("We introduce GPT-NeoX-Japanese, which is an autoregressive language model for Japanese, trained on top of "),Te=n("a"),Po=r("https://github.com/EleutherAI/gpt-neox"),jo=r(`.
Japanese is a unique language with its large vocabulary and a combination of hiragana, katakana, and kanji writing scripts.
To address this distinct structure of the Japanese language, we use a `),ke=n("a"),No=r("special sub-word tokenizer"),xo=r(". We are very grateful to "),ft=n("em"),Jo=r("tanreinama"),Go=r(` for open-sourcing this incredibly helpful tokenizer.
Following the recommendations from Google\u2019s research on `),ye=n("a"),Xo=r("PaLM"),zo=r(", we have removed bias parameters from transformer blocks, achieving better model performance. Please refer "),we=n("a"),Eo=r("this article"),Mo=r(" in detail."),Kt=p(),j=n("p"),Co=r("Development of the model was led by "),$e=n("a"),qo=r("Shinya Otani"),Ao=r(", "),Pe=n("a"),Fo=r("Takayoshi Makabe"),Lo=r(", "),je=n("a"),Io=r("Anuj Arora"),Oo=r(", and "),Ne=n("a"),So=r("Kyo Hattori"),Do=r(" from "),xe=n("a"),Bo=r("ABEJA, Inc."),Ho=r(". For more information on this model-building activity, please refer "),Je=n("a"),Wo=r("here (ja)"),Vo=r("."),Ut=p(),S=n("h3"),te=n("a"),gt=n("span"),T(Ge.$$.fragment),Ko=p(),_t=n("span"),Uo=r("Generation"),Rt=p(),oe=n("p"),Ro=r("The "),bt=n("code"),Yo=r("generate()"),Qo=r(" method can be used to generate text using GPT NeoX Japanese model."),Yt=p(),T(Xe.$$.fragment),Qt=p(),D=n("h2"),ne=n("a"),vt=n("span"),T(ze.$$.fragment),Zo=p(),Tt=n("span"),en=r("Documentation resources"),Zt=p(),Qe=n("ul"),kt=n("li"),Ze=n("a"),tn=r("Causal language modeling task guide"),eo=p(),B=n("h2"),ae=n("a"),yt=n("span"),T(Ee.$$.fragment),on=p(),wt=n("span"),nn=r("GPTNeoXJapaneseConfig"),to=p(),z=n("div"),T(Me.$$.fragment),an=p(),H=n("p"),sn=r("This is the configuration class to store the configuration of a "),$t=n("code"),rn=r("GPTNeoXModelJapanese"),ln=r(`. It is used to instantiate
a GPTNeoX 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 GPTNeoXJapanese
`),Ce=n("a"),dn=r("abeja/gpt-neox-japanese-2.7b"),cn=r(" architecture."),pn=p(),W=n("p"),hn=r("Configuration objects inherit from "),et=n("a"),un=r("PretrainedConfig"),mn=r(` and can be used to control the model outputs. Read the
documentation from `),tt=n("a"),fn=r("PretrainedConfig"),gn=r(" for more information. Default configs is set as 2.7B model"),_n=p(),T(se.$$.fragment),oo=p(),V=n("h2"),re=n("a"),Pt=n("span"),T(qe.$$.fragment),bn=p(),jt=n("span"),vn=r("GPTNeoXJapaneseTokenizer"),no=p(),x=n("div"),T(Ae.$$.fragment),Tn=p(),K=n("p"),kn=r("This tokenizer inherits from "),ot=n("a"),yn=r("PreTrainedTokenizer"),wn=r(` and is based on Japanese special Sub-Word-Encoding that is
used in this repository (`),Fe=n("a"),$n=r("https://github.com/tanreinama/Japanese-BPEEncoder_V2"),Pn=r(`). Check the repository for details.
Japanese has a relatively large vocabulary and there is no separation between words. Furthermore, the language is a
combination of hiragana, katakana, and kanji, and variants such as \u201C1\u201D and \u201C\u2460\u201D are often used. In order to cope
with these, this tokenizer has the following features`),jn=p(),J=n("ul"),Nt=n("li"),Nn=r("Subword-by-subword segmentation, which is intermediate between byte strings and morphological analysis."),xn=p(),xt=n("li"),Jn=r(`BPEs are created for each Kanji, Hiragana, and Katakana character, and there are no BPEs that cross character
types, such as Kanji + Hiragana or Hiragana + Katakana.`),Gn=p(),Jt=n("li"),Xn=r("All-byte encoding that does not require <unk>."),zn=p(),Gt=n("li"),En=r("Independent of UTF codes such as 2-byte and 3-byte characters"),Mn=p(),Xt=n("li"),Cn=r("Conversion of heterographs to the same token_id"),qn=p(),zt=n("li"),An=r("Emoji and Emoticon are grouped into 12 types as special tags."),Fn=p(),T(ie.$$.fragment),Ln=p(),le=n("div"),T(Le.$$.fragment),In=p(),Et=n("p"),On=r("Converts a sequence of tokens (string) in a single string."),ao=p(),U=n("h2"),de=n("a"),Mt=n("span"),T(Ie.$$.fragment),Sn=p(),Ct=n("span"),Dn=r("GPTNeoXJapaneseModel"),so=p(),F=n("div"),T(Oe.$$.fragment),Bn=p(),Se=n("p"),Hn=r(`The bare GPTNeoXJapanese Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),De=n("a"),Wn=r("torch.nn.Module"),Vn=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Kn=p(),E=n("div"),T(Be.$$.fragment),Un=p(),R=n("p"),Rn=r("The "),nt=n("a"),Yn=r("GPTNeoXJapaneseModel"),Qn=r(" forward method, overrides the "),qt=n("code"),Zn=r("__call__"),ea=r(" special method."),ta=p(),T(ce.$$.fragment),oa=p(),T(pe.$$.fragment),ro=p(),Y=n("h2"),he=n("a"),At=n("span"),T(He.$$.fragment),na=p(),Ft=n("span"),aa=r("GPTNeoXJapaneseForCausalLM"),io=p(),L=n("div"),T(We.$$.fragment),sa=p(),Q=n("p"),ra=r("GPTNeoXJapanese Model with a "),Lt=n("code"),ia=r("language modeling"),la=r(` head on top for Classifier Model fine-tuning.
This model is a PyTorch `),Ve=n("a"),da=r("torch.nn.Module"),ca=r(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pa=p(),M=n("div"),T(Ke.$$.fragment),ha=p(),Z=n("p"),ua=r("The "),at=n("a"),ma=r("GPTNeoXJapaneseForCausalLM"),fa=r(" forward method, overrides the "),It=n("code"),ga=r("__call__"),_a=r(" special method."),ba=p(),T(ue.$$.fragment),va=p(),T(me.$$.fragment),this.h()},l(t){const u=Ps('[data-svelte="svelte-1phssyn"]',document.head);c=a(u,"META",{name:!0,content:!0}),u.forEach(o),b=h(t),m=a(t,"H1",{class:!0});var Ue=s(m);f=a(Ue,"A",{id:!0,class:!0,href:!0});var Ot=s(f);v=a(Ot,"SPAN",{});var St=s(v);k(d.$$.fragment,St),St.forEach(o),Ot.forEach(o),_=h(Ue),A=a(Ue,"SPAN",{});var Dt=s(A);ko=i(Dt,"GPT-NeoX-Japanese"),Dt.forEach(o),Ue.forEach(o),Wt=h(t),O=a(t,"H2",{class:!0});var Re=s(O);ee=a(Re,"A",{id:!0,class:!0,href:!0});var Bt=s(ee);ut=a(Bt,"SPAN",{});var Ta=s(ut);k(ve.$$.fragment,Ta),Ta.forEach(o),Bt.forEach(o),yo=h(Re),mt=a(Re,"SPAN",{});var ka=s(mt);wo=i(ka,"Overview"),ka.forEach(o),Re.forEach(o),Vt=h(t),N=a(t,"P",{});var C=s(N);$o=i(C,"We introduce GPT-NeoX-Japanese, which is an autoregressive language model for Japanese, trained on top of "),Te=a(C,"A",{href:!0,rel:!0});var ya=s(Te);Po=i(ya,"https://github.com/EleutherAI/gpt-neox"),ya.forEach(o),jo=i(C,`.
Japanese is a unique language with its large vocabulary and a combination of hiragana, katakana, and kanji writing scripts.
To address this distinct structure of the Japanese language, we use a `),ke=a(C,"A",{href:!0,rel:!0});var wa=s(ke);No=i(wa,"special sub-word tokenizer"),wa.forEach(o),xo=i(C,". We are very grateful to "),ft=a(C,"EM",{});var $a=s(ft);Jo=i($a,"tanreinama"),$a.forEach(o),Go=i(C,` for open-sourcing this incredibly helpful tokenizer.
Following the recommendations from Google\u2019s research on `),ye=a(C,"A",{href:!0,rel:!0});var Pa=s(ye);Xo=i(Pa,"PaLM"),Pa.forEach(o),zo=i(C,", we have removed bias parameters from transformer blocks, achieving better model performance. Please refer "),we=a(C,"A",{href:!0,rel:!0});var ja=s(we);Eo=i(ja,"this article"),ja.forEach(o),Mo=i(C," in detail."),C.forEach(o),Kt=h(t),j=a(t,"P",{});var X=s(j);Co=i(X,"Development of the model was led by "),$e=a(X,"A",{href:!0,rel:!0});var Na=s($e);qo=i(Na,"Shinya Otani"),Na.forEach(o),Ao=i(X,", "),Pe=a(X,"A",{href:!0,rel:!0});var xa=s(Pe);Fo=i(xa,"Takayoshi Makabe"),xa.forEach(o),Lo=i(X,", "),je=a(X,"A",{href:!0,rel:!0});var Ja=s(je);Io=i(Ja,"Anuj Arora"),Ja.forEach(o),Oo=i(X,", and "),Ne=a(X,"A",{href:!0,rel:!0});var Ga=s(Ne);So=i(Ga,"Kyo Hattori"),Ga.forEach(o),Do=i(X," from "),xe=a(X,"A",{href:!0,rel:!0});var Xa=s(xe);Bo=i(Xa,"ABEJA, Inc."),Xa.forEach(o),Ho=i(X,". For more information on this model-building activity, please refer "),Je=a(X,"A",{href:!0,rel:!0});var za=s(Je);Wo=i(za,"here (ja)"),za.forEach(o),Vo=i(X,"."),X.forEach(o),Ut=h(t),S=a(t,"H3",{class:!0});var co=s(S);te=a(co,"A",{id:!0,class:!0,href:!0});var Ea=s(te);gt=a(Ea,"SPAN",{});var Ma=s(gt);k(Ge.$$.fragment,Ma),Ma.forEach(o),Ea.forEach(o),Ko=h(co),_t=a(co,"SPAN",{});var Ca=s(_t);Uo=i(Ca,"Generation"),Ca.forEach(o),co.forEach(o),Rt=h(t),oe=a(t,"P",{});var po=s(oe);Ro=i(po,"The "),bt=a(po,"CODE",{});var qa=s(bt);Yo=i(qa,"generate()"),qa.forEach(o),Qo=i(po," method can be used to generate text using GPT NeoX Japanese model."),po.forEach(o),Yt=h(t),k(Xe.$$.fragment,t),Qt=h(t),D=a(t,"H2",{class:!0});var ho=s(D);ne=a(ho,"A",{id:!0,class:!0,href:!0});var Aa=s(ne);vt=a(Aa,"SPAN",{});var Fa=s(vt);k(ze.$$.fragment,Fa),Fa.forEach(o),Aa.forEach(o),Zo=h(ho),Tt=a(ho,"SPAN",{});var La=s(Tt);en=i(La,"Documentation resources"),La.forEach(o),ho.forEach(o),Zt=h(t),Qe=a(t,"UL",{});var Ia=s(Qe);kt=a(Ia,"LI",{});var Oa=s(kt);Ze=a(Oa,"A",{href:!0});var Sa=s(Ze);tn=i(Sa,"Causal language modeling task guide"),Sa.forEach(o),Oa.forEach(o),Ia.forEach(o),eo=h(t),B=a(t,"H2",{class:!0});var uo=s(B);ae=a(uo,"A",{id:!0,class:!0,href:!0});var Da=s(ae);yt=a(Da,"SPAN",{});var Ba=s(yt);k(Ee.$$.fragment,Ba),Ba.forEach(o),Da.forEach(o),on=h(uo),wt=a(uo,"SPAN",{});var Ha=s(wt);nn=i(Ha,"GPTNeoXJapaneseConfig"),Ha.forEach(o),uo.forEach(o),to=h(t),z=a(t,"DIV",{class:!0});var fe=s(z);k(Me.$$.fragment,fe),an=h(fe),H=a(fe,"P",{});var st=s(H);sn=i(st,"This is the configuration class to store the configuration of a "),$t=a(st,"CODE",{});var Wa=s($t);rn=i(Wa,"GPTNeoXModelJapanese"),Wa.forEach(o),ln=i(st,`. It is used to instantiate
a GPTNeoX 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 GPTNeoXJapanese
`),Ce=a(st,"A",{href:!0,rel:!0});var Va=s(Ce);dn=i(Va,"abeja/gpt-neox-japanese-2.7b"),Va.forEach(o),cn=i(st," architecture."),st.forEach(o),pn=h(fe),W=a(fe,"P",{});var rt=s(W);hn=i(rt,"Configuration objects inherit from "),et=a(rt,"A",{href:!0});var Ka=s(et);un=i(Ka,"PretrainedConfig"),Ka.forEach(o),mn=i(rt,` and can be used to control the model outputs. Read the
documentation from `),tt=a(rt,"A",{href:!0});var Ua=s(tt);fn=i(Ua,"PretrainedConfig"),Ua.forEach(o),gn=i(rt," for more information. Default configs is set as 2.7B model"),rt.forEach(o),_n=h(fe),k(se.$$.fragment,fe),fe.forEach(o),oo=h(t),V=a(t,"H2",{class:!0});var mo=s(V);re=a(mo,"A",{id:!0,class:!0,href:!0});var Ra=s(re);Pt=a(Ra,"SPAN",{});var Ya=s(Pt);k(qe.$$.fragment,Ya),Ya.forEach(o),Ra.forEach(o),bn=h(mo),jt=a(mo,"SPAN",{});var Qa=s(jt);vn=i(Qa,"GPTNeoXJapaneseTokenizer"),Qa.forEach(o),mo.forEach(o),no=h(t),x=a(t,"DIV",{class:!0});var I=s(x);k(Ae.$$.fragment,I),Tn=h(I),K=a(I,"P",{});var it=s(K);kn=i(it,"This tokenizer inherits from "),ot=a(it,"A",{href:!0});var Za=s(ot);yn=i(Za,"PreTrainedTokenizer"),Za.forEach(o),wn=i(it,` and is based on Japanese special Sub-Word-Encoding that is
used in this repository (`),Fe=a(it,"A",{href:!0,rel:!0});var es=s(Fe);$n=i(es,"https://github.com/tanreinama/Japanese-BPEEncoder_V2"),es.forEach(o),Pn=i(it,`). Check the repository for details.
Japanese has a relatively large vocabulary and there is no separation between words. Furthermore, the language is a
combination of hiragana, katakana, and kanji, and variants such as \u201C1\u201D and \u201C\u2460\u201D are often used. In order to cope
with these, this tokenizer has the following features`),it.forEach(o),jn=h(I),J=a(I,"UL",{});var q=s(J);Nt=a(q,"LI",{});var ts=s(Nt);Nn=i(ts,"Subword-by-subword segmentation, which is intermediate between byte strings and morphological analysis."),ts.forEach(o),xn=h(q),xt=a(q,"LI",{});var os=s(xt);Jn=i(os,`BPEs are created for each Kanji, Hiragana, and Katakana character, and there are no BPEs that cross character
types, such as Kanji + Hiragana or Hiragana + Katakana.`),os.forEach(o),Gn=h(q),Jt=a(q,"LI",{});var ns=s(Jt);Xn=i(ns,"All-byte encoding that does not require <unk>."),ns.forEach(o),zn=h(q),Gt=a(q,"LI",{});var as=s(Gt);En=i(as,"Independent of UTF codes such as 2-byte and 3-byte characters"),as.forEach(o),Mn=h(q),Xt=a(q,"LI",{});var ss=s(Xt);Cn=i(ss,"Conversion of heterographs to the same token_id"),ss.forEach(o),qn=h(q),zt=a(q,"LI",{});var rs=s(zt);An=i(rs,"Emoji and Emoticon are grouped into 12 types as special tags."),rs.forEach(o),q.forEach(o),Fn=h(I),k(ie.$$.fragment,I),Ln=h(I),le=a(I,"DIV",{class:!0});var fo=s(le);k(Le.$$.fragment,fo),In=h(fo),Et=a(fo,"P",{});var is=s(Et);On=i(is,"Converts a sequence of tokens (string) in a single string."),is.forEach(o),fo.forEach(o),I.forEach(o),ao=h(t),U=a(t,"H2",{class:!0});var go=s(U);de=a(go,"A",{id:!0,class:!0,href:!0});var ls=s(de);Mt=a(ls,"SPAN",{});var ds=s(Mt);k(Ie.$$.fragment,ds),ds.forEach(o),ls.forEach(o),Sn=h(go),Ct=a(go,"SPAN",{});var cs=s(Ct);Dn=i(cs,"GPTNeoXJapaneseModel"),cs.forEach(o),go.forEach(o),so=h(t),F=a(t,"DIV",{class:!0});var lt=s(F);k(Oe.$$.fragment,lt),Bn=h(lt),Se=a(lt,"P",{});var _o=s(Se);Hn=i(_o,`The bare GPTNeoXJapanese Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),De=a(_o,"A",{href:!0,rel:!0});var ps=s(De);Wn=i(ps,"torch.nn.Module"),ps.forEach(o),Vn=i(_o,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),_o.forEach(o),Kn=h(lt),E=a(lt,"DIV",{class:!0});var ge=s(E);k(Be.$$.fragment,ge),Un=h(ge),R=a(ge,"P",{});var dt=s(R);Rn=i(dt,"The "),nt=a(dt,"A",{href:!0});var hs=s(nt);Yn=i(hs,"GPTNeoXJapaneseModel"),hs.forEach(o),Qn=i(dt," forward method, overrides the "),qt=a(dt,"CODE",{});var us=s(qt);Zn=i(us,"__call__"),us.forEach(o),ea=i(dt," special method."),dt.forEach(o),ta=h(ge),k(ce.$$.fragment,ge),oa=h(ge),k(pe.$$.fragment,ge),ge.forEach(o),lt.forEach(o),ro=h(t),Y=a(t,"H2",{class:!0});var bo=s(Y);he=a(bo,"A",{id:!0,class:!0,href:!0});var ms=s(he);At=a(ms,"SPAN",{});var fs=s(At);k(He.$$.fragment,fs),fs.forEach(o),ms.forEach(o),na=h(bo),Ft=a(bo,"SPAN",{});var gs=s(Ft);aa=i(gs,"GPTNeoXJapaneseForCausalLM"),gs.forEach(o),bo.forEach(o),io=h(t),L=a(t,"DIV",{class:!0});var ct=s(L);k(We.$$.fragment,ct),sa=h(ct),Q=a(ct,"P",{});var pt=s(Q);ra=i(pt,"GPTNeoXJapanese Model with a "),Lt=a(pt,"CODE",{});var _s=s(Lt);ia=i(_s,"language modeling"),_s.forEach(o),la=i(pt,` head on top for Classifier Model fine-tuning.
This model is a PyTorch `),Ve=a(pt,"A",{href:!0,rel:!0});var bs=s(Ve);da=i(bs,"torch.nn.Module"),bs.forEach(o),ca=i(pt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),pt.forEach(o),pa=h(ct),M=a(ct,"DIV",{class:!0});var _e=s(M);k(Ke.$$.fragment,_e),ha=h(_e),Z=a(_e,"P",{});var ht=s(Z);ua=i(ht,"The "),at=a(ht,"A",{href:!0});var vs=s(at);ma=i(vs,"GPTNeoXJapaneseForCausalLM"),vs.forEach(o),fa=i(ht," forward method, overrides the "),It=a(ht,"CODE",{});var Ts=s(It);ga=i(Ts,"__call__"),Ts.forEach(o),_a=i(ht," special method."),ht.forEach(o),ba=h(_e),k(ue.$$.fragment,_e),va=h(_e),k(me.$$.fragment,_e),_e.forEach(o),ct.forEach(o),this.h()},h(){l(c,"name","hf:doc:metadata"),l(c,"content",JSON.stringify(Ms)),l(f,"id","gptneoxjapanese"),l(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(f,"href","#gptneoxjapanese"),l(m,"class","relative group"),l(ee,"id","overview"),l(ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ee,"href","#overview"),l(O,"class","relative group"),l(Te,"href","https://github.com/EleutherAI/gpt-neox"),l(Te,"rel","nofollow"),l(ke,"href","https://github.com/tanreinama/Japanese-BPEEncoder_V2"),l(ke,"rel","nofollow"),l(ye,"href","https://ai.googleblog.com/2022/04/pathways-language-model-palm-scaling-to.html"),l(ye,"rel","nofollow"),l(we,"href","https://medium.com/ml-abeja/training-a-better-gpt-2-93b157662ae4"),l(we,"rel","nofollow"),l($e,"href","https://github.com/SO0529"),l($e,"rel","nofollow"),l(Pe,"href","https://github.com/spider-man-tm"),l(Pe,"rel","nofollow"),l(je,"href","https://github.com/Anuj040"),l(je,"rel","nofollow"),l(Ne,"href","https://github.com/go5paopao"),l(Ne,"rel","nofollow"),l(xe,"href","https://www.abejainc.com/"),l(xe,"rel","nofollow"),l(Je,"href","https://tech-blog.abeja.asia/entry/abeja-gpt-project-202207"),l(Je,"rel","nofollow"),l(te,"id","generation"),l(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(te,"href","#generation"),l(S,"class","relative group"),l(ne,"id","documentation-resources"),l(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ne,"href","#documentation-resources"),l(D,"class","relative group"),l(Ze,"href","../tasks/language_modeling"),l(ae,"id","transformers.GPTNeoXJapaneseConfig"),l(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(ae,"href","#transformers.GPTNeoXJapaneseConfig"),l(B,"class","relative group"),l(Ce,"href","https://huggingface.co/abeja/gpt-neox-japanese-2.7b"),l(Ce,"rel","nofollow"),l(et,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(tt,"href","/docs/transformers/v4.29.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(re,"id","transformers.GPTNeoXJapaneseTokenizer"),l(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(re,"href","#transformers.GPTNeoXJapaneseTokenizer"),l(V,"class","relative group"),l(ot,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Fe,"href","https://github.com/tanreinama/Japanese-BPEEncoder_V2"),l(Fe,"rel","nofollow"),l(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(de,"id","transformers.GPTNeoXJapaneseModel"),l(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(de,"href","#transformers.GPTNeoXJapaneseModel"),l(U,"class","relative group"),l(De,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(De,"rel","nofollow"),l(nt,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox_japanese#transformers.GPTNeoXJapaneseModel"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(he,"id","transformers.GPTNeoXJapaneseForCausalLM"),l(he,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(he,"href","#transformers.GPTNeoXJapaneseForCausalLM"),l(Y,"class","relative group"),l(Ve,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(Ve,"rel","nofollow"),l(at,"href","/docs/transformers/v4.29.0/en/model_doc/gpt_neox_japanese#transformers.GPTNeoXJapaneseForCausalLM"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,c),g(t,b,u),g(t,m,u),e(m,f),e(f,v),y(d,v,null),e(m,_),e(m,A),e(A,ko),g(t,Wt,u),g(t,O,u),e(O,ee),e(ee,ut),y(ve,ut,null),e(O,yo),e(O,mt),e(mt,wo),g(t,Vt,u),g(t,N,u),e(N,$o),e(N,Te),e(Te,Po),e(N,jo),e(N,ke),e(ke,No),e(N,xo),e(N,ft),e(ft,Jo),e(N,Go),e(N,ye),e(ye,Xo),e(N,zo),e(N,we),e(we,Eo),e(N,Mo),g(t,Kt,u),g(t,j,u),e(j,Co),e(j,$e),e($e,qo),e(j,Ao),e(j,Pe),e(Pe,Fo),e(j,Lo),e(j,je),e(je,Io),e(j,Oo),e(j,Ne),e(Ne,So),e(j,Do),e(j,xe),e(xe,Bo),e(j,Ho),e(j,Je),e(Je,Wo),e(j,Vo),g(t,Ut,u),g(t,S,u),e(S,te),e(te,gt),y(Ge,gt,null),e(S,Ko),e(S,_t),e(_t,Uo),g(t,Rt,u),g(t,oe,u),e(oe,Ro),e(oe,bt),e(bt,Yo),e(oe,Qo),g(t,Yt,u),y(Xe,t,u),g(t,Qt,u),g(t,D,u),e(D,ne),e(ne,vt),y(ze,vt,null),e(D,Zo),e(D,Tt),e(Tt,en),g(t,Zt,u),g(t,Qe,u),e(Qe,kt),e(kt,Ze),e(Ze,tn),g(t,eo,u),g(t,B,u),e(B,ae),e(ae,yt),y(Ee,yt,null),e(B,on),e(B,wt),e(wt,nn),g(t,to,u),g(t,z,u),y(Me,z,null),e(z,an),e(z,H),e(H,sn),e(H,$t),e($t,rn),e(H,ln),e(H,Ce),e(Ce,dn),e(H,cn),e(z,pn),e(z,W),e(W,hn),e(W,et),e(et,un),e(W,mn),e(W,tt),e(tt,fn),e(W,gn),e(z,_n),y(se,z,null),g(t,oo,u),g(t,V,u),e(V,re),e(re,Pt),y(qe,Pt,null),e(V,bn),e(V,jt),e(jt,vn),g(t,no,u),g(t,x,u),y(Ae,x,null),e(x,Tn),e(x,K),e(K,kn),e(K,ot),e(ot,yn),e(K,wn),e(K,Fe),e(Fe,$n),e(K,Pn),e(x,jn),e(x,J),e(J,Nt),e(Nt,Nn),e(J,xn),e(J,xt),e(xt,Jn),e(J,Gn),e(J,Jt),e(Jt,Xn),e(J,zn),e(J,Gt),e(Gt,En),e(J,Mn),e(J,Xt),e(Xt,Cn),e(J,qn),e(J,zt),e(zt,An),e(x,Fn),y(ie,x,null),e(x,Ln),e(x,le),y(Le,le,null),e(le,In),e(le,Et),e(Et,On),g(t,ao,u),g(t,U,u),e(U,de),e(de,Mt),y(Ie,Mt,null),e(U,Sn),e(U,Ct),e(Ct,Dn),g(t,so,u),g(t,F,u),y(Oe,F,null),e(F,Bn),e(F,Se),e(Se,Hn),e(Se,De),e(De,Wn),e(Se,Vn),e(F,Kn),e(F,E),y(Be,E,null),e(E,Un),e(E,R),e(R,Rn),e(R,nt),e(nt,Yn),e(R,Qn),e(R,qt),e(qt,Zn),e(R,ea),e(E,ta),y(ce,E,null),e(E,oa),y(pe,E,null),g(t,ro,u),g(t,Y,u),e(Y,he),e(he,At),y(He,At,null),e(Y,na),e(Y,Ft),e(Ft,aa),g(t,io,u),g(t,L,u),y(We,L,null),e(L,sa),e(L,Q),e(Q,ra),e(Q,Lt),e(Lt,ia),e(Q,la),e(Q,Ve),e(Ve,da),e(Q,ca),e(L,pa),e(L,M),y(Ke,M,null),e(M,ha),e(M,Z),e(Z,ua),e(Z,at),e(at,ma),e(Z,fa),e(Z,It),e(It,ga),e(Z,_a),e(M,ba),y(ue,M,null),e(M,va),y(me,M,null),lo=!0},p(t,[u]){const Ue={};u&2&&(Ue.$$scope={dirty:u,ctx:t}),se.$set(Ue);const Ot={};u&2&&(Ot.$$scope={dirty:u,ctx:t}),ie.$set(Ot);const St={};u&2&&(St.$$scope={dirty:u,ctx:t}),ce.$set(St);const Dt={};u&2&&(Dt.$$scope={dirty:u,ctx:t}),pe.$set(Dt);const Re={};u&2&&(Re.$$scope={dirty:u,ctx:t}),ue.$set(Re);const Bt={};u&2&&(Bt.$$scope={dirty:u,ctx:t}),me.$set(Bt)},i(t){lo||(w(d.$$.fragment,t),w(ve.$$.fragment,t),w(Ge.$$.fragment,t),w(Xe.$$.fragment,t),w(ze.$$.fragment,t),w(Ee.$$.fragment,t),w(Me.$$.fragment,t),w(se.$$.fragment,t),w(qe.$$.fragment,t),w(Ae.$$.fragment,t),w(ie.$$.fragment,t),w(Le.$$.fragment,t),w(Ie.$$.fragment,t),w(Oe.$$.fragment,t),w(Be.$$.fragment,t),w(ce.$$.fragment,t),w(pe.$$.fragment,t),w(He.$$.fragment,t),w(We.$$.fragment,t),w(Ke.$$.fragment,t),w(ue.$$.fragment,t),w(me.$$.fragment,t),lo=!0)},o(t){$(d.$$.fragment,t),$(ve.$$.fragment,t),$(Ge.$$.fragment,t),$(Xe.$$.fragment,t),$(ze.$$.fragment,t),$(Ee.$$.fragment,t),$(Me.$$.fragment,t),$(se.$$.fragment,t),$(qe.$$.fragment,t),$(Ae.$$.fragment,t),$(ie.$$.fragment,t),$(Le.$$.fragment,t),$(Ie.$$.fragment,t),$(Oe.$$.fragment,t),$(Be.$$.fragment,t),$(ce.$$.fragment,t),$(pe.$$.fragment,t),$(He.$$.fragment,t),$(We.$$.fragment,t),$(Ke.$$.fragment,t),$(ue.$$.fragment,t),$(me.$$.fragment,t),lo=!1},d(t){o(c),t&&o(b),t&&o(m),P(d),t&&o(Wt),t&&o(O),P(ve),t&&o(Vt),t&&o(N),t&&o(Kt),t&&o(j),t&&o(Ut),t&&o(S),P(Ge),t&&o(Rt),t&&o(oe),t&&o(Yt),P(Xe,t),t&&o(Qt),t&&o(D),P(ze),t&&o(Zt),t&&o(Qe),t&&o(eo),t&&o(B),P(Ee),t&&o(to),t&&o(z),P(Me),P(se),t&&o(oo),t&&o(V),P(qe),t&&o(no),t&&o(x),P(Ae),P(ie),P(Le),t&&o(ao),t&&o(U),P(Ie),t&&o(so),t&&o(F),P(Oe),P(Be),P(ce),P(pe),t&&o(ro),t&&o(Y),P(He),t&&o(io),t&&o(L),P(We),P(Ke),P(ue),P(me)}}}const Ms={local:"gptneoxjapanese",sections:[{local:"overview",sections:[{local:"generation",title:"Generation"}],title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.GPTNeoXJapaneseConfig",title:"GPTNeoXJapaneseConfig"},{local:"transformers.GPTNeoXJapaneseTokenizer",title:"GPTNeoXJapaneseTokenizer"},{local:"transformers.GPTNeoXJapaneseModel",title:"GPTNeoXJapaneseModel"},{local:"transformers.GPTNeoXJapaneseForCausalLM",title:"GPTNeoXJapaneseForCausalLM"}],title:"GPT-NeoX-Japanese"};function Cs(G){return js(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ss extends ys{constructor(c){super();ws(this,c,Cs,Es,$s,{})}}export{Ss as default,Ms as metadata};
