import{S as Xh,i as ef,s as tf,e as r,k as p,w as T,t as s,M as of,c as i,d as o,m as h,a as l,x as y,h as a,b as f,G as e,g as _,y as v,q as w,o as $,B as E,v as nf,L as Z}from"../../chunks/vendor-hf-doc-builder.js";import{T as Ke}from"../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as G}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as J}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as V}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function sf(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import EsmModel, EsmConfig

# Initializing a ESM facebook/esm-1b style configuration >>> configuration = EsmConfig()

# Initializing a model from the configuration >>> model = ESMModel(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> EsmModel, EsmConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ESM facebook/esm-1b style configuration &gt;&gt;&gt; configuration = EsmConfig()</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration &gt;&gt;&gt; model = ESMModel(configuration)</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration &gt;&gt;&gt; configuration = model.config</span>`}}),{c(){d=r("p"),k=s("Examples:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Examples:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function af(F){let d,k,c,u,b;return{c(){d=r("p"),k=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),u=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(m,"CODE",{});var M=l(c);u=a(M,"Module"),M.forEach(o),b=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,k),e(d,c),e(c,u),e(d,b)},d(n){n&&o(d)}}}function rf(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import AutoTokenizer, EsmModel
import torch

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = EsmModel.from_pretrained("facebook/esm2_t6_8M_UR50D")

inputs = tokenizer("Hello, my dog is cute", 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, EsmModel
<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;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmModel.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&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(){d=r("p"),k=s("Example:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function lf(F){let d,k,c,u,b;return{c(){d=r("p"),k=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),u=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(m,"CODE",{});var M=l(c);u=a(M,"Module"),M.forEach(o),b=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,k),e(d,c),e(c,u),e(d,b)},d(n){n&&o(d)}}}function df(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import AutoTokenizer, EsmForMaskedLM
import torch

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = EsmForMaskedLM.from_pretrained("facebook/esm2_t6_8M_UR50D")

inputs = tokenizer("The capital of France is <mask>.", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

# retrieve index of <mask>
mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[0].nonzero(as_tuple=True)[0]

predicted_token_id = logits[0, mask_token_index].argmax(axis=-1)

labels = tokenizer("The capital of France is Paris.", return_tensors="pt")["input_ids"]
# mask labels of non-<mask> tokens
labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForMaskedLM
<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;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForMaskedLM.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;mask&gt;.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of &lt;mask&gt;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = (inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>].nonzero(as_tuple=<span class="hljs-literal">True</span>)[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = logits[<span class="hljs-number">0</span>, mask_token_index].argmax(axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-&lt;mask&gt; tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

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

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = EsmForSequenceClassification.from_pretrained("facebook/esm2_t6_8M_UR50D")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = EsmForSequenceClassification.from_pretrained("facebook/esm2_t6_8M_UR50D", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=r("p"),k=s("Example of single-label classification:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example of single-label classification:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function pf(F){let d,k,c,u,b;return u=new G({props:{code:`import torch
from transformers import AutoTokenizer, EsmForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = EsmForSequenceClassification.from_pretrained("facebook/esm2_t6_8M_UR50D", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = EsmForSequenceClassification.from_pretrained(
    "facebook/esm2_t6_8M_UR50D", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=r("p"),k=s("Example of multi-label classification:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example of multi-label classification:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function hf(F){let d,k,c,u,b;return{c(){d=r("p"),k=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),u=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(m,"CODE",{});var M=l(c);u=a(M,"Module"),M.forEach(o),b=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,k),e(d,c),e(c,u),e(d,b)},d(n){n&&o(d)}}}function ff(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import AutoTokenizer, EsmForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = EsmForTokenClassification.from_pretrained("facebook/esm2_t6_8M_UR50D")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForTokenClassification
<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;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForTokenClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=r("p"),k=s("Example:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function uf(F){let d,k,c,u,b;return{c(){d=r("p"),k=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),u=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(m,"CODE",{});var M=l(c);u=a(M,"Module"),M.forEach(o),b=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,k),e(d,c),e(c,u),e(d,b)},d(n){n&&o(d)}}}function gf(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import AutoTokenizer, EsmForProteinFolding

model = EsmForProteinFolding.from_pretrained("facebook/esmfold_v1")
tokenizer = AutoTokenizer.from_pretrained("facebook/esmfold_v1")
inputs = tokenizer(["MLKNVQVQLV"], return_tensors="pt", add_special_tokens=False)  # A tiny random peptide
outputs = model(**inputs)
folded_positions = outputs.positions`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, EsmForProteinFolding

<span class="hljs-meta">&gt;&gt;&gt; </span>model = EsmForProteinFolding.from_pretrained(<span class="hljs-string">&quot;facebook/esmfold_v1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esmfold_v1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer([<span class="hljs-string">&quot;MLKNVQVQLV&quot;</span>], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>)  <span class="hljs-comment"># A tiny random peptide</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>folded_positions = outputs.positions`}}),{c(){d=r("p"),k=s("Example:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function _f(F){let d,k,c,u,b;return{c(){d=r("p"),k=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),u=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(m,"CODE",{});var M=l(c);u=a(M,"Module"),M.forEach(o),b=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,k),e(d,c),e(c,u),e(d,b)},d(n){n&&o(d)}}}function kf(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import AutoTokenizer, TFEsmModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = TFEsmModel.from_pretrained("facebook/esm2_t6_8M_UR50D")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
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, TFEsmModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmModel.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&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(){d=r("p"),k=s("Example:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function bf(F){let d,k,c,u,b;return{c(){d=r("p"),k=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),u=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(m,"CODE",{});var M=l(c);u=a(M,"Module"),M.forEach(o),b=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,k),e(d,c),e(c,u),e(d,b)},d(n){n&&o(d)}}}function Tf(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import AutoTokenizer, TFEsmForMaskedLM
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = TFEsmForMaskedLM.from_pretrained("facebook/esm2_t6_8M_UR50D")

inputs = tokenizer("The capital of France is <mask>.", return_tensors="tf")
logits = model(**inputs).logits

# retrieve index of <mask>
mask_token_index = tf.where((inputs.input_ids == tokenizer.mask_token_id)[0])
selected_logits = tf.gather_nd(logits[0], indices=mask_token_index)

predicted_token_id = tf.math.argmax(selected_logits, axis=-1)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFEsmForMaskedLM
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmForMaskedLM.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;The capital of France is &lt;mask&gt;.&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># retrieve index of &lt;mask&gt;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_token_index = tf.where((inputs.input_ids == tokenizer.mask_token_id)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>selected_logits = tf.gather_nd(logits[<span class="hljs-number">0</span>], indices=mask_token_index)

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_id = tf.math.argmax(selected_logits, axis=-<span class="hljs-number">1</span>)`}}),{c(){d=r("p"),k=s("Example:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function yf(F){let d,k;return d=new G({props:{code:`labels = tokenizer("The capital of France is Paris.", return_tensors="tf")["input_ids"]
# mask labels of non-<mask> tokens
labels = tf.where(inputs.input_ids == tokenizer.mask_token_id, labels, -100)

outputs = model(**inputs, labels=labels)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tokenizer(<span class="hljs-string">&quot;The capital of France is Paris.&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)[<span class="hljs-string">&quot;input_ids&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># mask labels of non-&lt;mask&gt; tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.where(inputs.input_ids == tokenizer.mask_token_id, labels, -<span class="hljs-number">100</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, labels=labels)`}}),{c(){T(d.$$.fragment)},l(c){y(d.$$.fragment,c)},m(c,u){v(d,c,u),k=!0},p:Z,i(c){k||(w(d.$$.fragment,c),k=!0)},o(c){$(d.$$.fragment,c),k=!1},d(c){E(d,c)}}}function vf(F){let d,k,c,u,b;return{c(){d=r("p"),k=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),u=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(m,"CODE",{});var M=l(c);u=a(M,"Module"),M.forEach(o),b=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,k),e(d,c),e(c,u),e(d,b)},d(n){n&&o(d)}}}function wf(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import AutoTokenizer, TFEsmForSequenceClassification
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = TFEsmForSequenceClassification.from_pretrained("facebook/esm2_t6_8M_UR50D")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")

logits = model(**inputs).logits

predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFEsmForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])`}}),{c(){d=r("p"),k=s("Example:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function $f(F){let d,k;return d=new G({props:{code:'# To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`\nnum_labels = len(model.config.id2label)\nmodel = TFEsmForSequenceClassification.from_pretrained("facebook/esm2_t6_8M_UR50D", num_labels=num_labels)\n\nlabels = tf.constant(1)\nloss = model(**inputs, labels=labels).loss',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`</span>\n<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)\n<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>, num_labels=num_labels)\n\n<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)\n<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss'}}),{c(){T(d.$$.fragment)},l(c){y(d.$$.fragment,c)},m(c,u){v(d,c,u),k=!0},p:Z,i(c){k||(w(d.$$.fragment,c),k=!0)},o(c){$(d.$$.fragment,c),k=!1},d(c){E(d,c)}}}function Ef(F){let d,k,c,u,b;return{c(){d=r("p"),k=s("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),u=s("Module"),b=s(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=i(m,"CODE",{});var M=l(c);u=a(M,"Module"),M.forEach(o),b=a(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(o)},m(n,m){_(n,d,m),e(d,k),e(d,c),e(c,u),e(d,b)},d(n){n&&o(d)}}}function Ff(F){let d,k,c,u,b;return u=new G({props:{code:`from transformers import AutoTokenizer, TFEsmForTokenClassification
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("facebook/esm2_t6_8M_UR50D")
model = TFEsmForTokenClassification.from_pretrained("facebook/esm2_t6_8M_UR50D")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="tf"
)

logits = model(**inputs).logits
predicted_token_class_ids = tf.math.argmax(logits, axis=-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t] for t in predicted_token_class_ids[0].numpy().tolist()]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFEsmForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFEsmForTokenClassification.from_pretrained(<span class="hljs-string">&quot;facebook/esm2_t6_8M_UR50D&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>].numpy().tolist()]`}}),{c(){d=r("p"),k=s("Example:"),c=p(),T(u.$$.fragment)},l(n){d=i(n,"P",{});var m=l(d);k=a(m,"Example:"),m.forEach(o),c=h(n),y(u.$$.fragment,n)},m(n,m){_(n,d,m),e(d,k),_(n,c,m),v(u,n,m),b=!0},p:Z,i(n){b||(w(u.$$.fragment,n),b=!0)},o(n){$(u.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(c),E(u,n)}}}function Mf(F){let d,k;return d=new G({props:{code:`labels = predicted_token_class_ids
loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)`}}),{c(){T(d.$$.fragment)},l(c){y(d.$$.fragment,c)},m(c,u){v(d,c,u),k=!0},p:Z,i(c){k||(w(d.$$.fragment,c),k=!0)},o(c){$(d.$$.fragment,c),k=!1},d(c){E(d,c)}}}function zf(F){let d,k,c,u,b,n,m,M,Ur,Ea,ye,Be,ss,Lt,Rr,as,Wr,Fa,Ve,Hr,Nt,Kr,Br,Ma,Ze,Vr,Dt,Zr,Gr,za,pn,Jr,qa,hn,rs,Qr,xa,fn,Yr,Ca,un,is,Xr,ja,gn,ei,Pa,_n,ls,ti,Sa,Q,oi,Ot,ni,si,It,ai,ri,Ut,ii,li,Aa,ae,di,Rt,ci,mi,Wt,pi,hi,La,re,fi,Ht,ui,gi,ds,_i,ki,Na,ve,Ge,cs,Kt,bi,ms,Ti,Da,j,Bt,yi,we,vi,ps,wi,$i,Vt,Ei,Fi,Mi,$e,zi,kn,qi,xi,bn,Ci,ji,Pi,Je,Si,Qe,Zt,Ai,Gt,Li,Tn,Ni,Di,Oa,Ee,Ye,hs,Jt,Oi,fs,Ii,Ia,x,Qt,Ui,us,Ri,Wi,yn,Yt,Hi,Xe,Xt,Ki,Fe,Bi,gs,Vi,Zi,_s,Gi,Ji,Qi,ie,eo,Yi,vn,Xi,wn,el,tl,ks,ol,nl,$n,to,Ua,Me,et,bs,oo,sl,Ts,al,Ra,q,no,rl,ys,il,ll,so,dl,En,cl,ml,pl,ao,hl,ro,fl,ul,gl,io,_l,lo,kl,bl,Tl,C,yl,vs,vl,wl,ws,$l,El,$s,Fl,Ml,Es,zl,ql,Fs,xl,Cl,Ms,jl,Pl,Sl,Y,co,Al,ze,Ll,Fn,Nl,Dl,zs,Ol,Il,Ul,tt,Rl,ot,Wa,qe,nt,qs,mo,Wl,xs,Hl,Ha,P,po,Kl,ho,Bl,Cs,Vl,Zl,Gl,fo,Jl,Mn,Ql,Yl,Xl,uo,ed,go,td,od,nd,X,_o,sd,xe,ad,zn,rd,id,js,ld,dd,cd,st,md,at,Ka,Ce,rt,Ps,ko,pd,Ss,hd,Ba,S,bo,fd,As,ud,gd,To,_d,qn,kd,bd,Td,yo,yd,vo,vd,wd,$d,U,wo,Ed,je,Fd,xn,Md,zd,Ls,qd,xd,Cd,it,jd,lt,Pd,dt,Va,Pe,ct,Ns,$o,Sd,Ds,Ad,Za,A,Eo,Ld,Os,Nd,Dd,Fo,Od,Cn,Id,Ud,Rd,Mo,Wd,zo,Hd,Kd,Bd,ee,qo,Vd,Se,Zd,jn,Gd,Jd,Is,Qd,Yd,Xd,mt,ec,pt,Ga,Ae,ht,Us,xo,tc,Rs,oc,Ja,L,Co,nc,Ws,sc,ac,jo,rc,Pn,ic,lc,dc,Po,cc,So,mc,pc,hc,te,Ao,fc,Le,uc,Sn,gc,_c,Hs,kc,bc,Tc,ft,yc,ut,Qa,Ne,gt,Ks,Lo,vc,Bs,wc,Ya,N,No,$c,Vs,Ec,Fc,Do,Mc,An,zc,qc,xc,Oo,Cc,Io,jc,Pc,Sc,oe,Uo,Ac,De,Lc,Ln,Nc,Dc,Zs,Oc,Ic,Uc,_t,Rc,kt,Xa,Oe,bt,Gs,Ro,Wc,Js,Hc,er,D,Wo,Kc,Ho,Bc,Qs,Vc,Zc,Gc,Ko,Jc,Nn,Qc,Yc,Xc,Bo,em,Vo,tm,om,nm,R,Zo,sm,Ie,am,Dn,rm,im,Ys,lm,dm,cm,Tt,mm,yt,pm,vt,tr,Ue,wt,Xs,Go,hm,ea,fm,or,O,Jo,um,ta,gm,_m,Qo,km,On,bm,Tm,ym,Yo,vm,Xo,wm,$m,Em,W,en,Fm,Re,Mm,In,zm,qm,oa,xm,Cm,jm,$t,Pm,Et,Sm,Ft,nr,We,Mt,na,tn,Am,sa,Lm,sr,I,on,Nm,aa,Dm,Om,nn,Im,Un,Um,Rm,Wm,sn,Hm,an,Km,Bm,Vm,H,rn,Zm,He,Gm,Rn,Jm,Qm,ra,Ym,Xm,ep,zt,tp,qt,op,xt,ar;return n=new J({}),Lt=new J({}),Kt=new J({}),Bt=new z({props:{name:"class transformers.EsmConfig",anchor:"transformers.EsmConfig",parameters:[{name:"vocab_size",val:" = None"},{name:"mask_token_id",val:" = None"},{name:"pad_token_id",val:" = None"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 1026"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"emb_layer_norm_before",val:" = None"},{name:"token_dropout",val:" = False"},{name:"is_folding_model",val:" = False"},{name:"esmfold_config",val:" = None"},{name:"vocab_list",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EsmConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Vocabulary size of the ESM model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <code>ESMModel</code>.`,name:"vocab_size"},{anchor:"transformers.EsmConfig.mask_token_id",description:`<strong>mask_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The index of the mask token in the vocabulary. This must be included in the config because of the
&#x201C;mask-dropout&#x201D; scaling trick, which will scale the inputs depending on the number of masked tokens.`,name:"mask_token_id"},{anchor:"transformers.EsmConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The index of the padding token in the vocabulary. This must be included in the config because certain parts
of the ESM code use this instead of the attention mask.`,name:"pad_token_id"},{anchor:"transformers.EsmConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.EsmConfig.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.EsmConfig.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.EsmConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.EsmConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.EsmConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.EsmConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1026) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.EsmConfig.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.EsmConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.EsmConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;, &quot;rotary&quot;</code>.
For positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.EsmConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.EsmConfig.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.EsmConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"},{anchor:"transformers.EsmConfig.emb_layer_norm_before",description:`<strong>emb_layer_norm_before</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to apply layer normalization after embeddings but before the main stem of the network.`,name:"emb_layer_norm_before"},{anchor:"transformers.EsmConfig.token_dropout",description:`<strong>token_dropout</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
When this is enabled, masked tokens are treated as if they had been dropped out by input dropout.`,name:"token_dropout"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/configuration_esm.py#L33"}}),Je=new V({props:{anchor:"transformers.EsmConfig.example",$$slots:{default:[sf]},$$scope:{ctx:F}}}),Zt=new z({props:{name:"to_dict",anchor:"transformers.EsmConfig.to_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/configuration_esm.py#L164",returnDescription:`
<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`
<p><code>Dict[str, any]</code></p>
`}}),Jt=new J({}),Qt=new z({props:{name:"class transformers.EsmTokenizer",anchor:"transformers.EsmTokenizer",parameters:[{name:"vocab_file",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/tokenization_esm.py#L47"}}),Yt=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.EsmTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/tokenization_esm.py#L91"}}),Xt=new z({props:{name:"get_special_tokens_mask",anchor:"transformers.EsmTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List"},{name:"token_ids_1",val:": typing.Optional[typing.List] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.EsmTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of ids of the first sequence.`,name:"token_ids_0"},{anchor:"transformers.EsmTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
List of ids of the second sequence.`,name:"token_ids_1"},{anchor:"transformers.EsmTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/tokenization_esm.py#L100",returnDescription:`
<p>1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p>A list of integers in the range [0, 1]</p>
`}}),eo=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.EsmTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.EsmTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:"<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014; The first tokenized sequence.",name:"token_ids_0"},{anchor:"transformers.EsmTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:"<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014; The second tokenized sequence.",name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tokenization_utils_base.py#L3026",returnDescription:`
<p>The token type ids.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),to=new z({props:{name:"save_vocabulary",anchor:"transformers.EsmTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:""},{name:"filename_prefix",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/tokenization_esm.py#L131"}}),oo=new J({}),no=new z({props:{name:"class transformers.EsmModel",anchor:"transformers.EsmModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.EsmModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esm.py#L774"}}),co=new z({props:{name:"forward",anchor:"transformers.EsmModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.EsmModel.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>((batch_size, sequence_length))</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>((batch_size, sequence_length))</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmModel.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.EsmModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>((batch_size, sequence_length), hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.EsmModel.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.EsmModel.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.EsmModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EsmModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.EsmModel.forward.encoder_attention_mask",description:`<strong>encoder_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 the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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:"encoder_attention_mask"},{anchor:"transformers.EsmModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.EsmModel.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/main/src/transformers/models/esm/modeling_esm.py#L824",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</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/main/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=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 of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</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>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),tt=new Ke({props:{$$slots:{default:[af]},$$scope:{ctx:F}}}),ot=new V({props:{anchor:"transformers.EsmModel.forward.example",$$slots:{default:[rf]},$$scope:{ctx:F}}}),mo=new J({}),po=new z({props:{name:"class transformers.EsmForMaskedLM",anchor:"transformers.EsmForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EsmForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esm.py#L963"}}),_o=new z({props:{name:"forward",anchor:"transformers.EsmForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.FloatTensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.EsmForMaskedLM.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmForMaskedLM.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.EsmForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.EsmForMaskedLM.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.EsmForMaskedLM.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.EsmForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EsmForMaskedLM.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 masked language modeling loss. 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 in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.EsmForMaskedLM.forward.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esm.py#L987",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</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/main/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</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 Masked language modeling (MLM) loss.</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>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/main/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),st=new Ke({props:{$$slots:{default:[lf]},$$scope:{ctx:F}}}),at=new V({props:{anchor:"transformers.EsmForMaskedLM.forward.example",$$slots:{default:[df]},$$scope:{ctx:F}}}),ko=new J({}),bo=new z({props:{name:"class transformers.EsmForSequenceClassification",anchor:"transformers.EsmForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EsmForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esm.py#L1081"}}),wo=new z({props:{name:"forward",anchor:"transformers.EsmForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.EsmForSequenceClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmForSequenceClassification.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.EsmForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.EsmForSequenceClassification.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.EsmForSequenceClassification.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.EsmForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EsmForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esm.py#L1094",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</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/main/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</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 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</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/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),it=new Ke({props:{$$slots:{default:[cf]},$$scope:{ctx:F}}}),lt=new V({props:{anchor:"transformers.EsmForSequenceClassification.forward.example",$$slots:{default:[mf]},$$scope:{ctx:F}}}),dt=new V({props:{anchor:"transformers.EsmForSequenceClassification.forward.example-2",$$slots:{default:[pf]},$$scope:{ctx:F}}}),$o=new J({}),Eo=new z({props:{name:"class transformers.EsmForTokenClassification",anchor:"transformers.EsmForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EsmForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esm.py#L1175"}}),qo=new z({props:{name:"forward",anchor:"transformers.EsmForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.EsmForTokenClassification.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmForTokenClassification.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.EsmForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.EsmForTokenClassification.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.EsmForTokenClassification.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.EsmForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EsmForTokenClassification.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 token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esm.py#L1189",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</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/main/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</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 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</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/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),mt=new Ke({props:{$$slots:{default:[hf]},$$scope:{ctx:F}}}),pt=new V({props:{anchor:"transformers.EsmForTokenClassification.forward.example",$$slots:{default:[ff]},$$scope:{ctx:F}}}),xo=new J({}),Co=new z({props:{name:"class transformers.EsmForProteinFolding",anchor:"transformers.EsmForProteinFolding",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EsmForProteinFolding.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esmfold.py#L2020"}}),Ao=new z({props:{name:"forward",anchor:"transformers.EsmForProteinFolding.forward",parameters:[{name:"input_ids",val:": Tensor"},{name:"attention_mask",val:": Tensor = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"masking_pattern",val:": typing.Optional[torch.Tensor] = None"},{name:"num_recycles",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.EsmForProteinFolding.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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.EsmForProteinFolding.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.EsmForProteinFolding.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.EsmForProteinFolding.forward.masking_pattern",description:`<strong>masking_pattern</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Locations of tokens to mask during training as a form of regularization. Mask values selected in <code>[0, 1]</code>.`,name:"masking_pattern"},{anchor:"transformers.EsmForProteinFolding.forward.num_recycles",description:`<strong>num_recycles</strong> (<code>int</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Number of times to recycle the input sequence. If <code>None</code>, defaults to <code>config.num_recycles</code>. &#x201C;Recycling&#x201D;
consists of passing the output of the folding trunk back in as input to the trunk. During training, the
number of recycles should vary with each batch, to ensure that the model learns to output valid predictions
after each recycle. During inference, num_recycles should be set to the highest value that the model was
trained with for maximum accuracy. Accordingly, when this value is set to <code>None</code>, config.max_recycles is
used.`,name:"num_recycles"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_esmfold.py#L2082",returnDescription:`
<p>A <code>transformers.models.esm.modeling_esmfold.EsmForProteinFoldingOutput</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.esm.configuration_esm.EsmConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>frames</strong> (<code>torch.FloatTensor</code>) \u2014 Output frames.</li>
<li><strong>sidechain_frames</strong> (<code>torch.FloatTensor</code>) \u2014 Output sidechain frames.</li>
<li><strong>unnormalized_angles</strong> (<code>torch.FloatTensor</code>) \u2014 Predicted unnormalized backbone and side chain torsion angles.</li>
<li><strong>angles</strong> (<code>torch.FloatTensor</code>) \u2014 Predicted backbone and side chain torsion angles.</li>
<li><strong>positions</strong> (<code>torch.FloatTensor</code>) \u2014 Predicted positions of the backbone and side chain atoms.</li>
<li><strong>states</strong> (<code>torch.FloatTensor</code>) \u2014 Hidden states from the protein folding trunk.</li>
<li><strong>s_s</strong> (<code>torch.FloatTensor</code>) \u2014 Per-residue embeddings derived by concatenating the hidden states of each layer of the ESM-2 LM stem.</li>
<li><strong>s_z</strong> (<code>torch.FloatTensor</code>) \u2014 Pairwise residue embeddings.</li>
<li><strong>distogram_logits</strong> (<code>torch.FloatTensor</code>) \u2014 Input logits to the distogram used to compute residue distances.</li>
<li><strong>lm_logits</strong> (<code>torch.FloatTensor</code>) \u2014 Logits output by the ESM-2 protein language model stem.</li>
<li><strong>aatype</strong> (<code>torch.FloatTensor</code>) \u2014 Input amino acids (AlphaFold2 indices).</li>
<li><strong>atom14_atom_exists</strong> (<code>torch.FloatTensor</code>) \u2014 Whether each atom exists in the atom14 representation.</li>
<li><strong>residx_atom14_to_atom37</strong> (<code>torch.FloatTensor</code>) \u2014 Mapping between atoms in the atom14 and atom37 representations.</li>
<li><strong>residx_atom37_to_atom14</strong> (<code>torch.FloatTensor</code>) \u2014 Mapping between atoms in the atom37 and atom14 representations.</li>
<li><strong>atom37_atom_exists</strong> (<code>torch.FloatTensor</code>) \u2014 Whether each atom exists in the atom37 representation.</li>
<li><strong>residue_index</strong> (<code>torch.FloatTensor</code>) \u2014 The index of each residue in the protein chain. Unless internal padding tokens are used, this will just be
a sequence of integers from 0 to <code>sequence_length</code>.</li>
<li><strong>lddt_head</strong> (<code>torch.FloatTensor</code>) \u2014 Raw outputs from the lddt head used to compute plddt.</li>
<li><strong>plddt</strong> (<code>torch.FloatTensor</code>) \u2014 Per-residue confidence scores. Regions of low confidence may indicate areas where the model\u2019s prediction is
uncertain, or where the protein structure is disordered.</li>
<li><strong>ptm_logits</strong> (<code>torch.FloatTensor</code>) \u2014 Raw logits used for computing ptm.</li>
<li><strong>ptm</strong> (<code>torch.FloatTensor</code>) \u2014 TM-score output representing the model\u2019s high-level confidence in the overall structure.</li>
<li><strong>aligned_confidence_probs</strong> (<code>torch.FloatTensor</code>) \u2014 Per-residue confidence scores for the aligned structure.</li>
<li><strong>predicted_aligned_error</strong> (<code>torch.FloatTensor</code>) \u2014 Predicted error between the model\u2019s prediction and the ground truth.</li>
<li><strong>max_predicted_aligned_error</strong> (<code>torch.FloatTensor</code>) \u2014 Per-sample maximum predicted error.</li>
</ul>
`,returnType:`
<p><code>transformers.models.esm.modeling_esmfold.EsmForProteinFoldingOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new Ke({props:{$$slots:{default:[uf]},$$scope:{ctx:F}}}),ut=new V({props:{anchor:"transformers.EsmForProteinFolding.forward.example",$$slots:{default:[gf]},$$scope:{ctx:F}}}),Lo=new J({}),No=new z({props:{name:"class transformers.TFEsmModel",anchor:"transformers.TFEsmModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEsmModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_tf_esm.py#L988"}}),Uo=new z({props:{name:"call",anchor:"transformers.TFEsmModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"past_key_values",val:": typing.Union[typing.Tuple[typing.Tuple[typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor]]], NoneType] = 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"},{name:"training",val:": typing.Optional[bool] = False"}],parametersDescription:[{anchor:"transformers.TFEsmModel.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFEsmModel.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFEsmModel.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFEsmModel.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</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.TFEsmModel.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFEsmModel.call.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.TFEsmModel.call.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.TFEsmModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEsmModel.call.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.TFEsmModel.call.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. 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:"encoder_attention_mask"},{anchor:"transformers.TFEsmModel.call.past_key_values",description:`<strong>past_key_values</strong> (<code>Tuple[Tuple[tf.Tensor]]</code> of length <code>config.n_layers</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.TFEsmModel.call.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#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>). Set to <code>False</code> during training, <code>True</code> during generation`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_tf_esm.py#L994",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of <code>tf.Tensor</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/main/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) further processed by a
Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
prediction (classification) objective during pretraining.</p>
<p>This output is usually <em>not</em> a good summary of the semantic content of the input, you\u2019re often better with
averaging or pooling the sequence of hidden-states for the whole input sequence.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>List[tf.Tensor]</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 List of <code>tf.Tensor</code> of length <code>config.n_layers</code>, with each tensor of shape <code>(2, batch_size, num_heads, sequence_length, embed_size_per_head)</code>).</p>
<p>Contains pre-computed hidden-states (key and values in the 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(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(tf.Tensor)</code></p>
`}}),_t=new Ke({props:{$$slots:{default:[_f]},$$scope:{ctx:F}}}),kt=new V({props:{anchor:"transformers.TFEsmModel.call.example",$$slots:{default:[kf]},$$scope:{ctx:F}}}),Ro=new J({}),Wo=new z({props:{name:"class transformers.TFEsmForMaskedLM",anchor:"transformers.TFEsmForMaskedLM",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEsmForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_tf_esm.py#L1092"}}),Zo=new z({props:{name:"call",anchor:"transformers.TFEsmForMaskedLM.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_hidden_states",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"encoder_attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEsmForMaskedLM.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFEsmForMaskedLM.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFEsmForMaskedLM.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFEsmForMaskedLM.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</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.TFEsmForMaskedLM.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFEsmForMaskedLM.call.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.TFEsmForMaskedLM.call.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.TFEsmForMaskedLM.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEsmForMaskedLM.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. 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 in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.TFEsmForMaskedLM.call.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>) &#x2014;
Used to hide legacy arguments that have been deprecated.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_tf_esm.py#L1117",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or a tuple of <code>tf.Tensor</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/main/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of non-masked labels, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFMaskedLMOutput"
>transformers.modeling_tf_outputs.TFMaskedLMOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Tt=new Ke({props:{$$slots:{default:[bf]},$$scope:{ctx:F}}}),yt=new V({props:{anchor:"transformers.TFEsmForMaskedLM.call.example",$$slots:{default:[Tf]},$$scope:{ctx:F}}}),vt=new V({props:{anchor:"transformers.TFEsmForMaskedLM.call.example-2",$$slots:{default:[yf]},$$scope:{ctx:F}}}),Go=new J({}),Jo=new z({props:{name:"class transformers.TFEsmForSequenceClassification",anchor:"transformers.TFEsmForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEsmForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_tf_esm.py#L1251"}}),en=new z({props:{name:"call",anchor:"transformers.TFEsmForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEsmForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFEsmForSequenceClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFEsmForSequenceClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFEsmForSequenceClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</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.TFEsmForSequenceClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFEsmForSequenceClassification.call.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.TFEsmForSequenceClassification.call.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.TFEsmForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEsmForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_tf_esm.py#L1262",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or a tuple of <code>tf.Tensor</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/main/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, )</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFSequenceClassifierOutput"
>transformers.modeling_tf_outputs.TFSequenceClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),$t=new Ke({props:{$$slots:{default:[vf]},$$scope:{ctx:F}}}),Et=new V({props:{anchor:"transformers.TFEsmForSequenceClassification.call.example",$$slots:{default:[wf]},$$scope:{ctx:F}}}),Ft=new V({props:{anchor:"transformers.TFEsmForSequenceClassification.call.example-2",$$slots:{default:[$f]},$$scope:{ctx:F}}}),tn=new J({}),on=new z({props:{name:"class transformers.TFEsmForTokenClassification",anchor:"transformers.TFEsmForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEsmForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/esm#transformers.EsmConfig">EsmConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_tf_esm.py#L1345"}}),rn=new z({props:{name:"call",anchor:"transformers.TFEsmForTokenClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"position_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = 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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEsmForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>tf.Tensor</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/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFEsmForTokenClassification.call.attention_mask",description:`<strong>attention_mask</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.TFEsmForTokenClassification.call.position_ids",description:`<strong>position_ids</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.TFEsmForTokenClassification.call.head_mask",description:`<strong>head_mask</strong> (<code>tf.Tensor</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.TFEsmForTokenClassification.call.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.TFEsmForTokenClassification.call.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.TFEsmForTokenClassification.call.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.TFEsmForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEsmForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/esm/modeling_tf_esm.py#L1357",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or a tuple of <code>tf.Tensor</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/main/en/model_doc/esm#transformers.EsmConfig"
>EsmConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(n,)</code>, <em>optional</em>, where n is the number of unmasked labels, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for the output of the embeddings + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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/main/en/main_classes/output#transformers.modeling_tf_outputs.TFTokenClassifierOutput"
>transformers.modeling_tf_outputs.TFTokenClassifierOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),zt=new Ke({props:{$$slots:{default:[Ef]},$$scope:{ctx:F}}}),qt=new V({props:{anchor:"transformers.TFEsmForTokenClassification.call.example",$$slots:{default:[Ff]},$$scope:{ctx:F}}}),xt=new V({props:{anchor:"transformers.TFEsmForTokenClassification.call.example-2",$$slots:{default:[Mf]},$$scope:{ctx:F}}}),{c(){d=r("meta"),k=p(),c=r("h1"),u=r("a"),b=r("span"),T(n.$$.fragment),m=p(),M=r("span"),Ur=s("ESM"),Ea=p(),ye=r("h2"),Be=r("a"),ss=r("span"),T(Lt.$$.fragment),Rr=p(),as=r("span"),Wr=s("Overview"),Fa=s(`

This page provides code and pre-trained weights for Transformer protein language models from Meta AI's Fundamental 
AI Research Team, providing the state-of-the-art ESMFold and ESM-2, and the previously released ESM-1b and ESM-1v.
Transformer protein language models were introduced in the paper [Biological structure and function emerge from scaling
unsupervised learning to 250 million protein sequences](https://www.pnas.org/content/118/15/e2016239118) by 
Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle Ott, 
C. Lawrence Zitnick, Jerry Ma, and Rob Fergus.
The first version of this paper was [preprinted in 2019](https://www.biorxiv.org/content/10.1101/622803v1?versioned=true).
`),Ve=r("p"),Hr=s(`ESM-2 outperforms all tested single-sequence protein language models across a range of structure prediction tasks,
and enables atomic resolution structure prediction.
It was released with the paper `),Nt=r("a"),Kr=s(`Language models of protein sequences at the scale of evolution enable accurate
structure prediction`),Br=s(` by Zeming Lin, Halil Akin, Roshan Rao, Brian Hie,
Zhongkai Zhu, Wenting Lu, Allan dos Santos Costa, Maryam Fazel-Zarandi, Tom Sercu, Sal Candido and Alexander Rives.`),Ma=p(),Ze=r("p"),Vr=s(`Also introduced in this paper was ESMFold. It uses an ESM-2 stem with a head that can predict folded protein
structures with state-of-the-art accuracy. Unlike `),Dt=r("a"),Zr=s("AlphaFold2"),Gr=s(`,
it relies on the token embeddings from the large pre-trained protein language model stem and does not perform a multiple
sequence alignment (MSA) step at inference time, which means that ESMFold checkpoints are fully \u201Cstandalone\u201D -
they do not require a database of known protein sequences and structures with associated external query tools
to make predictions, and are much faster as a result.`),za=p(),pn=r("p"),Jr=s(`The abstract from
\u201CBiological structure and function emerge from scaling unsupervised learning to 250
million protein sequences\u201D is`),qa=p(),hn=r("p"),rs=r("em"),Qr=s(`In the field of artificial intelligence, a combination of scale in data and model capacity enabled by unsupervised
learning has led to major advances in representation learning and statistical generation. In the life sciences, the
anticipated growth of sequencing promises unprecedented data on natural sequence diversity. Protein language modeling
at the scale of evolution is a logical step toward predictive and generative artificial intelligence for biology. To
this end, we use unsupervised learning to train a deep contextual language model on 86 billion amino acids across 250
million protein sequences spanning evolutionary diversity. The resulting model contains information about biological
properties in its representations. The representations are learned from sequence data alone. The learned representation
space has a multiscale organization reflecting structure from the level of biochemical properties of amino acids to
remote homology of proteins. Information about secondary and tertiary structure is encoded in the representations and
can be identified by linear projections. Representation learning produces features that generalize across a range of
applications, enabling state-of-the-art supervised prediction of mutational effect and secondary structure and
improving state-of-the-art features for long-range contact prediction.`),xa=p(),fn=r("p"),Yr=s(`The abstract from
\u201CLanguage models of protein sequences at the scale of evolution enable accurate structure prediction\u201D is`),Ca=p(),un=r("p"),is=r("em"),Xr=s(`Large language models have recently been shown to develop emergent capabilities with scale, going beyond
simple pattern matching to perform higher level reasoning and generate lifelike images and text. While
language models trained on protein sequences have been studied at a smaller scale, little is known about
what they learn about biology as they are scaled up. In this work we train models up to 15 billion parameters,
the largest language models of proteins to be evaluated to date. We find that as models are scaled they learn
information enabling the prediction of the three-dimensional structure of a protein at the resolution of
individual atoms. We present ESMFold for high accuracy end-to-end atomic level structure prediction directly
from the individual sequence of a protein. ESMFold has similar accuracy to AlphaFold2 and RoseTTAFold for
sequences with low perplexity that are well understood by the language model. ESMFold inference is an
order of magnitude faster than AlphaFold2, enabling exploration of the structural space of metagenomic
proteins in practical timescales.`),ja=p(),gn=r("p"),ei=s("Tips:"),Pa=p(),_n=r("ul"),ls=r("li"),ti=s("ESM models are trained with a masked language modeling (MLM) objective."),Sa=p(),Q=r("p"),oi=s("The original code can be found "),Ot=r("a"),ni=s("here"),si=s(` and was
was developed by the Fundamental AI Research team at Meta AI.
ESM-1b, ESM-1v and ESM-2 were contributed to huggingface by `),It=r("a"),ai=s("jasonliu"),ri=s(`
and `),Ut=r("a"),ii=s("Matt"),li=s("."),Aa=p(),ae=r("p"),di=s("ESMFold was contributed to huggingface by "),Rt=r("a"),ci=s("Matt"),mi=s(` and
`),Wt=r("a"),pi=s("Sylvain"),hi=s(`, with a big thank you to Nikita Smetanin, Roshan Rao and Tom Sercu for their
help throughout the process!`),La=p(),re=r("p"),fi=s("The HuggingFace port of ESMFold uses portions of the "),Ht=r("a"),ui=s("openfold"),gi=s(` library.
The `),ds=r("code"),_i=s("openfold"),ki=s(" library is licensed under the Apache License 2.0."),Na=p(),ve=r("h2"),Ge=r("a"),cs=r("span"),T(Kt.$$.fragment),bi=p(),ms=r("span"),Ti=s("EsmConfig"),Da=p(),j=r("div"),T(Bt.$$.fragment),yi=p(),we=r("p"),vi=s("This is the configuration class to store the configuration of a "),ps=r("code"),wi=s("ESMModel"),$i=s(`. It is used to instantiate a ESM 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 ESM
`),Vt=r("a"),Ei=s("facebook/esm-1b"),Fi=s(" architecture."),Mi=p(),$e=r("p"),zi=s("Configuration objects inherit from "),kn=r("a"),qi=s("PretrainedConfig"),xi=s(` and can be used to control the model outputs. Read the
documentation from `),bn=r("a"),Ci=s("PretrainedConfig"),ji=s(" for more information."),Pi=p(),T(Je.$$.fragment),Si=p(),Qe=r("div"),T(Zt.$$.fragment),Ai=p(),Gt=r("p"),Li=s("Serializes this instance to a Python dictionary. Override the default "),Tn=r("a"),Ni=s("to_dict()"),Di=s("."),Oa=p(),Ee=r("h2"),Ye=r("a"),hs=r("span"),T(Jt.$$.fragment),Oi=p(),fs=r("span"),Ii=s("EsmTokenizer"),Ia=p(),x=r("div"),T(Qt.$$.fragment),Ui=p(),us=r("p"),Ri=s("Constructs an ESM tokenizer."),Wi=p(),yn=r("div"),T(Yt.$$.fragment),Hi=p(),Xe=r("div"),T(Xt.$$.fragment),Ki=p(),Fe=r("p"),Bi=s(`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),gs=r("code"),Vi=s("prepare_for_model"),Zi=s(" or "),_s=r("code"),Gi=s("encode_plus"),Ji=s(" methods."),Qi=p(),ie=r("div"),T(eo.$$.fragment),Yi=p(),vn=r("p"),Xi=s("Create the token type IDs corresponding to the sequences passed. "),wn=r("a"),el=s(`What are token type
IDs?`),tl=p(),ks=r("p"),ol=s("Should be overridden in a subclass if the model has a special way of building those."),nl=p(),$n=r("div"),T(to.$$.fragment),Ua=p(),Me=r("h2"),et=r("a"),bs=r("span"),T(oo.$$.fragment),sl=p(),Ts=r("span"),al=s("EsmModel"),Ra=p(),q=r("div"),T(no.$$.fragment),rl=p(),ys=r("p"),il=s("The bare ESM Model transformer outputting raw hidden-states without any specific head on top."),ll=p(),so=r("p"),dl=s("This model inherits from "),En=r("a"),cl=s("PreTrainedModel"),ml=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pl=p(),ao=r("p"),hl=s("This model is also a PyTorch "),ro=r("a"),fl=s("torch.nn.Module"),ul=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),gl=p(),io=r("p"),_l=s(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),lo=r("a"),kl=s(`Attention is
all you need`),bl=s(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Tl=p(),C=r("p"),yl=s("To behave as an decoder the model needs to be initialized with the "),vs=r("code"),vl=s("is_decoder"),wl=s(` argument of the configuration set
to `),ws=r("code"),$l=s("True"),El=s(". To be used in a Seq2Seq model, the model needs to initialized with both "),$s=r("code"),Fl=s("is_decoder"),Ml=s(` argument and
`),Es=r("code"),zl=s("add_cross_attention"),ql=s(" set to "),Fs=r("code"),xl=s("True"),Cl=s("; an "),Ms=r("code"),jl=s("encoder_hidden_states"),Pl=s(" is then expected as an input to the forward pass."),Sl=p(),Y=r("div"),T(co.$$.fragment),Al=p(),ze=r("p"),Ll=s("The "),Fn=r("a"),Nl=s("EsmModel"),Dl=s(" forward method, overrides the "),zs=r("code"),Ol=s("__call__"),Il=s(" special method."),Ul=p(),T(tt.$$.fragment),Rl=p(),T(ot.$$.fragment),Wa=p(),qe=r("h2"),nt=r("a"),qs=r("span"),T(mo.$$.fragment),Wl=p(),xs=r("span"),Hl=s("EsmForMaskedLM"),Ha=p(),P=r("div"),T(po.$$.fragment),Kl=p(),ho=r("p"),Bl=s("ESM Model with a "),Cs=r("code"),Vl=s("language modeling"),Zl=s(" head on top."),Gl=p(),fo=r("p"),Jl=s("This model inherits from "),Mn=r("a"),Ql=s("PreTrainedModel"),Yl=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Xl=p(),uo=r("p"),ed=s("This model is also a PyTorch "),go=r("a"),td=s("torch.nn.Module"),od=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),nd=p(),X=r("div"),T(_o.$$.fragment),sd=p(),xe=r("p"),ad=s("The "),zn=r("a"),rd=s("EsmForMaskedLM"),id=s(" forward method, overrides the "),js=r("code"),ld=s("__call__"),dd=s(" special method."),cd=p(),T(st.$$.fragment),md=p(),T(at.$$.fragment),Ka=p(),Ce=r("h2"),rt=r("a"),Ps=r("span"),T(ko.$$.fragment),pd=p(),Ss=r("span"),hd=s("EsmForSequenceClassification"),Ba=p(),S=r("div"),T(bo.$$.fragment),fd=p(),As=r("p"),ud=s(`ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),gd=p(),To=r("p"),_d=s("This model inherits from "),qn=r("a"),kd=s("PreTrainedModel"),bd=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Td=p(),yo=r("p"),yd=s("This model is also a PyTorch "),vo=r("a"),vd=s("torch.nn.Module"),wd=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$d=p(),U=r("div"),T(wo.$$.fragment),Ed=p(),je=r("p"),Fd=s("The "),xn=r("a"),Md=s("EsmForSequenceClassification"),zd=s(" forward method, overrides the "),Ls=r("code"),qd=s("__call__"),xd=s(" special method."),Cd=p(),T(it.$$.fragment),jd=p(),T(lt.$$.fragment),Pd=p(),T(dt.$$.fragment),Va=p(),Pe=r("h2"),ct=r("a"),Ns=r("span"),T($o.$$.fragment),Sd=p(),Ds=r("span"),Ad=s("EsmForTokenClassification"),Za=p(),A=r("div"),T(Eo.$$.fragment),Ld=p(),Os=r("p"),Nd=s(`ESM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Dd=p(),Fo=r("p"),Od=s("This model inherits from "),Cn=r("a"),Id=s("PreTrainedModel"),Ud=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Rd=p(),Mo=r("p"),Wd=s("This model is also a PyTorch "),zo=r("a"),Hd=s("torch.nn.Module"),Kd=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bd=p(),ee=r("div"),T(qo.$$.fragment),Vd=p(),Se=r("p"),Zd=s("The "),jn=r("a"),Gd=s("EsmForTokenClassification"),Jd=s(" forward method, overrides the "),Is=r("code"),Qd=s("__call__"),Yd=s(" special method."),Xd=p(),T(mt.$$.fragment),ec=p(),T(pt.$$.fragment),Ga=p(),Ae=r("h2"),ht=r("a"),Us=r("span"),T(xo.$$.fragment),tc=p(),Rs=r("span"),oc=s("EsmForProteinFolding"),Ja=p(),L=r("div"),T(Co.$$.fragment),nc=p(),Ws=r("p"),sc=s(`ESMForProteinFolding is the HuggingFace port of the original ESMFold model. It consists of an ESM-2 \u201Cstem\u201D followed
by a protein folding \u201Chead\u201D, although unlike most other output heads, this \u201Chead\u201D is similar in size and runtime to
the rest of the model combined! It outputs a dictionary containing predicted structural information about the input
protein(s).`),ac=p(),jo=r("p"),rc=s("This model inherits from "),Pn=r("a"),ic=s("PreTrainedModel"),lc=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),dc=p(),Po=r("p"),cc=s("This model is also a PyTorch "),So=r("a"),mc=s("torch.nn.Module"),pc=s(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hc=p(),te=r("div"),T(Ao.$$.fragment),fc=p(),Le=r("p"),uc=s("The "),Sn=r("a"),gc=s("EsmForProteinFolding"),_c=s(" forward method, overrides the "),Hs=r("code"),kc=s("__call__"),bc=s(" special method."),Tc=p(),T(ft.$$.fragment),yc=p(),T(ut.$$.fragment),Qa=p(),Ne=r("h2"),gt=r("a"),Ks=r("span"),T(Lo.$$.fragment),vc=p(),Bs=r("span"),wc=s("TFEsmModel"),Ya=p(),N=r("div"),T(No.$$.fragment),$c=p(),Vs=r("p"),Ec=s("The bare ESM Model transformer outputting raw hidden-states without any specific head on top."),Fc=p(),Do=r("p"),Mc=s("This model inherits from "),An=r("a"),zc=s("TFPreTrainedModel"),qc=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xc=p(),Oo=r("p"),Cc=s("This model is also a Keras "),Io=r("a"),jc=s("Model"),Pc=s(` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Sc=p(),oe=r("div"),T(Uo.$$.fragment),Ac=p(),De=r("p"),Lc=s("The "),Ln=r("a"),Nc=s("TFEsmModel"),Dc=s(" forward method, overrides the "),Zs=r("code"),Oc=s("__call__"),Ic=s(" special method."),Uc=p(),T(_t.$$.fragment),Rc=p(),T(kt.$$.fragment),Xa=p(),Oe=r("h2"),bt=r("a"),Gs=r("span"),T(Ro.$$.fragment),Wc=p(),Js=r("span"),Hc=s("TFEsmForMaskedLM"),er=p(),D=r("div"),T(Wo.$$.fragment),Kc=p(),Ho=r("p"),Bc=s("ESM Model with a "),Qs=r("code"),Vc=s("language modeling"),Zc=s(" head on top."),Gc=p(),Ko=r("p"),Jc=s("This model inherits from "),Nn=r("a"),Qc=s("TFPreTrainedModel"),Yc=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Xc=p(),Bo=r("p"),em=s("This model is also a Keras "),Vo=r("a"),tm=s("Model"),om=s(` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),nm=p(),R=r("div"),T(Zo.$$.fragment),sm=p(),Ie=r("p"),am=s("The "),Dn=r("a"),rm=s("TFEsmForMaskedLM"),im=s(" forward method, overrides the "),Ys=r("code"),lm=s("__call__"),dm=s(" special method."),cm=p(),T(Tt.$$.fragment),mm=p(),T(yt.$$.fragment),pm=p(),T(vt.$$.fragment),tr=p(),Ue=r("h2"),wt=r("a"),Xs=r("span"),T(Go.$$.fragment),hm=p(),ea=r("span"),fm=s("TFEsmForSequenceClassification"),or=p(),O=r("div"),T(Jo.$$.fragment),um=p(),ta=r("p"),gm=s(`ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),_m=p(),Qo=r("p"),km=s("This model inherits from "),On=r("a"),bm=s("TFPreTrainedModel"),Tm=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ym=p(),Yo=r("p"),vm=s("This model is also a Keras "),Xo=r("a"),wm=s("Model"),$m=s(` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Em=p(),W=r("div"),T(en.$$.fragment),Fm=p(),Re=r("p"),Mm=s("The "),In=r("a"),zm=s("TFEsmForSequenceClassification"),qm=s(" forward method, overrides the "),oa=r("code"),xm=s("__call__"),Cm=s(" special method."),jm=p(),T($t.$$.fragment),Pm=p(),T(Et.$$.fragment),Sm=p(),T(Ft.$$.fragment),nr=p(),We=r("h2"),Mt=r("a"),na=r("span"),T(tn.$$.fragment),Am=p(),sa=r("span"),Lm=s("TFEsmForTokenClassification"),sr=p(),I=r("div"),T(on.$$.fragment),Nm=p(),aa=r("p"),Dm=s(`ESM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Om=p(),nn=r("p"),Im=s("This model inherits from "),Un=r("a"),Um=s("TFPreTrainedModel"),Rm=s(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Wm=p(),sn=r("p"),Hm=s("This model is also a Keras "),an=r("a"),Km=s("Model"),Bm=s(` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Vm=p(),H=r("div"),T(rn.$$.fragment),Zm=p(),He=r("p"),Gm=s("The "),Rn=r("a"),Jm=s("TFEsmForTokenClassification"),Qm=s(" forward method, overrides the "),ra=r("code"),Ym=s("__call__"),Xm=s(" special method."),ep=p(),T(zt.$$.fragment),tp=p(),T(qt.$$.fragment),op=p(),T(xt.$$.fragment),this.h()},l(t){const g=of('[data-svelte="svelte-1phssyn"]',document.head);d=i(g,"META",{name:!0,content:!0}),g.forEach(o),k=h(t),c=i(t,"H1",{class:!0});var ln=l(c);u=i(ln,"A",{id:!0,class:!0,href:!0});var ia=l(u);b=i(ia,"SPAN",{});var la=l(b);y(n.$$.fragment,la),la.forEach(o),ia.forEach(o),m=h(ln),M=i(ln,"SPAN",{});var da=l(M);Ur=a(da,"ESM"),da.forEach(o),ln.forEach(o),Ea=h(t),ye=i(t,"H2",{class:!0});var dn=l(ye);Be=i(dn,"A",{id:!0,class:!0,href:!0});var ca=l(Be);ss=i(ca,"SPAN",{});var ma=l(ss);y(Lt.$$.fragment,ma),ma.forEach(o),ca.forEach(o),Rr=h(dn),as=i(dn,"SPAN",{});var pa=l(as);Wr=a(pa,"Overview"),pa.forEach(o),dn.forEach(o),Fa=a(t,`

This page provides code and pre-trained weights for Transformer protein language models from Meta AI's Fundamental 
AI Research Team, providing the state-of-the-art ESMFold and ESM-2, and the previously released ESM-1b and ESM-1v.
Transformer protein language models were introduced in the paper [Biological structure and function emerge from scaling
unsupervised learning to 250 million protein sequences](https://www.pnas.org/content/118/15/e2016239118) by 
Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle Ott, 
C. Lawrence Zitnick, Jerry Ma, and Rob Fergus.
The first version of this paper was [preprinted in 2019](https://www.biorxiv.org/content/10.1101/622803v1?versioned=true).
`),Ve=i(t,"P",{});var cn=l(Ve);Hr=a(cn,`ESM-2 outperforms all tested single-sequence protein language models across a range of structure prediction tasks,
and enables atomic resolution structure prediction.
It was released with the paper `),Nt=i(cn,"A",{href:!0,rel:!0});var ha=l(Nt);Kr=a(ha,`Language models of protein sequences at the scale of evolution enable accurate
structure prediction`),ha.forEach(o),Br=a(cn,` by Zeming Lin, Halil Akin, Roshan Rao, Brian Hie,
Zhongkai Zhu, Wenting Lu, Allan dos Santos Costa, Maryam Fazel-Zarandi, Tom Sercu, Sal Candido and Alexander Rives.`),cn.forEach(o),Ma=h(t),Ze=i(t,"P",{});var mn=l(Ze);Vr=a(mn,`Also introduced in this paper was ESMFold. It uses an ESM-2 stem with a head that can predict folded protein
structures with state-of-the-art accuracy. Unlike `),Dt=i(mn,"A",{href:!0,rel:!0});var fa=l(Dt);Zr=a(fa,"AlphaFold2"),fa.forEach(o),Gr=a(mn,`,
it relies on the token embeddings from the large pre-trained protein language model stem and does not perform a multiple
sequence alignment (MSA) step at inference time, which means that ESMFold checkpoints are fully \u201Cstandalone\u201D -
they do not require a database of known protein sequences and structures with associated external query tools
to make predictions, and are much faster as a result.`),mn.forEach(o),za=h(t),pn=i(t,"P",{});var ua=l(pn);Jr=a(ua,`The abstract from
\u201CBiological structure and function emerge from scaling unsupervised learning to 250
million protein sequences\u201D is`),ua.forEach(o),qa=h(t),hn=i(t,"P",{});var ga=l(hn);rs=i(ga,"EM",{});var _a=l(rs);Qr=a(_a,`In the field of artificial intelligence, a combination of scale in data and model capacity enabled by unsupervised
learning has led to major advances in representation learning and statistical generation. In the life sciences, the
anticipated growth of sequencing promises unprecedented data on natural sequence diversity. Protein language modeling
at the scale of evolution is a logical step toward predictive and generative artificial intelligence for biology. To
this end, we use unsupervised learning to train a deep contextual language model on 86 billion amino acids across 250
million protein sequences spanning evolutionary diversity. The resulting model contains information about biological
properties in its representations. The representations are learned from sequence data alone. The learned representation
space has a multiscale organization reflecting structure from the level of biochemical properties of amino acids to
remote homology of proteins. Information about secondary and tertiary structure is encoded in the representations and
can be identified by linear projections. Representation learning produces features that generalize across a range of
applications, enabling state-of-the-art supervised prediction of mutational effect and secondary structure and
improving state-of-the-art features for long-range contact prediction.`),_a.forEach(o),ga.forEach(o),xa=h(t),fn=i(t,"P",{});var ka=l(fn);Yr=a(ka,`The abstract from
\u201CLanguage models of protein sequences at the scale of evolution enable accurate structure prediction\u201D is`),ka.forEach(o),Ca=h(t),un=i(t,"P",{});var ba=l(un);is=i(ba,"EM",{});var Ta=l(is);Xr=a(Ta,`Large language models have recently been shown to develop emergent capabilities with scale, going beyond
simple pattern matching to perform higher level reasoning and generate lifelike images and text. While
language models trained on protein sequences have been studied at a smaller scale, little is known about
what they learn about biology as they are scaled up. In this work we train models up to 15 billion parameters,
the largest language models of proteins to be evaluated to date. We find that as models are scaled they learn
information enabling the prediction of the three-dimensional structure of a protein at the resolution of
individual atoms. We present ESMFold for high accuracy end-to-end atomic level structure prediction directly
from the individual sequence of a protein. ESMFold has similar accuracy to AlphaFold2 and RoseTTAFold for
sequences with low perplexity that are well understood by the language model. ESMFold inference is an
order of magnitude faster than AlphaFold2, enabling exploration of the structural space of metagenomic
proteins in practical timescales.`),Ta.forEach(o),ba.forEach(o),ja=h(t),gn=i(t,"P",{});var ya=l(gn);ei=a(ya,"Tips:"),ya.forEach(o),Pa=h(t),_n=i(t,"UL",{});var va=l(_n);ls=i(va,"LI",{});var wa=l(ls);ti=a(wa,"ESM models are trained with a masked language modeling (MLM) objective."),wa.forEach(o),va.forEach(o),Sa=h(t),Q=i(t,"P",{});var se=l(Q);oi=a(se,"The original code can be found "),Ot=i(se,"A",{href:!0,rel:!0});var $a=l(Ot);ni=a($a,"here"),$a.forEach(o),si=a(se,` and was
was developed by the Fundamental AI Research team at Meta AI.
ESM-1b, ESM-1v and ESM-2 were contributed to huggingface by `),It=i(se,"A",{href:!0,rel:!0});var sp=l(It);ai=a(sp,"jasonliu"),sp.forEach(o),ri=a(se,`
and `),Ut=i(se,"A",{href:!0,rel:!0});var ap=l(Ut);ii=a(ap,"Matt"),ap.forEach(o),li=a(se,"."),se.forEach(o),Aa=h(t),ae=i(t,"P",{});var Wn=l(ae);di=a(Wn,"ESMFold was contributed to huggingface by "),Rt=i(Wn,"A",{href:!0,rel:!0});var rp=l(Rt);ci=a(rp,"Matt"),rp.forEach(o),mi=a(Wn,` and
`),Wt=i(Wn,"A",{href:!0,rel:!0});var ip=l(Wt);pi=a(ip,"Sylvain"),ip.forEach(o),hi=a(Wn,`, with a big thank you to Nikita Smetanin, Roshan Rao and Tom Sercu for their
help throughout the process!`),Wn.forEach(o),La=h(t),re=i(t,"P",{});var Hn=l(re);fi=a(Hn,"The HuggingFace port of ESMFold uses portions of the "),Ht=i(Hn,"A",{href:!0,rel:!0});var lp=l(Ht);ui=a(lp,"openfold"),lp.forEach(o),gi=a(Hn,` library.
The `),ds=i(Hn,"CODE",{});var dp=l(ds);_i=a(dp,"openfold"),dp.forEach(o),ki=a(Hn," library is licensed under the Apache License 2.0."),Hn.forEach(o),Na=h(t),ve=i(t,"H2",{class:!0});var rr=l(ve);Ge=i(rr,"A",{id:!0,class:!0,href:!0});var cp=l(Ge);cs=i(cp,"SPAN",{});var mp=l(cs);y(Kt.$$.fragment,mp),mp.forEach(o),cp.forEach(o),bi=h(rr),ms=i(rr,"SPAN",{});var pp=l(ms);Ti=a(pp,"EsmConfig"),pp.forEach(o),rr.forEach(o),Da=h(t),j=i(t,"DIV",{class:!0});var le=l(j);y(Bt.$$.fragment,le),yi=h(le),we=i(le,"P",{});var Kn=l(we);vi=a(Kn,"This is the configuration class to store the configuration of a "),ps=i(Kn,"CODE",{});var hp=l(ps);wi=a(hp,"ESMModel"),hp.forEach(o),$i=a(Kn,`. It is used to instantiate a ESM 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 ESM
`),Vt=i(Kn,"A",{href:!0,rel:!0});var fp=l(Vt);Ei=a(fp,"facebook/esm-1b"),fp.forEach(o),Fi=a(Kn," architecture."),Kn.forEach(o),Mi=h(le),$e=i(le,"P",{});var Bn=l($e);zi=a(Bn,"Configuration objects inherit from "),kn=i(Bn,"A",{href:!0});var up=l(kn);qi=a(up,"PretrainedConfig"),up.forEach(o),xi=a(Bn,` and can be used to control the model outputs. Read the
documentation from `),bn=i(Bn,"A",{href:!0});var gp=l(bn);Ci=a(gp,"PretrainedConfig"),gp.forEach(o),ji=a(Bn," for more information."),Bn.forEach(o),Pi=h(le),y(Je.$$.fragment,le),Si=h(le),Qe=i(le,"DIV",{class:!0});var ir=l(Qe);y(Zt.$$.fragment,ir),Ai=h(ir),Gt=i(ir,"P",{});var lr=l(Gt);Li=a(lr,"Serializes this instance to a Python dictionary. Override the default "),Tn=i(lr,"A",{href:!0});var _p=l(Tn);Ni=a(_p,"to_dict()"),_p.forEach(o),Di=a(lr,"."),lr.forEach(o),ir.forEach(o),le.forEach(o),Oa=h(t),Ee=i(t,"H2",{class:!0});var dr=l(Ee);Ye=i(dr,"A",{id:!0,class:!0,href:!0});var kp=l(Ye);hs=i(kp,"SPAN",{});var bp=l(hs);y(Jt.$$.fragment,bp),bp.forEach(o),kp.forEach(o),Oi=h(dr),fs=i(dr,"SPAN",{});var Tp=l(fs);Ii=a(Tp,"EsmTokenizer"),Tp.forEach(o),dr.forEach(o),Ia=h(t),x=i(t,"DIV",{class:!0});var ne=l(x);y(Qt.$$.fragment,ne),Ui=h(ne),us=i(ne,"P",{});var yp=l(us);Ri=a(yp,"Constructs an ESM tokenizer."),yp.forEach(o),Wi=h(ne),yn=i(ne,"DIV",{class:!0});var vp=l(yn);y(Yt.$$.fragment,vp),vp.forEach(o),Hi=h(ne),Xe=i(ne,"DIV",{class:!0});var cr=l(Xe);y(Xt.$$.fragment,cr),Ki=h(cr),Fe=i(cr,"P",{});var Vn=l(Fe);Bi=a(Vn,`Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),gs=i(Vn,"CODE",{});var wp=l(gs);Vi=a(wp,"prepare_for_model"),wp.forEach(o),Zi=a(Vn," or "),_s=i(Vn,"CODE",{});var $p=l(_s);Gi=a($p,"encode_plus"),$p.forEach(o),Ji=a(Vn," methods."),Vn.forEach(o),cr.forEach(o),Qi=h(ne),ie=i(ne,"DIV",{class:!0});var Zn=l(ie);y(eo.$$.fragment,Zn),Yi=h(Zn),vn=i(Zn,"P",{});var np=l(vn);Xi=a(np,"Create the token type IDs corresponding to the sequences passed. "),wn=i(np,"A",{href:!0});var Ep=l(wn);el=a(Ep,`What are token type
IDs?`),Ep.forEach(o),np.forEach(o),tl=h(Zn),ks=i(Zn,"P",{});var Fp=l(ks);ol=a(Fp,"Should be overridden in a subclass if the model has a special way of building those."),Fp.forEach(o),Zn.forEach(o),nl=h(ne),$n=i(ne,"DIV",{class:!0});var Mp=l($n);y(to.$$.fragment,Mp),Mp.forEach(o),ne.forEach(o),Ua=h(t),Me=i(t,"H2",{class:!0});var mr=l(Me);et=i(mr,"A",{id:!0,class:!0,href:!0});var zp=l(et);bs=i(zp,"SPAN",{});var qp=l(bs);y(oo.$$.fragment,qp),qp.forEach(o),zp.forEach(o),sl=h(mr),Ts=i(mr,"SPAN",{});var xp=l(Ts);al=a(xp,"EsmModel"),xp.forEach(o),mr.forEach(o),Ra=h(t),q=i(t,"DIV",{class:!0});var K=l(q);y(no.$$.fragment,K),rl=h(K),ys=i(K,"P",{});var Cp=l(ys);il=a(Cp,"The bare ESM Model transformer outputting raw hidden-states without any specific head on top."),Cp.forEach(o),ll=h(K),so=i(K,"P",{});var pr=l(so);dl=a(pr,"This model inherits from "),En=i(pr,"A",{href:!0});var jp=l(En);cl=a(jp,"PreTrainedModel"),jp.forEach(o),ml=a(pr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),pr.forEach(o),pl=h(K),ao=i(K,"P",{});var hr=l(ao);hl=a(hr,"This model is also a PyTorch "),ro=i(hr,"A",{href:!0,rel:!0});var Pp=l(ro);fl=a(Pp,"torch.nn.Module"),Pp.forEach(o),ul=a(hr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hr.forEach(o),gl=h(K),io=i(K,"P",{});var fr=l(io);_l=a(fr,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),lo=i(fr,"A",{href:!0,rel:!0});var Sp=l(lo);kl=a(Sp,`Attention is
all you need`),Sp.forEach(o),bl=a(fr,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),fr.forEach(o),Tl=h(K),C=i(K,"P",{});var B=l(C);yl=a(B,"To behave as an decoder the model needs to be initialized with the "),vs=i(B,"CODE",{});var Ap=l(vs);vl=a(Ap,"is_decoder"),Ap.forEach(o),wl=a(B,` argument of the configuration set
to `),ws=i(B,"CODE",{});var Lp=l(ws);$l=a(Lp,"True"),Lp.forEach(o),El=a(B,". To be used in a Seq2Seq model, the model needs to initialized with both "),$s=i(B,"CODE",{});var Np=l($s);Fl=a(Np,"is_decoder"),Np.forEach(o),Ml=a(B,` argument and
`),Es=i(B,"CODE",{});var Dp=l(Es);zl=a(Dp,"add_cross_attention"),Dp.forEach(o),ql=a(B," set to "),Fs=i(B,"CODE",{});var Op=l(Fs);xl=a(Op,"True"),Op.forEach(o),Cl=a(B,"; an "),Ms=i(B,"CODE",{});var Ip=l(Ms);jl=a(Ip,"encoder_hidden_states"),Ip.forEach(o),Pl=a(B," is then expected as an input to the forward pass."),B.forEach(o),Sl=h(K),Y=i(K,"DIV",{class:!0});var Ct=l(Y);y(co.$$.fragment,Ct),Al=h(Ct),ze=i(Ct,"P",{});var Gn=l(ze);Ll=a(Gn,"The "),Fn=i(Gn,"A",{href:!0});var Up=l(Fn);Nl=a(Up,"EsmModel"),Up.forEach(o),Dl=a(Gn," forward method, overrides the "),zs=i(Gn,"CODE",{});var Rp=l(zs);Ol=a(Rp,"__call__"),Rp.forEach(o),Il=a(Gn," special method."),Gn.forEach(o),Ul=h(Ct),y(tt.$$.fragment,Ct),Rl=h(Ct),y(ot.$$.fragment,Ct),Ct.forEach(o),K.forEach(o),Wa=h(t),qe=i(t,"H2",{class:!0});var ur=l(qe);nt=i(ur,"A",{id:!0,class:!0,href:!0});var Wp=l(nt);qs=i(Wp,"SPAN",{});var Hp=l(qs);y(mo.$$.fragment,Hp),Hp.forEach(o),Wp.forEach(o),Wl=h(ur),xs=i(ur,"SPAN",{});var Kp=l(xs);Hl=a(Kp,"EsmForMaskedLM"),Kp.forEach(o),ur.forEach(o),Ha=h(t),P=i(t,"DIV",{class:!0});var de=l(P);y(po.$$.fragment,de),Kl=h(de),ho=i(de,"P",{});var gr=l(ho);Bl=a(gr,"ESM Model with a "),Cs=i(gr,"CODE",{});var Bp=l(Cs);Vl=a(Bp,"language modeling"),Bp.forEach(o),Zl=a(gr," head on top."),gr.forEach(o),Gl=h(de),fo=i(de,"P",{});var _r=l(fo);Jl=a(_r,"This model inherits from "),Mn=i(_r,"A",{href:!0});var Vp=l(Mn);Ql=a(Vp,"PreTrainedModel"),Vp.forEach(o),Yl=a(_r,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_r.forEach(o),Xl=h(de),uo=i(de,"P",{});var kr=l(uo);ed=a(kr,"This model is also a PyTorch "),go=i(kr,"A",{href:!0,rel:!0});var Zp=l(go);td=a(Zp,"torch.nn.Module"),Zp.forEach(o),od=a(kr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),kr.forEach(o),nd=h(de),X=i(de,"DIV",{class:!0});var jt=l(X);y(_o.$$.fragment,jt),sd=h(jt),xe=i(jt,"P",{});var Jn=l(xe);ad=a(Jn,"The "),zn=i(Jn,"A",{href:!0});var Gp=l(zn);rd=a(Gp,"EsmForMaskedLM"),Gp.forEach(o),id=a(Jn," forward method, overrides the "),js=i(Jn,"CODE",{});var Jp=l(js);ld=a(Jp,"__call__"),Jp.forEach(o),dd=a(Jn," special method."),Jn.forEach(o),cd=h(jt),y(st.$$.fragment,jt),md=h(jt),y(at.$$.fragment,jt),jt.forEach(o),de.forEach(o),Ka=h(t),Ce=i(t,"H2",{class:!0});var br=l(Ce);rt=i(br,"A",{id:!0,class:!0,href:!0});var Qp=l(rt);Ps=i(Qp,"SPAN",{});var Yp=l(Ps);y(ko.$$.fragment,Yp),Yp.forEach(o),Qp.forEach(o),pd=h(br),Ss=i(br,"SPAN",{});var Xp=l(Ss);hd=a(Xp,"EsmForSequenceClassification"),Xp.forEach(o),br.forEach(o),Ba=h(t),S=i(t,"DIV",{class:!0});var ce=l(S);y(bo.$$.fragment,ce),fd=h(ce),As=i(ce,"P",{});var eh=l(As);ud=a(eh,`ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),eh.forEach(o),gd=h(ce),To=i(ce,"P",{});var Tr=l(To);_d=a(Tr,"This model inherits from "),qn=i(Tr,"A",{href:!0});var th=l(qn);kd=a(th,"PreTrainedModel"),th.forEach(o),bd=a(Tr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Tr.forEach(o),Td=h(ce),yo=i(ce,"P",{});var yr=l(yo);yd=a(yr,"This model is also a PyTorch "),vo=i(yr,"A",{href:!0,rel:!0});var oh=l(vo);vd=a(oh,"torch.nn.Module"),oh.forEach(o),wd=a(yr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),yr.forEach(o),$d=h(ce),U=i(ce,"DIV",{class:!0});var me=l(U);y(wo.$$.fragment,me),Ed=h(me),je=i(me,"P",{});var Qn=l(je);Fd=a(Qn,"The "),xn=i(Qn,"A",{href:!0});var nh=l(xn);Md=a(nh,"EsmForSequenceClassification"),nh.forEach(o),zd=a(Qn," forward method, overrides the "),Ls=i(Qn,"CODE",{});var sh=l(Ls);qd=a(sh,"__call__"),sh.forEach(o),xd=a(Qn," special method."),Qn.forEach(o),Cd=h(me),y(it.$$.fragment,me),jd=h(me),y(lt.$$.fragment,me),Pd=h(me),y(dt.$$.fragment,me),me.forEach(o),ce.forEach(o),Va=h(t),Pe=i(t,"H2",{class:!0});var vr=l(Pe);ct=i(vr,"A",{id:!0,class:!0,href:!0});var ah=l(ct);Ns=i(ah,"SPAN",{});var rh=l(Ns);y($o.$$.fragment,rh),rh.forEach(o),ah.forEach(o),Sd=h(vr),Ds=i(vr,"SPAN",{});var ih=l(Ds);Ad=a(ih,"EsmForTokenClassification"),ih.forEach(o),vr.forEach(o),Za=h(t),A=i(t,"DIV",{class:!0});var pe=l(A);y(Eo.$$.fragment,pe),Ld=h(pe),Os=i(pe,"P",{});var lh=l(Os);Nd=a(lh,`ESM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),lh.forEach(o),Dd=h(pe),Fo=i(pe,"P",{});var wr=l(Fo);Od=a(wr,"This model inherits from "),Cn=i(wr,"A",{href:!0});var dh=l(Cn);Id=a(dh,"PreTrainedModel"),dh.forEach(o),Ud=a(wr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),wr.forEach(o),Rd=h(pe),Mo=i(pe,"P",{});var $r=l(Mo);Wd=a($r,"This model is also a PyTorch "),zo=i($r,"A",{href:!0,rel:!0});var ch=l(zo);Hd=a(ch,"torch.nn.Module"),ch.forEach(o),Kd=a($r,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$r.forEach(o),Bd=h(pe),ee=i(pe,"DIV",{class:!0});var Pt=l(ee);y(qo.$$.fragment,Pt),Vd=h(Pt),Se=i(Pt,"P",{});var Yn=l(Se);Zd=a(Yn,"The "),jn=i(Yn,"A",{href:!0});var mh=l(jn);Gd=a(mh,"EsmForTokenClassification"),mh.forEach(o),Jd=a(Yn," forward method, overrides the "),Is=i(Yn,"CODE",{});var ph=l(Is);Qd=a(ph,"__call__"),ph.forEach(o),Yd=a(Yn," special method."),Yn.forEach(o),Xd=h(Pt),y(mt.$$.fragment,Pt),ec=h(Pt),y(pt.$$.fragment,Pt),Pt.forEach(o),pe.forEach(o),Ga=h(t),Ae=i(t,"H2",{class:!0});var Er=l(Ae);ht=i(Er,"A",{id:!0,class:!0,href:!0});var hh=l(ht);Us=i(hh,"SPAN",{});var fh=l(Us);y(xo.$$.fragment,fh),fh.forEach(o),hh.forEach(o),tc=h(Er),Rs=i(Er,"SPAN",{});var uh=l(Rs);oc=a(uh,"EsmForProteinFolding"),uh.forEach(o),Er.forEach(o),Ja=h(t),L=i(t,"DIV",{class:!0});var he=l(L);y(Co.$$.fragment,he),nc=h(he),Ws=i(he,"P",{});var gh=l(Ws);sc=a(gh,`ESMForProteinFolding is the HuggingFace port of the original ESMFold model. It consists of an ESM-2 \u201Cstem\u201D followed
by a protein folding \u201Chead\u201D, although unlike most other output heads, this \u201Chead\u201D is similar in size and runtime to
the rest of the model combined! It outputs a dictionary containing predicted structural information about the input
protein(s).`),gh.forEach(o),ac=h(he),jo=i(he,"P",{});var Fr=l(jo);rc=a(Fr,"This model inherits from "),Pn=i(Fr,"A",{href:!0});var _h=l(Pn);ic=a(_h,"PreTrainedModel"),_h.forEach(o),lc=a(Fr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Fr.forEach(o),dc=h(he),Po=i(he,"P",{});var Mr=l(Po);cc=a(Mr,"This model is also a PyTorch "),So=i(Mr,"A",{href:!0,rel:!0});var kh=l(So);mc=a(kh,"torch.nn.Module"),kh.forEach(o),pc=a(Mr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mr.forEach(o),hc=h(he),te=i(he,"DIV",{class:!0});var St=l(te);y(Ao.$$.fragment,St),fc=h(St),Le=i(St,"P",{});var Xn=l(Le);uc=a(Xn,"The "),Sn=i(Xn,"A",{href:!0});var bh=l(Sn);gc=a(bh,"EsmForProteinFolding"),bh.forEach(o),_c=a(Xn," forward method, overrides the "),Hs=i(Xn,"CODE",{});var Th=l(Hs);kc=a(Th,"__call__"),Th.forEach(o),bc=a(Xn," special method."),Xn.forEach(o),Tc=h(St),y(ft.$$.fragment,St),yc=h(St),y(ut.$$.fragment,St),St.forEach(o),he.forEach(o),Qa=h(t),Ne=i(t,"H2",{class:!0});var zr=l(Ne);gt=i(zr,"A",{id:!0,class:!0,href:!0});var yh=l(gt);Ks=i(yh,"SPAN",{});var vh=l(Ks);y(Lo.$$.fragment,vh),vh.forEach(o),yh.forEach(o),vc=h(zr),Bs=i(zr,"SPAN",{});var wh=l(Bs);wc=a(wh,"TFEsmModel"),wh.forEach(o),zr.forEach(o),Ya=h(t),N=i(t,"DIV",{class:!0});var fe=l(N);y(No.$$.fragment,fe),$c=h(fe),Vs=i(fe,"P",{});var $h=l(Vs);Ec=a($h,"The bare ESM Model transformer outputting raw hidden-states without any specific head on top."),$h.forEach(o),Fc=h(fe),Do=i(fe,"P",{});var qr=l(Do);Mc=a(qr,"This model inherits from "),An=i(qr,"A",{href:!0});var Eh=l(An);zc=a(Eh,"TFPreTrainedModel"),Eh.forEach(o),qc=a(qr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qr.forEach(o),xc=h(fe),Oo=i(fe,"P",{});var xr=l(Oo);Cc=a(xr,"This model is also a Keras "),Io=i(xr,"A",{href:!0,rel:!0});var Fh=l(Io);jc=a(Fh,"Model"),Fh.forEach(o),Pc=a(xr,` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),xr.forEach(o),Sc=h(fe),oe=i(fe,"DIV",{class:!0});var At=l(oe);y(Uo.$$.fragment,At),Ac=h(At),De=i(At,"P",{});var es=l(De);Lc=a(es,"The "),Ln=i(es,"A",{href:!0});var Mh=l(Ln);Nc=a(Mh,"TFEsmModel"),Mh.forEach(o),Dc=a(es," forward method, overrides the "),Zs=i(es,"CODE",{});var zh=l(Zs);Oc=a(zh,"__call__"),zh.forEach(o),Ic=a(es," special method."),es.forEach(o),Uc=h(At),y(_t.$$.fragment,At),Rc=h(At),y(kt.$$.fragment,At),At.forEach(o),fe.forEach(o),Xa=h(t),Oe=i(t,"H2",{class:!0});var Cr=l(Oe);bt=i(Cr,"A",{id:!0,class:!0,href:!0});var qh=l(bt);Gs=i(qh,"SPAN",{});var xh=l(Gs);y(Ro.$$.fragment,xh),xh.forEach(o),qh.forEach(o),Wc=h(Cr),Js=i(Cr,"SPAN",{});var Ch=l(Js);Hc=a(Ch,"TFEsmForMaskedLM"),Ch.forEach(o),Cr.forEach(o),er=h(t),D=i(t,"DIV",{class:!0});var ue=l(D);y(Wo.$$.fragment,ue),Kc=h(ue),Ho=i(ue,"P",{});var jr=l(Ho);Bc=a(jr,"ESM Model with a "),Qs=i(jr,"CODE",{});var jh=l(Qs);Vc=a(jh,"language modeling"),jh.forEach(o),Zc=a(jr," head on top."),jr.forEach(o),Gc=h(ue),Ko=i(ue,"P",{});var Pr=l(Ko);Jc=a(Pr,"This model inherits from "),Nn=i(Pr,"A",{href:!0});var Ph=l(Nn);Qc=a(Ph,"TFPreTrainedModel"),Ph.forEach(o),Yc=a(Pr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Pr.forEach(o),Xc=h(ue),Bo=i(ue,"P",{});var Sr=l(Bo);em=a(Sr,"This model is also a Keras "),Vo=i(Sr,"A",{href:!0,rel:!0});var Sh=l(Vo);tm=a(Sh,"Model"),Sh.forEach(o),om=a(Sr,` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Sr.forEach(o),nm=h(ue),R=i(ue,"DIV",{class:!0});var ge=l(R);y(Zo.$$.fragment,ge),sm=h(ge),Ie=i(ge,"P",{});var ts=l(Ie);am=a(ts,"The "),Dn=i(ts,"A",{href:!0});var Ah=l(Dn);rm=a(Ah,"TFEsmForMaskedLM"),Ah.forEach(o),im=a(ts," forward method, overrides the "),Ys=i(ts,"CODE",{});var Lh=l(Ys);lm=a(Lh,"__call__"),Lh.forEach(o),dm=a(ts," special method."),ts.forEach(o),cm=h(ge),y(Tt.$$.fragment,ge),mm=h(ge),y(yt.$$.fragment,ge),pm=h(ge),y(vt.$$.fragment,ge),ge.forEach(o),ue.forEach(o),tr=h(t),Ue=i(t,"H2",{class:!0});var Ar=l(Ue);wt=i(Ar,"A",{id:!0,class:!0,href:!0});var Nh=l(wt);Xs=i(Nh,"SPAN",{});var Dh=l(Xs);y(Go.$$.fragment,Dh),Dh.forEach(o),Nh.forEach(o),hm=h(Ar),ea=i(Ar,"SPAN",{});var Oh=l(ea);fm=a(Oh,"TFEsmForSequenceClassification"),Oh.forEach(o),Ar.forEach(o),or=h(t),O=i(t,"DIV",{class:!0});var _e=l(O);y(Jo.$$.fragment,_e),um=h(_e),ta=i(_e,"P",{});var Ih=l(ta);gm=a(Ih,`ESM Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Ih.forEach(o),_m=h(_e),Qo=i(_e,"P",{});var Lr=l(Qo);km=a(Lr,"This model inherits from "),On=i(Lr,"A",{href:!0});var Uh=l(On);bm=a(Uh,"TFPreTrainedModel"),Uh.forEach(o),Tm=a(Lr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Lr.forEach(o),ym=h(_e),Yo=i(_e,"P",{});var Nr=l(Yo);vm=a(Nr,"This model is also a Keras "),Xo=i(Nr,"A",{href:!0,rel:!0});var Rh=l(Xo);wm=a(Rh,"Model"),Rh.forEach(o),$m=a(Nr,` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Nr.forEach(o),Em=h(_e),W=i(_e,"DIV",{class:!0});var ke=l(W);y(en.$$.fragment,ke),Fm=h(ke),Re=i(ke,"P",{});var os=l(Re);Mm=a(os,"The "),In=i(os,"A",{href:!0});var Wh=l(In);zm=a(Wh,"TFEsmForSequenceClassification"),Wh.forEach(o),qm=a(os," forward method, overrides the "),oa=i(os,"CODE",{});var Hh=l(oa);xm=a(Hh,"__call__"),Hh.forEach(o),Cm=a(os," special method."),os.forEach(o),jm=h(ke),y($t.$$.fragment,ke),Pm=h(ke),y(Et.$$.fragment,ke),Sm=h(ke),y(Ft.$$.fragment,ke),ke.forEach(o),_e.forEach(o),nr=h(t),We=i(t,"H2",{class:!0});var Dr=l(We);Mt=i(Dr,"A",{id:!0,class:!0,href:!0});var Kh=l(Mt);na=i(Kh,"SPAN",{});var Bh=l(na);y(tn.$$.fragment,Bh),Bh.forEach(o),Kh.forEach(o),Am=h(Dr),sa=i(Dr,"SPAN",{});var Vh=l(sa);Lm=a(Vh,"TFEsmForTokenClassification"),Vh.forEach(o),Dr.forEach(o),sr=h(t),I=i(t,"DIV",{class:!0});var be=l(I);y(on.$$.fragment,be),Nm=h(be),aa=i(be,"P",{});var Zh=l(aa);Dm=a(Zh,`ESM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Zh.forEach(o),Om=h(be),nn=i(be,"P",{});var Or=l(nn);Im=a(Or,"This model inherits from "),Un=i(Or,"A",{href:!0});var Gh=l(Un);Um=a(Gh,"TFPreTrainedModel"),Gh.forEach(o),Rm=a(Or,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Or.forEach(o),Wm=h(be),sn=i(be,"P",{});var Ir=l(sn);Hm=a(Ir,"This model is also a Keras "),an=i(Ir,"A",{href:!0,rel:!0});var Jh=l(an);Km=a(Jh,"Model"),Jh.forEach(o),Bm=a(Ir,` subclass. Use it as a
regular Keras model and refer to the TF/Keras documentation for all matters related to general usage and behavior.`),Ir.forEach(o),Vm=h(be),H=i(be,"DIV",{class:!0});var Te=l(H);y(rn.$$.fragment,Te),Zm=h(Te),He=i(Te,"P",{});var ns=l(He);Gm=a(ns,"The "),Rn=i(ns,"A",{href:!0});var Qh=l(Rn);Jm=a(Qh,"TFEsmForTokenClassification"),Qh.forEach(o),Qm=a(ns," forward method, overrides the "),ra=i(ns,"CODE",{});var Yh=l(ra);Ym=a(Yh,"__call__"),Yh.forEach(o),Xm=a(ns," special method."),ns.forEach(o),ep=h(Te),y(zt.$$.fragment,Te),tp=h(Te),y(qt.$$.fragment,Te),op=h(Te),y(xt.$$.fragment,Te),Te.forEach(o),be.forEach(o),this.h()},h(){f(d,"name","hf:doc:metadata"),f(d,"content",JSON.stringify(qf)),f(u,"id","esm"),f(u,"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"),f(u,"href","#esm"),f(c,"class","relative group"),f(Be,"id","overview"),f(Be,"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"),f(Be,"href","#overview"),f(ye,"class","relative group"),f(Nt,"href","https://doi.org/10.1101/2022.07.20.500902"),f(Nt,"rel","nofollow"),f(Dt,"href","https://www.nature.com/articles/s41586-021-03819-2"),f(Dt,"rel","nofollow"),f(Ot,"href","https://github.com/facebookresearch/esm"),f(Ot,"rel","nofollow"),f(It,"href","https://huggingface.co/jasonliu"),f(It,"rel","nofollow"),f(Ut,"href","https://huggingface.co/Rocketknight1"),f(Ut,"rel","nofollow"),f(Rt,"href","https://huggingface.co/Rocketknight1"),f(Rt,"rel","nofollow"),f(Wt,"href","https://huggingface.co/sgugger"),f(Wt,"rel","nofollow"),f(Ht,"href","https://github.com/aqlaboratory/openfold"),f(Ht,"rel","nofollow"),f(Ge,"id","transformers.EsmConfig"),f(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Ge,"href","#transformers.EsmConfig"),f(ve,"class","relative group"),f(Vt,"href","https://huggingface.co/facebook/esm-1b"),f(Vt,"rel","nofollow"),f(kn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(bn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(Tn,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig.to_dict"),f(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ye,"id","transformers.EsmTokenizer"),f(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(Ye,"href","#transformers.EsmTokenizer"),f(Ee,"class","relative group"),f(yn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(wn,"href","../glossary#token-type-ids"),f(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f($n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(et,"id","transformers.EsmModel"),f(et,"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"),f(et,"href","#transformers.EsmModel"),f(Me,"class","relative group"),f(En,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(ro,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ro,"rel","nofollow"),f(lo,"href","https://arxiv.org/abs/1706.03762"),f(lo,"rel","nofollow"),f(Fn,"href","/docs/transformers/main/en/model_doc/esm#transformers.EsmModel"),f(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(nt,"id","transformers.EsmForMaskedLM"),f(nt,"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"),f(nt,"href","#transformers.EsmForMaskedLM"),f(qe,"class","relative group"),f(Mn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(go,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(go,"rel","nofollow"),f(zn,"href","/docs/transformers/main/en/model_doc/esm#transformers.EsmForMaskedLM"),f(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(rt,"id","transformers.EsmForSequenceClassification"),f(rt,"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"),f(rt,"href","#transformers.EsmForSequenceClassification"),f(Ce,"class","relative group"),f(qn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(vo,"rel","nofollow"),f(xn,"href","/docs/transformers/main/en/model_doc/esm#transformers.EsmForSequenceClassification"),f(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ct,"id","transformers.EsmForTokenClassification"),f(ct,"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"),f(ct,"href","#transformers.EsmForTokenClassification"),f(Pe,"class","relative group"),f(Cn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(zo,"rel","nofollow"),f(jn,"href","/docs/transformers/main/en/model_doc/esm#transformers.EsmForTokenClassification"),f(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ht,"id","transformers.EsmForProteinFolding"),f(ht,"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"),f(ht,"href","#transformers.EsmForProteinFolding"),f(Ae,"class","relative group"),f(Pn,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(So,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(So,"rel","nofollow"),f(Sn,"href","/docs/transformers/main/en/model_doc/esm#transformers.EsmForProteinFolding"),f(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(gt,"id","transformers.TFEsmModel"),f(gt,"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"),f(gt,"href","#transformers.TFEsmModel"),f(Ne,"class","relative group"),f(An,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(Io,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Io,"rel","nofollow"),f(Ln,"href","/docs/transformers/main/en/model_doc/esm#transformers.TFEsmModel"),f(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(bt,"id","transformers.TFEsmForMaskedLM"),f(bt,"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"),f(bt,"href","#transformers.TFEsmForMaskedLM"),f(Oe,"class","relative group"),f(Nn,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(Vo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Vo,"rel","nofollow"),f(Dn,"href","/docs/transformers/main/en/model_doc/esm#transformers.TFEsmForMaskedLM"),f(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(wt,"id","transformers.TFEsmForSequenceClassification"),f(wt,"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"),f(wt,"href","#transformers.TFEsmForSequenceClassification"),f(Ue,"class","relative group"),f(On,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(Xo,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Xo,"rel","nofollow"),f(In,"href","/docs/transformers/main/en/model_doc/esm#transformers.TFEsmForSequenceClassification"),f(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Mt,"id","transformers.TFEsmForTokenClassification"),f(Mt,"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"),f(Mt,"href","#transformers.TFEsmForTokenClassification"),f(We,"class","relative group"),f(Un,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(an,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(an,"rel","nofollow"),f(Rn,"href","/docs/transformers/main/en/model_doc/esm#transformers.TFEsmForTokenClassification"),f(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(I,"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,g){e(document.head,d),_(t,k,g),_(t,c,g),e(c,u),e(u,b),v(n,b,null),e(c,m),e(c,M),e(M,Ur),_(t,Ea,g),_(t,ye,g),e(ye,Be),e(Be,ss),v(Lt,ss,null),e(ye,Rr),e(ye,as),e(as,Wr),_(t,Fa,g),_(t,Ve,g),e(Ve,Hr),e(Ve,Nt),e(Nt,Kr),e(Ve,Br),_(t,Ma,g),_(t,Ze,g),e(Ze,Vr),e(Ze,Dt),e(Dt,Zr),e(Ze,Gr),_(t,za,g),_(t,pn,g),e(pn,Jr),_(t,qa,g),_(t,hn,g),e(hn,rs),e(rs,Qr),_(t,xa,g),_(t,fn,g),e(fn,Yr),_(t,Ca,g),_(t,un,g),e(un,is),e(is,Xr),_(t,ja,g),_(t,gn,g),e(gn,ei),_(t,Pa,g),_(t,_n,g),e(_n,ls),e(ls,ti),_(t,Sa,g),_(t,Q,g),e(Q,oi),e(Q,Ot),e(Ot,ni),e(Q,si),e(Q,It),e(It,ai),e(Q,ri),e(Q,Ut),e(Ut,ii),e(Q,li),_(t,Aa,g),_(t,ae,g),e(ae,di),e(ae,Rt),e(Rt,ci),e(ae,mi),e(ae,Wt),e(Wt,pi),e(ae,hi),_(t,La,g),_(t,re,g),e(re,fi),e(re,Ht),e(Ht,ui),e(re,gi),e(re,ds),e(ds,_i),e(re,ki),_(t,Na,g),_(t,ve,g),e(ve,Ge),e(Ge,cs),v(Kt,cs,null),e(ve,bi),e(ve,ms),e(ms,Ti),_(t,Da,g),_(t,j,g),v(Bt,j,null),e(j,yi),e(j,we),e(we,vi),e(we,ps),e(ps,wi),e(we,$i),e(we,Vt),e(Vt,Ei),e(we,Fi),e(j,Mi),e(j,$e),e($e,zi),e($e,kn),e(kn,qi),e($e,xi),e($e,bn),e(bn,Ci),e($e,ji),e(j,Pi),v(Je,j,null),e(j,Si),e(j,Qe),v(Zt,Qe,null),e(Qe,Ai),e(Qe,Gt),e(Gt,Li),e(Gt,Tn),e(Tn,Ni),e(Gt,Di),_(t,Oa,g),_(t,Ee,g),e(Ee,Ye),e(Ye,hs),v(Jt,hs,null),e(Ee,Oi),e(Ee,fs),e(fs,Ii),_(t,Ia,g),_(t,x,g),v(Qt,x,null),e(x,Ui),e(x,us),e(us,Ri),e(x,Wi),e(x,yn),v(Yt,yn,null),e(x,Hi),e(x,Xe),v(Xt,Xe,null),e(Xe,Ki),e(Xe,Fe),e(Fe,Bi),e(Fe,gs),e(gs,Vi),e(Fe,Zi),e(Fe,_s),e(_s,Gi),e(Fe,Ji),e(x,Qi),e(x,ie),v(eo,ie,null),e(ie,Yi),e(ie,vn),e(vn,Xi),e(vn,wn),e(wn,el),e(ie,tl),e(ie,ks),e(ks,ol),e(x,nl),e(x,$n),v(to,$n,null),_(t,Ua,g),_(t,Me,g),e(Me,et),e(et,bs),v(oo,bs,null),e(Me,sl),e(Me,Ts),e(Ts,al),_(t,Ra,g),_(t,q,g),v(no,q,null),e(q,rl),e(q,ys),e(ys,il),e(q,ll),e(q,so),e(so,dl),e(so,En),e(En,cl),e(so,ml),e(q,pl),e(q,ao),e(ao,hl),e(ao,ro),e(ro,fl),e(ao,ul),e(q,gl),e(q,io),e(io,_l),e(io,lo),e(lo,kl),e(io,bl),e(q,Tl),e(q,C),e(C,yl),e(C,vs),e(vs,vl),e(C,wl),e(C,ws),e(ws,$l),e(C,El),e(C,$s),e($s,Fl),e(C,Ml),e(C,Es),e(Es,zl),e(C,ql),e(C,Fs),e(Fs,xl),e(C,Cl),e(C,Ms),e(Ms,jl),e(C,Pl),e(q,Sl),e(q,Y),v(co,Y,null),e(Y,Al),e(Y,ze),e(ze,Ll),e(ze,Fn),e(Fn,Nl),e(ze,Dl),e(ze,zs),e(zs,Ol),e(ze,Il),e(Y,Ul),v(tt,Y,null),e(Y,Rl),v(ot,Y,null),_(t,Wa,g),_(t,qe,g),e(qe,nt),e(nt,qs),v(mo,qs,null),e(qe,Wl),e(qe,xs),e(xs,Hl),_(t,Ha,g),_(t,P,g),v(po,P,null),e(P,Kl),e(P,ho),e(ho,Bl),e(ho,Cs),e(Cs,Vl),e(ho,Zl),e(P,Gl),e(P,fo),e(fo,Jl),e(fo,Mn),e(Mn,Ql),e(fo,Yl),e(P,Xl),e(P,uo),e(uo,ed),e(uo,go),e(go,td),e(uo,od),e(P,nd),e(P,X),v(_o,X,null),e(X,sd),e(X,xe),e(xe,ad),e(xe,zn),e(zn,rd),e(xe,id),e(xe,js),e(js,ld),e(xe,dd),e(X,cd),v(st,X,null),e(X,md),v(at,X,null),_(t,Ka,g),_(t,Ce,g),e(Ce,rt),e(rt,Ps),v(ko,Ps,null),e(Ce,pd),e(Ce,Ss),e(Ss,hd),_(t,Ba,g),_(t,S,g),v(bo,S,null),e(S,fd),e(S,As),e(As,ud),e(S,gd),e(S,To),e(To,_d),e(To,qn),e(qn,kd),e(To,bd),e(S,Td),e(S,yo),e(yo,yd),e(yo,vo),e(vo,vd),e(yo,wd),e(S,$d),e(S,U),v(wo,U,null),e(U,Ed),e(U,je),e(je,Fd),e(je,xn),e(xn,Md),e(je,zd),e(je,Ls),e(Ls,qd),e(je,xd),e(U,Cd),v(it,U,null),e(U,jd),v(lt,U,null),e(U,Pd),v(dt,U,null),_(t,Va,g),_(t,Pe,g),e(Pe,ct),e(ct,Ns),v($o,Ns,null),e(Pe,Sd),e(Pe,Ds),e(Ds,Ad),_(t,Za,g),_(t,A,g),v(Eo,A,null),e(A,Ld),e(A,Os),e(Os,Nd),e(A,Dd),e(A,Fo),e(Fo,Od),e(Fo,Cn),e(Cn,Id),e(Fo,Ud),e(A,Rd),e(A,Mo),e(Mo,Wd),e(Mo,zo),e(zo,Hd),e(Mo,Kd),e(A,Bd),e(A,ee),v(qo,ee,null),e(ee,Vd),e(ee,Se),e(Se,Zd),e(Se,jn),e(jn,Gd),e(Se,Jd),e(Se,Is),e(Is,Qd),e(Se,Yd),e(ee,Xd),v(mt,ee,null),e(ee,ec),v(pt,ee,null),_(t,Ga,g),_(t,Ae,g),e(Ae,ht),e(ht,Us),v(xo,Us,null),e(Ae,tc),e(Ae,Rs),e(Rs,oc),_(t,Ja,g),_(t,L,g),v(Co,L,null),e(L,nc),e(L,Ws),e(Ws,sc),e(L,ac),e(L,jo),e(jo,rc),e(jo,Pn),e(Pn,ic),e(jo,lc),e(L,dc),e(L,Po),e(Po,cc),e(Po,So),e(So,mc),e(Po,pc),e(L,hc),e(L,te),v(Ao,te,null),e(te,fc),e(te,Le),e(Le,uc),e(Le,Sn),e(Sn,gc),e(Le,_c),e(Le,Hs),e(Hs,kc),e(Le,bc),e(te,Tc),v(ft,te,null),e(te,yc),v(ut,te,null),_(t,Qa,g),_(t,Ne,g),e(Ne,gt),e(gt,Ks),v(Lo,Ks,null),e(Ne,vc),e(Ne,Bs),e(Bs,wc),_(t,Ya,g),_(t,N,g),v(No,N,null),e(N,$c),e(N,Vs),e(Vs,Ec),e(N,Fc),e(N,Do),e(Do,Mc),e(Do,An),e(An,zc),e(Do,qc),e(N,xc),e(N,Oo),e(Oo,Cc),e(Oo,Io),e(Io,jc),e(Oo,Pc),e(N,Sc),e(N,oe),v(Uo,oe,null),e(oe,Ac),e(oe,De),e(De,Lc),e(De,Ln),e(Ln,Nc),e(De,Dc),e(De,Zs),e(Zs,Oc),e(De,Ic),e(oe,Uc),v(_t,oe,null),e(oe,Rc),v(kt,oe,null),_(t,Xa,g),_(t,Oe,g),e(Oe,bt),e(bt,Gs),v(Ro,Gs,null),e(Oe,Wc),e(Oe,Js),e(Js,Hc),_(t,er,g),_(t,D,g),v(Wo,D,null),e(D,Kc),e(D,Ho),e(Ho,Bc),e(Ho,Qs),e(Qs,Vc),e(Ho,Zc),e(D,Gc),e(D,Ko),e(Ko,Jc),e(Ko,Nn),e(Nn,Qc),e(Ko,Yc),e(D,Xc),e(D,Bo),e(Bo,em),e(Bo,Vo),e(Vo,tm),e(Bo,om),e(D,nm),e(D,R),v(Zo,R,null),e(R,sm),e(R,Ie),e(Ie,am),e(Ie,Dn),e(Dn,rm),e(Ie,im),e(Ie,Ys),e(Ys,lm),e(Ie,dm),e(R,cm),v(Tt,R,null),e(R,mm),v(yt,R,null),e(R,pm),v(vt,R,null),_(t,tr,g),_(t,Ue,g),e(Ue,wt),e(wt,Xs),v(Go,Xs,null),e(Ue,hm),e(Ue,ea),e(ea,fm),_(t,or,g),_(t,O,g),v(Jo,O,null),e(O,um),e(O,ta),e(ta,gm),e(O,_m),e(O,Qo),e(Qo,km),e(Qo,On),e(On,bm),e(Qo,Tm),e(O,ym),e(O,Yo),e(Yo,vm),e(Yo,Xo),e(Xo,wm),e(Yo,$m),e(O,Em),e(O,W),v(en,W,null),e(W,Fm),e(W,Re),e(Re,Mm),e(Re,In),e(In,zm),e(Re,qm),e(Re,oa),e(oa,xm),e(Re,Cm),e(W,jm),v($t,W,null),e(W,Pm),v(Et,W,null),e(W,Sm),v(Ft,W,null),_(t,nr,g),_(t,We,g),e(We,Mt),e(Mt,na),v(tn,na,null),e(We,Am),e(We,sa),e(sa,Lm),_(t,sr,g),_(t,I,g),v(on,I,null),e(I,Nm),e(I,aa),e(aa,Dm),e(I,Om),e(I,nn),e(nn,Im),e(nn,Un),e(Un,Um),e(nn,Rm),e(I,Wm),e(I,sn),e(sn,Hm),e(sn,an),e(an,Km),e(sn,Bm),e(I,Vm),e(I,H),v(rn,H,null),e(H,Zm),e(H,He),e(He,Gm),e(He,Rn),e(Rn,Jm),e(He,Qm),e(He,ra),e(ra,Ym),e(He,Xm),e(H,ep),v(zt,H,null),e(H,tp),v(qt,H,null),e(H,op),v(xt,H,null),ar=!0},p(t,[g]){const ln={};g&2&&(ln.$$scope={dirty:g,ctx:t}),Je.$set(ln);const ia={};g&2&&(ia.$$scope={dirty:g,ctx:t}),tt.$set(ia);const la={};g&2&&(la.$$scope={dirty:g,ctx:t}),ot.$set(la);const da={};g&2&&(da.$$scope={dirty:g,ctx:t}),st.$set(da);const dn={};g&2&&(dn.$$scope={dirty:g,ctx:t}),at.$set(dn);const ca={};g&2&&(ca.$$scope={dirty:g,ctx:t}),it.$set(ca);const ma={};g&2&&(ma.$$scope={dirty:g,ctx:t}),lt.$set(ma);const pa={};g&2&&(pa.$$scope={dirty:g,ctx:t}),dt.$set(pa);const cn={};g&2&&(cn.$$scope={dirty:g,ctx:t}),mt.$set(cn);const ha={};g&2&&(ha.$$scope={dirty:g,ctx:t}),pt.$set(ha);const mn={};g&2&&(mn.$$scope={dirty:g,ctx:t}),ft.$set(mn);const fa={};g&2&&(fa.$$scope={dirty:g,ctx:t}),ut.$set(fa);const ua={};g&2&&(ua.$$scope={dirty:g,ctx:t}),_t.$set(ua);const ga={};g&2&&(ga.$$scope={dirty:g,ctx:t}),kt.$set(ga);const _a={};g&2&&(_a.$$scope={dirty:g,ctx:t}),Tt.$set(_a);const ka={};g&2&&(ka.$$scope={dirty:g,ctx:t}),yt.$set(ka);const ba={};g&2&&(ba.$$scope={dirty:g,ctx:t}),vt.$set(ba);const Ta={};g&2&&(Ta.$$scope={dirty:g,ctx:t}),$t.$set(Ta);const ya={};g&2&&(ya.$$scope={dirty:g,ctx:t}),Et.$set(ya);const va={};g&2&&(va.$$scope={dirty:g,ctx:t}),Ft.$set(va);const wa={};g&2&&(wa.$$scope={dirty:g,ctx:t}),zt.$set(wa);const se={};g&2&&(se.$$scope={dirty:g,ctx:t}),qt.$set(se);const $a={};g&2&&($a.$$scope={dirty:g,ctx:t}),xt.$set($a)},i(t){ar||(w(n.$$.fragment,t),w(Lt.$$.fragment,t),w(Kt.$$.fragment,t),w(Bt.$$.fragment,t),w(Je.$$.fragment,t),w(Zt.$$.fragment,t),w(Jt.$$.fragment,t),w(Qt.$$.fragment,t),w(Yt.$$.fragment,t),w(Xt.$$.fragment,t),w(eo.$$.fragment,t),w(to.$$.fragment,t),w(oo.$$.fragment,t),w(no.$$.fragment,t),w(co.$$.fragment,t),w(tt.$$.fragment,t),w(ot.$$.fragment,t),w(mo.$$.fragment,t),w(po.$$.fragment,t),w(_o.$$.fragment,t),w(st.$$.fragment,t),w(at.$$.fragment,t),w(ko.$$.fragment,t),w(bo.$$.fragment,t),w(wo.$$.fragment,t),w(it.$$.fragment,t),w(lt.$$.fragment,t),w(dt.$$.fragment,t),w($o.$$.fragment,t),w(Eo.$$.fragment,t),w(qo.$$.fragment,t),w(mt.$$.fragment,t),w(pt.$$.fragment,t),w(xo.$$.fragment,t),w(Co.$$.fragment,t),w(Ao.$$.fragment,t),w(ft.$$.fragment,t),w(ut.$$.fragment,t),w(Lo.$$.fragment,t),w(No.$$.fragment,t),w(Uo.$$.fragment,t),w(_t.$$.fragment,t),w(kt.$$.fragment,t),w(Ro.$$.fragment,t),w(Wo.$$.fragment,t),w(Zo.$$.fragment,t),w(Tt.$$.fragment,t),w(yt.$$.fragment,t),w(vt.$$.fragment,t),w(Go.$$.fragment,t),w(Jo.$$.fragment,t),w(en.$$.fragment,t),w($t.$$.fragment,t),w(Et.$$.fragment,t),w(Ft.$$.fragment,t),w(tn.$$.fragment,t),w(on.$$.fragment,t),w(rn.$$.fragment,t),w(zt.$$.fragment,t),w(qt.$$.fragment,t),w(xt.$$.fragment,t),ar=!0)},o(t){$(n.$$.fragment,t),$(Lt.$$.fragment,t),$(Kt.$$.fragment,t),$(Bt.$$.fragment,t),$(Je.$$.fragment,t),$(Zt.$$.fragment,t),$(Jt.$$.fragment,t),$(Qt.$$.fragment,t),$(Yt.$$.fragment,t),$(Xt.$$.fragment,t),$(eo.$$.fragment,t),$(to.$$.fragment,t),$(oo.$$.fragment,t),$(no.$$.fragment,t),$(co.$$.fragment,t),$(tt.$$.fragment,t),$(ot.$$.fragment,t),$(mo.$$.fragment,t),$(po.$$.fragment,t),$(_o.$$.fragment,t),$(st.$$.fragment,t),$(at.$$.fragment,t),$(ko.$$.fragment,t),$(bo.$$.fragment,t),$(wo.$$.fragment,t),$(it.$$.fragment,t),$(lt.$$.fragment,t),$(dt.$$.fragment,t),$($o.$$.fragment,t),$(Eo.$$.fragment,t),$(qo.$$.fragment,t),$(mt.$$.fragment,t),$(pt.$$.fragment,t),$(xo.$$.fragment,t),$(Co.$$.fragment,t),$(Ao.$$.fragment,t),$(ft.$$.fragment,t),$(ut.$$.fragment,t),$(Lo.$$.fragment,t),$(No.$$.fragment,t),$(Uo.$$.fragment,t),$(_t.$$.fragment,t),$(kt.$$.fragment,t),$(Ro.$$.fragment,t),$(Wo.$$.fragment,t),$(Zo.$$.fragment,t),$(Tt.$$.fragment,t),$(yt.$$.fragment,t),$(vt.$$.fragment,t),$(Go.$$.fragment,t),$(Jo.$$.fragment,t),$(en.$$.fragment,t),$($t.$$.fragment,t),$(Et.$$.fragment,t),$(Ft.$$.fragment,t),$(tn.$$.fragment,t),$(on.$$.fragment,t),$(rn.$$.fragment,t),$(zt.$$.fragment,t),$(qt.$$.fragment,t),$(xt.$$.fragment,t),ar=!1},d(t){o(d),t&&o(k),t&&o(c),E(n),t&&o(Ea),t&&o(ye),E(Lt),t&&o(Fa),t&&o(Ve),t&&o(Ma),t&&o(Ze),t&&o(za),t&&o(pn),t&&o(qa),t&&o(hn),t&&o(xa),t&&o(fn),t&&o(Ca),t&&o(un),t&&o(ja),t&&o(gn),t&&o(Pa),t&&o(_n),t&&o(Sa),t&&o(Q),t&&o(Aa),t&&o(ae),t&&o(La),t&&o(re),t&&o(Na),t&&o(ve),E(Kt),t&&o(Da),t&&o(j),E(Bt),E(Je),E(Zt),t&&o(Oa),t&&o(Ee),E(Jt),t&&o(Ia),t&&o(x),E(Qt),E(Yt),E(Xt),E(eo),E(to),t&&o(Ua),t&&o(Me),E(oo),t&&o(Ra),t&&o(q),E(no),E(co),E(tt),E(ot),t&&o(Wa),t&&o(qe),E(mo),t&&o(Ha),t&&o(P),E(po),E(_o),E(st),E(at),t&&o(Ka),t&&o(Ce),E(ko),t&&o(Ba),t&&o(S),E(bo),E(wo),E(it),E(lt),E(dt),t&&o(Va),t&&o(Pe),E($o),t&&o(Za),t&&o(A),E(Eo),E(qo),E(mt),E(pt),t&&o(Ga),t&&o(Ae),E(xo),t&&o(Ja),t&&o(L),E(Co),E(Ao),E(ft),E(ut),t&&o(Qa),t&&o(Ne),E(Lo),t&&o(Ya),t&&o(N),E(No),E(Uo),E(_t),E(kt),t&&o(Xa),t&&o(Oe),E(Ro),t&&o(er),t&&o(D),E(Wo),E(Zo),E(Tt),E(yt),E(vt),t&&o(tr),t&&o(Ue),E(Go),t&&o(or),t&&o(O),E(Jo),E(en),E($t),E(Et),E(Ft),t&&o(nr),t&&o(We),E(tn),t&&o(sr),t&&o(I),E(on),E(rn),E(zt),E(qt),E(xt)}}}const qf={local:"esm",sections:[{local:"overview",title:"Overview"},{local:"transformers.EsmConfig",title:"EsmConfig"},{local:"transformers.EsmTokenizer",title:"EsmTokenizer"},{local:"transformers.EsmModel",title:"EsmModel"},{local:"transformers.EsmForMaskedLM",title:"EsmForMaskedLM"},{local:"transformers.EsmForSequenceClassification",title:"EsmForSequenceClassification"},{local:"transformers.EsmForTokenClassification",title:"EsmForTokenClassification"},{local:"transformers.EsmForProteinFolding",title:"EsmForProteinFolding"},{local:"transformers.TFEsmModel",title:"TFEsmModel"},{local:"transformers.TFEsmForMaskedLM",title:"TFEsmForMaskedLM"},{local:"transformers.TFEsmForSequenceClassification",title:"TFEsmForSequenceClassification"},{local:"transformers.TFEsmForTokenClassification",title:"TFEsmForTokenClassification"}],title:"ESM"};function xf(F){return nf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Nf extends Xh{constructor(d){super();ef(this,d,xf,zf,tf,{})}}export{Nf as default,qf as metadata};
