import{s as Hs,o as Qs,n as P}from"../chunks/scheduler.36a0863c.js";import{S as Bs,i as qs,g as w,s as m,r as M,A as As,h as T,f as l,c,j as Fs,u as g,x as J,k as Ys,y as Ls,a as n,v as h,d as y,t as $,w as j}from"../chunks/index.f891bdb2.js";import{T as Re}from"../chunks/Tip.a8272f7f.js";import{Y as ys}from"../chunks/Youtube.0cbacd3d.js";import{C as v}from"../chunks/CodeBlock.3ec784ea.js";import{F as $s,M as Ze}from"../chunks/Markdown.7b58822e.js";import{H as Ge,E as Ns}from"../chunks/EditOnGithub.a58e27a9.js";function Ss(C){let s,d='Mira la <a href="https://huggingface.co/tasks/text-generation" rel="nofollow">página de tarea</a> para generación de texto y la <a href="https://huggingface.co/tasks/fill-mask" rel="nofollow">página de tarea</a> para modelos de lenguajes por enmascaramiento para obtener más información sobre los modelos, datasets, y métricas asociadas.';return{c(){s=w("p"),s.innerHTML=d},l(t){s=T(t,"P",{"data-svelte-h":!0}),J(s)!=="svelte-kfpohj"&&(s.innerHTML=d)},m(t,o){n(t,s,o)},p:P,d(t){t&&l(s)}}}function Ds(C){let s,d="Puedes usar el token de final de secuencia como el token de relleno y asignar <code>mlm=False</code>. Esto usará los inputs como etiquetas movidas un elemento hacia la derecha:",t,o,f,u,G="Para modelados de lenguaje por enmascaramiento usa el mismo <code>DataCollatorForLanguageModeling</code> excepto que deberás especificar <code>mlm_probability</code> para enmascarar tokens aleatoriamente cada vez que iteras sobre los datos.",x,R,k;return o=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvckZvckxhbmd1YWdlTW9kZWxpbmclMEElMEF0b2tlbml6ZXIucGFkX3Rva2VuJTIwJTNEJTIwdG9rZW5pemVyLmVvc190b2tlbiUwQWRhdGFfY29sbGF0b3IlMjAlM0QlMjBEYXRhQ29sbGF0b3JGb3JMYW5ndWFnZU1vZGVsaW5nKHRva2VuaXplciUzRHRva2VuaXplciUyQyUyMG1sbSUzREZhbHNlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.pad_token = tokenizer.eos_token
<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=<span class="hljs-literal">False</span>)`,wrap:!1}}),R=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvckZvckxhbmd1YWdlTW9kZWxpbmclMEElMEF0b2tlbml6ZXIucGFkX3Rva2VuJTIwJTNEJTIwdG9rZW5pemVyLmVvc190b2tlbiUwQWRhdGFfY29sbGF0b3IlMjAlM0QlMjBEYXRhQ29sbGF0b3JGb3JMYW5ndWFnZU1vZGVsaW5nKHRva2VuaXplciUzRHRva2VuaXplciUyQyUyMG1sbV9wcm9iYWJpbGl0eSUzRDAuMTUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.pad_token = tokenizer.eos_token
<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm_probability=<span class="hljs-number">0.15</span>)`,wrap:!1}}),{c(){s=w("p"),s.innerHTML=d,t=m(),M(o.$$.fragment),f=m(),u=w("p"),u.innerHTML=G,x=m(),M(R.$$.fragment)},l(i){s=T(i,"P",{"data-svelte-h":!0}),J(s)!=="svelte-uvilkn"&&(s.innerHTML=d),t=c(i),g(o.$$.fragment,i),f=c(i),u=T(i,"P",{"data-svelte-h":!0}),J(u)!=="svelte-1sc95x7"&&(u.innerHTML=G),x=c(i),g(R.$$.fragment,i)},m(i,_){n(i,s,_),n(i,t,_),h(o,i,_),n(i,f,_),n(i,u,_),n(i,x,_),h(R,i,_),k=!0},p:P,i(i){k||(y(o.$$.fragment,i),y(R.$$.fragment,i),k=!0)},o(i){$(o.$$.fragment,i),$(R.$$.fragment,i),k=!1},d(i){i&&(l(s),l(t),l(f),l(u),l(x)),j(o,i),j(R,i)}}}function Ps(C){let s,d;return s=new Ze({props:{$$slots:{default:[Ds]},$$scope:{ctx:C}}}),{c(){M(s.$$.fragment)},l(t){g(s.$$.fragment,t)},m(t,o){h(s,t,o),d=!0},p(t,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:t}),s.$set(f)},i(t){d||(y(s.$$.fragment,t),d=!0)},o(t){$(s.$$.fragment,t),d=!1},d(t){j(s,t)}}}function Ks(C){let s,d="Puedes usar el token de final de secuencia como el token de relleno y asignar <code>mlm=False</code>. Esto usará los inputs como etiquetas movidas un elemento hacia la derecha:",t,o,f,u,G="Para modelados de lenguajes por enmascaramiento usa el mismo <code>DataCollatorForLanguageModeling</code> excepto que deberás especificar <code>mlm_probability</code> para enmascarar tokens aleatoriamente cada vez que iteras sobre los datos.",x,R,k;return o=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvckZvckxhbmd1YWdlTW9kZWxpbmclMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGF0YUNvbGxhdG9yRm9yTGFuZ3VhZ2VNb2RlbGluZyh0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMjBtbG0lM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`,wrap:!1}}),R=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvckZvckxhbmd1YWdlTW9kZWxpbmclMEElMEFkYXRhX2NvbGxhdG9yJTIwJTNEJTIwRGF0YUNvbGxhdG9yRm9yTGFuZ3VhZ2VNb2RlbGluZyh0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMjBtbG0lM0RGYWxzZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorForLanguageModeling

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`,wrap:!1}}),{c(){s=w("p"),s.innerHTML=d,t=m(),M(o.$$.fragment),f=m(),u=w("p"),u.innerHTML=G,x=m(),M(R.$$.fragment)},l(i){s=T(i,"P",{"data-svelte-h":!0}),J(s)!=="svelte-uvilkn"&&(s.innerHTML=d),t=c(i),g(o.$$.fragment,i),f=c(i),u=T(i,"P",{"data-svelte-h":!0}),J(u)!=="svelte-1jtycjg"&&(u.innerHTML=G),x=c(i),g(R.$$.fragment,i)},m(i,_){n(i,s,_),n(i,t,_),h(o,i,_),n(i,f,_),n(i,u,_),n(i,x,_),h(R,i,_),k=!0},p:P,i(i){k||(y(o.$$.fragment,i),y(R.$$.fragment,i),k=!0)},o(i){$(o.$$.fragment,i),$(R.$$.fragment,i),k=!1},d(i){i&&(l(s),l(t),l(f),l(u),l(x)),j(o,i),j(R,i)}}}function Os(C){let s,d;return s=new Ze({props:{$$slots:{default:[Ks]},$$scope:{ctx:C}}}),{c(){M(s.$$.fragment)},l(t){g(s.$$.fragment,t)},m(t,o){h(s,t,o),d=!0},p(t,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:t}),s.$set(f)},i(t){d||(y(s.$$.fragment,t),d=!0)},o(t){$(s.$$.fragment,t),d=!1},d(t){j(s,t)}}}function et(C){let s,d='Si no estás familiarizado con el proceso de realizar fine-tuning sobre un modelo con <code>Trainer</code>, considera el tutorial básico <a href="../training#finetune-with-trainer">aquí</a>!';return{c(){s=w("p"),s.innerHTML=d},l(t){s=T(t,"P",{"data-svelte-h":!0}),J(s)!=="svelte-1rt7ku5"&&(s.innerHTML=d)},m(t,o){n(t,s,o)},p:P,d(t){t&&l(s)}}}function st(C){let s,d="Carga DistilGPT2 con <code>AutoModelForCausalLM</code>:",t,o,f,u,G,x,R="A este punto, solo faltan tres pasos:",k,i,_="<li>Definir tus hiperparámetros de entrenamiento en <code>TrainingArguments</code>.</li> <li>Pasarle los argumentos de entrenamiento a <code>Trainer</code> junto con el modelo, dataset, y el data collator.</li> <li>Realiza la llamada <code>train()</code> para realizar el fine-tuning sobre tu modelo.</li>",Z,I,z;return o=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbGdwdDIlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilbert/distilgpt2&quot;</span>)`,wrap:!1}}),u=new Re({props:{$$slots:{default:[et]},$$scope:{ctx:C}}}),I=new v({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGcmVzdWx0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfc3RyYXRlZ3klM0QlMjJlcG9jaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0QyZS01JTJDJTBBJTIwJTIwJTIwJTIwd2VpZ2h0X2RlY2F5JTNEMC4wMSUyQyUwQSklMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEbG1fZGF0YXNldCU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEbG1fZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBkYXRhX2NvbGxhdG9yJTNEZGF0YV9jb2xsYXRvciUyQyUwQSklMEElMEF0cmFpbmVyLnRyYWluKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;./results&quot;</span>,
<span class="hljs-meta">... </span>    eval_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">2e-5</span>,
<span class="hljs-meta">... </span>    weight_decay=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=lm_dataset[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=lm_dataset[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`,wrap:!1}}),{c(){s=w("p"),s.innerHTML=d,t=m(),M(o.$$.fragment),f=m(),M(u.$$.fragment),G=m(),x=w("p"),x.textContent=R,k=m(),i=w("ol"),i.innerHTML=_,Z=m(),M(I.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),J(s)!=="svelte-1yy4yh2"&&(s.innerHTML=d),t=c(p),g(o.$$.fragment,p),f=c(p),g(u.$$.fragment,p),G=c(p),x=T(p,"P",{"data-svelte-h":!0}),J(x)!=="svelte-1fkdw25"&&(x.textContent=R),k=c(p),i=T(p,"OL",{"data-svelte-h":!0}),J(i)!=="svelte-16tq1zt"&&(i.innerHTML=_),Z=c(p),g(I.$$.fragment,p)},m(p,U){n(p,s,U),n(p,t,U),h(o,p,U),n(p,f,U),h(u,p,U),n(p,G,U),n(p,x,U),n(p,k,U),n(p,i,U),n(p,Z,U),h(I,p,U),z=!0},p(p,U){const W={};U&2&&(W.$$scope={dirty:U,ctx:p}),u.$set(W)},i(p){z||(y(o.$$.fragment,p),y(u.$$.fragment,p),y(I.$$.fragment,p),z=!0)},o(p){$(o.$$.fragment,p),$(u.$$.fragment,p),$(I.$$.fragment,p),z=!1},d(p){p&&(l(s),l(t),l(f),l(G),l(x),l(k),l(i),l(Z)),j(o,p),j(u,p),j(I,p)}}}function tt(C){let s,d;return s=new Ze({props:{$$slots:{default:[st]},$$scope:{ctx:C}}}),{c(){M(s.$$.fragment)},l(t){g(s.$$.fragment,t)},m(t,o){h(s,t,o),d=!0},p(t,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:t}),s.$set(f)},i(t){d||(y(s.$$.fragment,t),d=!0)},o(t){$(s.$$.fragment,t),d=!1},d(t){j(s,t)}}}function at(C){let s,d='Si no estás familiarizado con realizar fine-tuning de tus modelos con Keras, considera el tutorial básico <a href="training#finetune-with-keras">aquí</a>!';return{c(){s=w("p"),s.innerHTML=d},l(t){s=T(t,"P",{"data-svelte-h":!0}),J(s)!=="svelte-txxfse"&&(s.innerHTML=d)},m(t,o){n(t,s,o)},p:P,d(t){t&&l(s)}}}function lt(C){let s,d='Para realizar el fine-tuning de un modelo en TensorFlow, comienza por convertir tus datasets al formato <code>tf.data.Dataset</code> con <a href="https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset.to_tf_dataset" rel="nofollow"><code>to_tf_dataset</code></a>. Especifica los inputs y etiquetas en <code>columns</code>, ya sea para mezclar el dataset, tamaño de lote, y el data collator:',t,o,f,u,G,x,R="Crea la función optimizadora, la tasa de aprendizaje, y algunos hiperparámetros de entrenamiento:",k,i,_,Z,I="Carga DistilGPT2 con <code>TFAutoModelForCausalLM</code>:",z,p,U,W,q='Configura el modelo para entrenamiento con <a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>:',F,X,Q,E,A='Llama a <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a> para realizar el fine-tuning del modelo:',Y,V,H;return o=new v({props:{code:"dGZfdHJhaW5fc2V0JTIwJTNEJTIwbG1fZGF0YXNldCU1QiUyMnRyYWluJTIyJTVELnRvX3RmX2RhdGFzZXQoJTBBJTIwJTIwJTIwJTIwY29sdW1ucyUzRCU1QiUyMmF0dGVudGlvbl9tYXNrJTIyJTJDJTIwJTIyaW5wdXRfaWRzJTIyJTJDJTIwJTIybGFiZWxzJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZHVtbXlfbGFiZWxzJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHNodWZmbGUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwY29sbGF0ZV9mbiUzRGRhdGFfY29sbGF0b3IlMkMlMEEpJTBBJTBBdGZfdGVzdF9zZXQlMjAlM0QlMjBsbV9kYXRhc2V0JTVCJTIydGVzdCUyMiU1RC50b190Zl9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMGNvbHVtbnMlM0QlNUIlMjJhdHRlbnRpb25fbWFzayUyMiUyQyUyMCUyMmlucHV0X2lkcyUyMiUyQyUyMCUyMmxhYmVscyUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGR1bW15X2xhYmVscyUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBzaHVmZmxlJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBiYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBjb2xsYXRlX2ZuJTNEZGF0YV9jb2xsYXRvciUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = lm_dataset[<span class="hljs-string">&quot;train&quot;</span>].to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>],
<span class="hljs-meta">... </span>    dummy_labels=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_test_set = lm_dataset[<span class="hljs-string">&quot;test&quot;</span>].to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>],
<span class="hljs-meta">... </span>    dummy_labels=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)`,wrap:!1}}),u=new Re({props:{$$slots:{default:[at]},$$scope:{ctx:C}}}),i=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGNyZWF0ZV9vcHRpbWl6ZXIlMkMlMjBBZGFtV2VpZ2h0RGVjYXklMEElMEFvcHRpbWl6ZXIlMjAlM0QlMjBBZGFtV2VpZ2h0RGVjYXkobGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMjB3ZWlnaHRfZGVjYXlfcmF0ZSUzRDAuMDEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer, AdamWeightDecay

<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer = AdamWeightDecay(learning_rate=<span class="hljs-number">2e-5</span>, weight_decay_rate=<span class="hljs-number">0.01</span>)`,wrap:!1}}),p=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQlMkZkaXN0aWxncHQyJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForCausalLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilbert/distilgpt2&quot;</span>)`,wrap:!1}}),X=new v({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEFtb2RlbC5jb21waWxlKG9wdGltaXplciUzRG9wdGltaXplcik=",highlighted:`<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>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)`,wrap:!1}}),V=new v({props:{code:"bW9kZWwuZml0KHglM0R0Zl90cmFpbl9zZXQlMkMlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl90ZXN0X3NldCUyQyUyMGVwb2NocyUzRDMp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_test_set, epochs=<span class="hljs-number">3</span>)',wrap:!1}}),{c(){s=w("p"),s.innerHTML=d,t=m(),M(o.$$.fragment),f=m(),M(u.$$.fragment),G=m(),x=w("p"),x.textContent=R,k=m(),M(i.$$.fragment),_=m(),Z=w("p"),Z.innerHTML=I,z=m(),M(p.$$.fragment),U=m(),W=w("p"),W.innerHTML=q,F=m(),M(X.$$.fragment),Q=m(),E=w("p"),E.innerHTML=A,Y=m(),M(V.$$.fragment)},l(a){s=T(a,"P",{"data-svelte-h":!0}),J(s)!=="svelte-1tl4sjy"&&(s.innerHTML=d),t=c(a),g(o.$$.fragment,a),f=c(a),g(u.$$.fragment,a),G=c(a),x=T(a,"P",{"data-svelte-h":!0}),J(x)!=="svelte-qa98st"&&(x.textContent=R),k=c(a),g(i.$$.fragment,a),_=c(a),Z=T(a,"P",{"data-svelte-h":!0}),J(Z)!=="svelte-r3087k"&&(Z.innerHTML=I),z=c(a),g(p.$$.fragment,a),U=c(a),W=T(a,"P",{"data-svelte-h":!0}),J(W)!=="svelte-vifi3w"&&(W.innerHTML=q),F=c(a),g(X.$$.fragment,a),Q=c(a),E=T(a,"P",{"data-svelte-h":!0}),J(E)!=="svelte-meb7zc"&&(E.innerHTML=A),Y=c(a),g(V.$$.fragment,a)},m(a,b){n(a,s,b),n(a,t,b),h(o,a,b),n(a,f,b),h(u,a,b),n(a,G,b),n(a,x,b),n(a,k,b),h(i,a,b),n(a,_,b),n(a,Z,b),n(a,z,b),h(p,a,b),n(a,U,b),n(a,W,b),n(a,F,b),h(X,a,b),n(a,Q,b),n(a,E,b),n(a,Y,b),h(V,a,b),H=!0},p(a,b){const B={};b&2&&(B.$$scope={dirty:b,ctx:a}),u.$set(B)},i(a){H||(y(o.$$.fragment,a),y(u.$$.fragment,a),y(i.$$.fragment,a),y(p.$$.fragment,a),y(X.$$.fragment,a),y(V.$$.fragment,a),H=!0)},o(a){$(o.$$.fragment,a),$(u.$$.fragment,a),$(i.$$.fragment,a),$(p.$$.fragment,a),$(X.$$.fragment,a),$(V.$$.fragment,a),H=!1},d(a){a&&(l(s),l(t),l(f),l(G),l(x),l(k),l(_),l(Z),l(z),l(U),l(W),l(F),l(Q),l(E),l(Y)),j(o,a),j(u,a),j(i,a),j(p,a),j(X,a),j(V,a)}}}function nt(C){let s,d;return s=new Ze({props:{$$slots:{default:[lt]},$$scope:{ctx:C}}}),{c(){M(s.$$.fragment)},l(t){g(s.$$.fragment,t)},m(t,o){h(s,t,o),d=!0},p(t,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:t}),s.$set(f)},i(t){d||(y(s.$$.fragment,t),d=!0)},o(t){$(s.$$.fragment,t),d=!1},d(t){j(s,t)}}}function rt(C){let s,d='Si no estás familiarizado con el proceso de realizar fine-tuning sobre un modelo con <code>Trainer</code>, considera el tutorial básico <a href="../training#finetune-with-trainer">aquí</a>!';return{c(){s=w("p"),s.innerHTML=d},l(t){s=T(t,"P",{"data-svelte-h":!0}),J(s)!=="svelte-1rt7ku5"&&(s.innerHTML=d)},m(t,o){n(t,s,o)},p:P,d(t){t&&l(s)}}}function pt(C){let s,d="Carga DistilRoBERTa con <code>AutoModelForMaskedlM</code>:",t,o,f,u,G,x,R="A este punto, solo faltan tres pasos:",k,i,_="<li>Definir tus hiperparámetros de entrenamiento en <code>TrainingArguments</code>.</li> <li>Pasarle los argumentos de entrenamiento a <code>Trainer</code> junto con el modelo, dataset, y el data collator.</li> <li>Realiza la llamada <code>train()</code> para realizar el fine-tuning de tu modelo.</li>",Z,I,z;return o=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck1hc2tlZExNJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsYmVydCUyRmRpc3RpbHJvYmVydGEtYmFzZSUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForMaskedLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForMaskedLM.from_pretrained(<span class="hljs-string">&quot;distilbert/distilroberta-base&quot;</span>)`,wrap:!1}}),u=new Re({props:{$$slots:{default:[rt]},$$scope:{ctx:C}}}),I=new v({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGcmVzdWx0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfc3RyYXRlZ3klM0QlMjJlcG9jaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0QyZS01JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3RyYWluX2Vwb2NocyUzRDMlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0RsbV9kYXRhc2V0JTVCJTIydHJhaW4lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0RsbV9kYXRhc2V0JTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;./results&quot;</span>,
<span class="hljs-meta">... </span>    eval_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">2e-5</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">3</span>,
<span class="hljs-meta">... </span>    weight_decay=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=lm_dataset[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=lm_dataset[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`,wrap:!1}}),{c(){s=w("p"),s.innerHTML=d,t=m(),M(o.$$.fragment),f=m(),M(u.$$.fragment),G=m(),x=w("p"),x.textContent=R,k=m(),i=w("ol"),i.innerHTML=_,Z=m(),M(I.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),J(s)!=="svelte-7nepae"&&(s.innerHTML=d),t=c(p),g(o.$$.fragment,p),f=c(p),g(u.$$.fragment,p),G=c(p),x=T(p,"P",{"data-svelte-h":!0}),J(x)!=="svelte-1fkdw25"&&(x.textContent=R),k=c(p),i=T(p,"OL",{"data-svelte-h":!0}),J(i)!=="svelte-11bmfc5"&&(i.innerHTML=_),Z=c(p),g(I.$$.fragment,p)},m(p,U){n(p,s,U),n(p,t,U),h(o,p,U),n(p,f,U),h(u,p,U),n(p,G,U),n(p,x,U),n(p,k,U),n(p,i,U),n(p,Z,U),h(I,p,U),z=!0},p(p,U){const W={};U&2&&(W.$$scope={dirty:U,ctx:p}),u.$set(W)},i(p){z||(y(o.$$.fragment,p),y(u.$$.fragment,p),y(I.$$.fragment,p),z=!0)},o(p){$(o.$$.fragment,p),$(u.$$.fragment,p),$(I.$$.fragment,p),z=!1},d(p){p&&(l(s),l(t),l(f),l(G),l(x),l(k),l(i),l(Z)),j(o,p),j(u,p),j(I,p)}}}function ot(C){let s,d;return s=new Ze({props:{$$slots:{default:[pt]},$$scope:{ctx:C}}}),{c(){M(s.$$.fragment)},l(t){g(s.$$.fragment,t)},m(t,o){h(s,t,o),d=!0},p(t,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:t}),s.$set(f)},i(t){d||(y(s.$$.fragment,t),d=!0)},o(t){$(s.$$.fragment,t),d=!1},d(t){j(s,t)}}}function it(C){let s,d='Si no estás familiarizado con realizar fine-tuning de tus modelos con Keras, considera el tutorial básico <a href="training#finetune-with-keras">aquí</a>!';return{c(){s=w("p"),s.innerHTML=d},l(t){s=T(t,"P",{"data-svelte-h":!0}),J(s)!=="svelte-txxfse"&&(s.innerHTML=d)},m(t,o){n(t,s,o)},p:P,d(t){t&&l(s)}}}function mt(C){let s,d='Para realizar el fine-tuning de un modelo en TensorFlow, comienza por convertir tus datasets al formato <code>tf.data.Dataset</code> con <a href="https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset.to_tf_dataset" rel="nofollow"><code>to_tf_dataset</code></a>. Especifica los inputs y etiquetas en <code>columns</code>, ya sea para mezclar el dataset, tamaño de lote, y el data collator:',t,o,f,u,G,x,R="Crea la función optimizadora, la tasa de aprendizaje, y algunos hiperparámetros de entrenamiento:",k,i,_,Z,I="Carga DistilRoBERTa con <code>TFAutoModelForMaskedLM</code>:",z,p,U,W,q='Configura el modelo para entrenamiento con <a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>:',F,X,Q,E,A='Llama a <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a> para realizar el fine-tuning del modelo:',Y,V,H;return o=new v({props:{code:"dGZfdHJhaW5fc2V0JTIwJTNEJTIwbG1fZGF0YXNldCU1QiUyMnRyYWluJTIyJTVELnRvX3RmX2RhdGFzZXQoJTBBJTIwJTIwJTIwJTIwY29sdW1ucyUzRCU1QiUyMmF0dGVudGlvbl9tYXNrJTIyJTJDJTIwJTIyaW5wdXRfaWRzJTIyJTJDJTIwJTIybGFiZWxzJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZHVtbXlfbGFiZWxzJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHNodWZmbGUlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwY29sbGF0ZV9mbiUzRGRhdGFfY29sbGF0b3IlMkMlMEEpJTBBJTBBdGZfdGVzdF9zZXQlMjAlM0QlMjBsbV9kYXRhc2V0JTVCJTIydGVzdCUyMiU1RC50b190Zl9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMGNvbHVtbnMlM0QlNUIlMjJhdHRlbnRpb25fbWFzayUyMiUyQyUyMCUyMmlucHV0X2lkcyUyMiUyQyUyMCUyMmxhYmVscyUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGR1bW15X2xhYmVscyUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBzaHVmZmxlJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBiYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBjb2xsYXRlX2ZuJTNEZGF0YV9jb2xsYXRvciUyQyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = lm_dataset[<span class="hljs-string">&quot;train&quot;</span>].to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>],
<span class="hljs-meta">... </span>    dummy_labels=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_test_set = lm_dataset[<span class="hljs-string">&quot;test&quot;</span>].to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>],
<span class="hljs-meta">... </span>    dummy_labels=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)`,wrap:!1}}),u=new Re({props:{$$slots:{default:[it]},$$scope:{ctx:C}}}),i=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGNyZWF0ZV9vcHRpbWl6ZXIlMkMlMjBBZGFtV2VpZ2h0RGVjYXklMEElMEFvcHRpbWl6ZXIlMjAlM0QlMjBBZGFtV2VpZ2h0RGVjYXkobGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMjB3ZWlnaHRfZGVjYXlfcmF0ZSUzRDAuMDEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer, AdamWeightDecay

<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer = AdamWeightDecay(learning_rate=<span class="hljs-number">2e-5</span>, weight_decay_rate=<span class="hljs-number">0.01</span>)`,wrap:!1}}),p=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTWFza2VkTE0lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGJlcnQlMkZkaXN0aWxyb2JlcnRhLWJhc2UlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForMaskedLM

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;distilbert/distilroberta-base&quot;</span>)`,wrap:!1}}),X=new v({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEFtb2RlbC5jb21waWxlKG9wdGltaXplciUzRG9wdGltaXplcik=",highlighted:`<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>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)`,wrap:!1}}),V=new v({props:{code:"bW9kZWwuZml0KHglM0R0Zl90cmFpbl9zZXQlMkMlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl90ZXN0X3NldCUyQyUyMGVwb2NocyUzRDMp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_test_set, epochs=<span class="hljs-number">3</span>)',wrap:!1}}),{c(){s=w("p"),s.innerHTML=d,t=m(),M(o.$$.fragment),f=m(),M(u.$$.fragment),G=m(),x=w("p"),x.textContent=R,k=m(),M(i.$$.fragment),_=m(),Z=w("p"),Z.innerHTML=I,z=m(),M(p.$$.fragment),U=m(),W=w("p"),W.innerHTML=q,F=m(),M(X.$$.fragment),Q=m(),E=w("p"),E.innerHTML=A,Y=m(),M(V.$$.fragment)},l(a){s=T(a,"P",{"data-svelte-h":!0}),J(s)!=="svelte-1tl4sjy"&&(s.innerHTML=d),t=c(a),g(o.$$.fragment,a),f=c(a),g(u.$$.fragment,a),G=c(a),x=T(a,"P",{"data-svelte-h":!0}),J(x)!=="svelte-qa98st"&&(x.textContent=R),k=c(a),g(i.$$.fragment,a),_=c(a),Z=T(a,"P",{"data-svelte-h":!0}),J(Z)!=="svelte-1h9i1wk"&&(Z.innerHTML=I),z=c(a),g(p.$$.fragment,a),U=c(a),W=T(a,"P",{"data-svelte-h":!0}),J(W)!=="svelte-vifi3w"&&(W.innerHTML=q),F=c(a),g(X.$$.fragment,a),Q=c(a),E=T(a,"P",{"data-svelte-h":!0}),J(E)!=="svelte-meb7zc"&&(E.innerHTML=A),Y=c(a),g(V.$$.fragment,a)},m(a,b){n(a,s,b),n(a,t,b),h(o,a,b),n(a,f,b),h(u,a,b),n(a,G,b),n(a,x,b),n(a,k,b),h(i,a,b),n(a,_,b),n(a,Z,b),n(a,z,b),h(p,a,b),n(a,U,b),n(a,W,b),n(a,F,b),h(X,a,b),n(a,Q,b),n(a,E,b),n(a,Y,b),h(V,a,b),H=!0},p(a,b){const B={};b&2&&(B.$$scope={dirty:b,ctx:a}),u.$set(B)},i(a){H||(y(o.$$.fragment,a),y(u.$$.fragment,a),y(i.$$.fragment,a),y(p.$$.fragment,a),y(X.$$.fragment,a),y(V.$$.fragment,a),H=!0)},o(a){$(o.$$.fragment,a),$(u.$$.fragment,a),$(i.$$.fragment,a),$(p.$$.fragment,a),$(X.$$.fragment,a),$(V.$$.fragment,a),H=!1},d(a){a&&(l(s),l(t),l(f),l(G),l(x),l(k),l(_),l(Z),l(z),l(U),l(W),l(F),l(Q),l(E),l(Y)),j(o,a),j(u,a),j(i,a),j(p,a),j(X,a),j(V,a)}}}function ct(C){let s,d;return s=new Ze({props:{$$slots:{default:[mt]},$$scope:{ctx:C}}}),{c(){M(s.$$.fragment)},l(t){g(s.$$.fragment,t)},m(t,o){h(s,t,o),d=!0},p(t,o){const f={};o&2&&(f.$$scope={dirty:o,ctx:t}),s.$set(f)},i(t){d||(y(s.$$.fragment,t),d=!0)},o(t){$(s.$$.fragment,t),d=!1},d(t){j(s,t)}}}function dt(C){let s,d=`Para un ejemplo más profundo sobre cómo realizar el fine-tuning sobre un modelo de lenguaje causal, considera
<a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb" rel="nofollow">PyTorch notebook</a>
o <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb" rel="nofollow">TensorFlow notebook</a>.`;return{c(){s=w("p"),s.innerHTML=d},l(t){s=T(t,"P",{"data-svelte-h":!0}),J(s)!=="svelte-1frn7nq"&&(s.innerHTML=d)},m(t,o){n(t,s,o)},p:P,d(t){t&&l(s)}}}function ut(C){let s,d,t,o,f,u,G,x="El modelado de lenguaje predice palabras en un enunciado. Hay dos formas de modelado de lenguaje.",R,k,i,_,Z="El modelado de lenguaje causal predice el siguiente token en una secuencia de tokens, y el modelo solo puede considerar los tokens a la izquierda.",I,z,p,U,W="El modelado de lenguaje por enmascaramiento predice un token enmascarado en una secuencia, y el modelo puede considerar los tokens bidireccionalmente.",q,F,X='Esta guía te mostrará cómo realizar fine-tuning <a href="https://huggingface.co/distilbert/distilgpt2" rel="nofollow">DistilGPT2</a> para modelos de lenguaje causales y <a href="https://huggingface.co/distilbert/distilroberta-base" rel="nofollow">DistilRoBERTa</a> para modelos de lenguaje por enmascaramiento en el <a href="https://www.reddit.com/r/askscience/" rel="nofollow">r/askscience</a> subdataset <a href="https://huggingface.co/datasets/eli5" rel="nofollow">ELI5</a>.',Q,E,A,Y,V,H,a="Carga solo los primeros 5000 registros desde la biblioteca 🤗 Datasets, dado que es bastante grande:",b,B,ze,K,js="Divide este dataset en subdatasets para el entrenamiento y el test:",Ie,O,We,ee,bs="Luego observa un ejemplo:",Ee,se,Ve,te,ws="Observa que <code>text</code> es un subcampo anidado dentro del diccionario <code>answers</code>. Cuando preproceses el dataset, deberás extraer el subcampo <code>text</code> en una columna aparte.",Xe,ae,Fe,le,Ye,ne,Ts="Para modelados de lenguaje causales carga el tokenizador DistilGPT2 para procesar el subcampo <code>text</code>:",He,re,Qe,pe,Be,oe,Us="Para modelados de lenguaje por enmascaramiento carga el tokenizador DistilRoBERTa, en lugar de DistilGPT2:",qe,ie,Ae,me,Js='Extrae el subcampo <code>text</code> desde su estructura anidado con el método <a href="https://huggingface.co/docs/datasets/process#flatten" rel="nofollow"><code>flatten</code></a>:',Le,ce,Ne,de,xs="Cada subcampo es ahora una columna separada, como lo indica el prefijo <code>answers</code>. Observa que <code>answers.text</code> es una lista. En lugar de tokenizar cada enunciado por separado, convierte la lista en un string para tokenizarlos conjuntamente.",Se,ue,_s="Así es como puedes crear una función de preprocesamiento para convertir la lista en una cadena y truncar las secuencias para que no superen la longitud máxima de input de DistilGPT2:",De,fe,Pe,Me,ks='Usa de 🤗 Datasets la función <a href="https://huggingface.co/docs/datasets/process#map" rel="nofollow"><code>map</code></a> para aplicar la función de preprocesamiento sobre el dataset en su totalidad. Puedes acelerar la función <code>map</code> configurando el argumento <code>batched=True</code> para procesar múltiples elementos del dataset a la vez y aumentar la cantidad de procesos con <code>num_proc</code>. Elimina las columnas que no necesitas:',Ke,ge,Oe,he,Cs="Ahora necesitas una segunda función de preprocesamiento para capturar el texto truncado de cualquier ejemplo demasiado largo para evitar cualquier pérdida de información. Esta función de preprocesamiento debería:",es,ye,Gs="<li>Concatenar todo el texto.</li> <li>Dividir el texto concatenado en trozos más pequeños definidos por un <code>block_size</code>.</li>",ss,$e,ts,je,Rs="Aplica la función <code>group_texts</code> sobre todo el dataset:",as,be,ls,we,Zs="Para modelados de lenguaje causales, usa <code>DataCollatorForLanguageModeling</code> para crear un lote de ejemplos. Esto también <em>rellenará dinámicamente</em> tu texto a la dimensión del elemento más largo del lote para que de esta manera tengan largo uniforme. Si bien es posible rellenar tu texto en la función <code>tokenizer</code> mediante el argumento <code>padding=True</code>, el rellenado dinámico es más eficiente.",ns,L,rs,Te,ps,Ue,vs='El modelado de lenguaje causal es frecuentemente utilizado para generación de texto. Esta sección te muestra cómo realizar fine-tuning a <a href="https://huggingface.co/distilbert/distilgpt2" rel="nofollow">DistilGPT2</a> para generar nuevo texto.',os,Je,is,N,ms,xe,cs,_e,zs='El modelado de lenguaje por enmascaramiento es también conocido como una tarea de rellenar la máscara, pues predice un token enmascarado dada una secuencia. Los modelos de lenguaje por enmascaramiento requieren una buena comprensión del contexto de una secuencia entera, en lugar de solo el contexto a la izquierda. Esta sección te enseña como realizar el fine-tuning de <a href="https://huggingface.co/distilbert/distilroberta-base" rel="nofollow">DistilRoBERTa</a> para predecir una palabra enmascarada.',ds,ke,us,S,fs,D,Ms,Ce,gs,ve,hs;return f=new Ge({props:{title:"Modelado de lenguaje",local:"modelado-de-lenguaje",headingTag:"h1"}}),k=new ys({props:{id:"Vpjb1lu0MDk"}}),z=new ys({props:{id:"mqElG5QJWUg"}}),E=new Re({props:{$$slots:{default:[Ss]},$$scope:{ctx:C}}}),Y=new Ge({props:{title:"Carga el dataset ELI5",local:"carga-el-dataset-eli5",headingTag:"h2"}}),B=new v({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZWxpNSUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJlbGk1JTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbl9hc2tzJTVCJTNBNTAwMCU1RCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>eli5 = load_dataset(<span class="hljs-string">&quot;eli5&quot;</span>, split=<span class="hljs-string">&quot;train_asks[:5000]&quot;</span>)`,wrap:!1}}),O=new v({props:{code:"ZWxpNSUyMCUzRCUyMGVsaTUudHJhaW5fdGVzdF9zcGxpdCh0ZXN0X3NpemUlM0QwLjIp",highlighted:'eli5 = eli5.train_test_split(test_size=<span class="hljs-number">0.2</span>)',wrap:!1}}),se=new v({props:{code:"ZWxpNSU1QiUyMnRyYWluJTIyJTVEJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>eli5[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;answers&#x27;</span>: {<span class="hljs-string">&#x27;a_id&#x27;</span>: [<span class="hljs-string">&#x27;c3d1aib&#x27;</span>, <span class="hljs-string">&#x27;c3d4lya&#x27;</span>],
  <span class="hljs-string">&#x27;score&#x27;</span>: [<span class="hljs-number">6</span>, <span class="hljs-number">3</span>],
  <span class="hljs-string">&#x27;text&#x27;</span>: [<span class="hljs-string">&quot;The velocity needed to remain in orbit is equal to the square root of Newton&#x27;s constant times the mass of earth divided by the distance from the center of the earth. I don&#x27;t know the altitude of that specific mission, but they&#x27;re usually around 300 km. That means he&#x27;s going 7-8 km/s.\\n\\nIn space there are no other forces acting on either the shuttle or the guy, so they stay in the same position relative to each other. If he were to become unable to return to the ship, he would presumably run out of oxygen, or slowly fall into the atmosphere and burn up.&quot;</span>,
   <span class="hljs-string">&quot;Hope you don&#x27;t mind me asking another question, but why aren&#x27;t there any stars visible in this photo?&quot;</span>]},
 <span class="hljs-string">&#x27;answers_urls&#x27;</span>: {<span class="hljs-string">&#x27;url&#x27;</span>: []},
 <span class="hljs-string">&#x27;document&#x27;</span>: <span class="hljs-string">&#x27;&#x27;</span>,
 <span class="hljs-string">&#x27;q_id&#x27;</span>: <span class="hljs-string">&#x27;nyxfp&#x27;</span>,
 <span class="hljs-string">&#x27;selftext&#x27;</span>: <span class="hljs-string">&#x27;_URL_0_\\n\\nThis was on the front page earlier and I have a few questions about it. Is it possible to calculate how fast the astronaut would be orbiting the earth? Also how does he stay close to the shuttle so that he can return safely, i.e is he orbiting at the same speed and can therefore stay next to it? And finally if his propulsion system failed, would he eventually re-enter the atmosphere and presumably die?&#x27;</span>,
 <span class="hljs-string">&#x27;selftext_urls&#x27;</span>: {<span class="hljs-string">&#x27;url&#x27;</span>: [<span class="hljs-string">&#x27;http://apod.nasa.gov/apod/image/1201/freeflyer_nasa_3000.jpg&#x27;</span>]},
 <span class="hljs-string">&#x27;subreddit&#x27;</span>: <span class="hljs-string">&#x27;askscience&#x27;</span>,
 <span class="hljs-string">&#x27;title&#x27;</span>: <span class="hljs-string">&#x27;Few questions about this space walk photograph.&#x27;</span>,
 <span class="hljs-string">&#x27;title_urls&#x27;</span>: {<span class="hljs-string">&#x27;url&#x27;</span>: []}}`,wrap:!1}}),ae=new Ge({props:{title:"Preprocesamiento",local:"preprocesamiento",headingTag:"h2"}}),le=new ys({props:{id:"ma1TrR7gE7I"}}),re=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0JTJGZGlzdGlsZ3B0MiUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert/distilgpt2&quot;</span>)`,wrap:!1}}),pe=new ys({props:{id:"8PmhEIXhBvI"}}),ie=new v({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0JTJGZGlzdGlscm9iZXJ0YS1iYXNlJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert/distilroberta-base&quot;</span>)`,wrap:!1}}),ce=new v({props:{code:"ZWxpNSUyMCUzRCUyMGVsaTUuZmxhdHRlbigpJTBBZWxpNSU1QiUyMnRyYWluJTIyJTVEJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>eli5 = eli5.flatten()
<span class="hljs-meta">&gt;&gt;&gt; </span>eli5[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;answers.a_id&#x27;</span>: [<span class="hljs-string">&#x27;c3d1aib&#x27;</span>, <span class="hljs-string">&#x27;c3d4lya&#x27;</span>],
 <span class="hljs-string">&#x27;answers.score&#x27;</span>: [<span class="hljs-number">6</span>, <span class="hljs-number">3</span>],
 <span class="hljs-string">&#x27;answers.text&#x27;</span>: [<span class="hljs-string">&quot;The velocity needed to remain in orbit is equal to the square root of Newton&#x27;s constant times the mass of earth divided by the distance from the center of the earth. I don&#x27;t know the altitude of that specific mission, but they&#x27;re usually around 300 km. That means he&#x27;s going 7-8 km/s.\\n\\nIn space there are no other forces acting on either the shuttle or the guy, so they stay in the same position relative to each other. If he were to become unable to return to the ship, he would presumably run out of oxygen, or slowly fall into the atmosphere and burn up.&quot;</span>,
  <span class="hljs-string">&quot;Hope you don&#x27;t mind me asking another question, but why aren&#x27;t there any stars visible in this photo?&quot;</span>],
 <span class="hljs-string">&#x27;answers_urls.url&#x27;</span>: [],
 <span class="hljs-string">&#x27;document&#x27;</span>: <span class="hljs-string">&#x27;&#x27;</span>,
 <span class="hljs-string">&#x27;q_id&#x27;</span>: <span class="hljs-string">&#x27;nyxfp&#x27;</span>,
 <span class="hljs-string">&#x27;selftext&#x27;</span>: <span class="hljs-string">&#x27;_URL_0_\\n\\nThis was on the front page earlier and I have a few questions about it. Is it possible to calculate how fast the astronaut would be orbiting the earth? Also how does he stay close to the shuttle so that he can return safely, i.e is he orbiting at the same speed and can therefore stay next to it? And finally if his propulsion system failed, would he eventually re-enter the atmosphere and presumably die?&#x27;</span>,
 <span class="hljs-string">&#x27;selftext_urls.url&#x27;</span>: [<span class="hljs-string">&#x27;http://apod.nasa.gov/apod/image/1201/freeflyer_nasa_3000.jpg&#x27;</span>],
 <span class="hljs-string">&#x27;subreddit&#x27;</span>: <span class="hljs-string">&#x27;askscience&#x27;</span>,
 <span class="hljs-string">&#x27;title&#x27;</span>: <span class="hljs-string">&#x27;Few questions about this space walk photograph.&#x27;</span>,
 <span class="hljs-string">&#x27;title_urls.url&#x27;</span>: []}`,wrap:!1}}),fe=new v({props:{code:"ZGVmJTIwcHJlcHJvY2Vzc19mdW5jdGlvbihleGFtcGxlcyklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjB0b2tlbml6ZXIoJTVCJTIyJTIwJTIyLmpvaW4oeCklMjBmb3IlMjB4JTIwaW4lMjBleGFtcGxlcyU1QiUyMmFuc3dlcnMudGV4dCUyMiU1RCU1RCUyQyUyMHRydW5jYXRpb24lM0RUcnVlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">preprocess_function</span>(<span class="hljs-params">examples</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> tokenizer([<span class="hljs-string">&quot; &quot;</span>.join(x) <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> examples[<span class="hljs-string">&quot;answers.text&quot;</span>]], truncation=<span class="hljs-literal">True</span>)`,wrap:!1}}),ge=new v({props:{code:"dG9rZW5pemVkX2VsaTUlMjAlM0QlMjBlbGk1Lm1hcCglMEElMjAlMjAlMjAlMjBwcmVwcm9jZXNzX2Z1bmN0aW9uJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hlZCUzRFRydWUlMkMlMEElMjAlMjAlMjAlMjBudW1fcHJvYyUzRDQlMkMlMEElMjAlMjAlMjAlMjByZW1vdmVfY29sdW1ucyUzRGVsaTUlNUIlMjJ0cmFpbiUyMiU1RC5jb2x1bW5fbmFtZXMlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_eli5 = eli5.<span class="hljs-built_in">map</span>(
<span class="hljs-meta">... </span>    preprocess_function,
<span class="hljs-meta">... </span>    batched=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    num_proc=<span class="hljs-number">4</span>,
<span class="hljs-meta">... </span>    remove_columns=eli5[<span class="hljs-string">&quot;train&quot;</span>].column_names,
<span class="hljs-meta">... </span>)`,wrap:!1}}),$e=new v({props:{code:"YmxvY2tfc2l6ZSUyMCUzRCUyMDEyOCUwQSUwQSUwQWRlZiUyMGdyb3VwX3RleHRzKGV4YW1wbGVzKSUzQSUwQSUyMCUyMCUyMCUyMGNvbmNhdGVuYXRlZF9leGFtcGxlcyUyMCUzRCUyMCU3QmslM0ElMjBzdW0oZXhhbXBsZXMlNUJrJTVEJTJDJTIwJTVCJTVEKSUyMGZvciUyMGslMjBpbiUyMGV4YW1wbGVzLmtleXMoKSU3RCUwQSUyMCUyMCUyMCUyMHRvdGFsX2xlbmd0aCUyMCUzRCUyMGxlbihjb25jYXRlbmF0ZWRfZXhhbXBsZXMlNUJsaXN0KGV4YW1wbGVzLmtleXMoKSklNUIwJTVEJTVEKSUwQSUyMCUyMCUyMCUyMHRvdGFsX2xlbmd0aCUyMCUzRCUyMCh0b3RhbF9sZW5ndGglMjAlMkYlMkYlMjBibG9ja19zaXplKSUyMColMjBibG9ja19zaXplJTBBJTIwJTIwJTIwJTIwcmVzdWx0JTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwayUzQSUyMCU1QnQlNUJpJTIwJTNBJTIwaSUyMCUyQiUyMGJsb2NrX3NpemUlNUQlMjBmb3IlMjBpJTIwaW4lMjByYW5nZSgwJTJDJTIwdG90YWxfbGVuZ3RoJTJDJTIwYmxvY2tfc2l6ZSklNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmb3IlMjBrJTJDJTIwdCUyMGluJTIwY29uY2F0ZW5hdGVkX2V4YW1wbGVzLml0ZW1zKCklMEElMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlMjAlMjByZXN1bHQlNUIlMjJsYWJlbHMlMjIlNUQlMjAlM0QlMjByZXN1bHQlNUIlMjJpbnB1dF9pZHMlMjIlNUQuY29weSgpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwcmVzdWx0",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>block_size = <span class="hljs-number">128</span>


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">group_texts</span>(<span class="hljs-params">examples</span>):
<span class="hljs-meta">... </span>    concatenated_examples = {k: <span class="hljs-built_in">sum</span>(examples[k], []) <span class="hljs-keyword">for</span> k <span class="hljs-keyword">in</span> examples.keys()}
<span class="hljs-meta">... </span>    total_length = <span class="hljs-built_in">len</span>(concatenated_examples[<span class="hljs-built_in">list</span>(examples.keys())[<span class="hljs-number">0</span>]])
<span class="hljs-meta">... </span>    total_length = (total_length // block_size) * block_size
<span class="hljs-meta">... </span>    result = {
<span class="hljs-meta">... </span>        k: [t[i : i + block_size] <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">0</span>, total_length, block_size)]
<span class="hljs-meta">... </span>        <span class="hljs-keyword">for</span> k, t <span class="hljs-keyword">in</span> concatenated_examples.items()
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>    result[<span class="hljs-string">&quot;labels&quot;</span>] = result[<span class="hljs-string">&quot;input_ids&quot;</span>].copy()
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> result`,wrap:!1}}),be=new v({props:{code:"bG1fZGF0YXNldCUyMCUzRCUyMHRva2VuaXplZF9lbGk1Lm1hcChncm91cF90ZXh0cyUyQyUyMGJhdGNoZWQlM0RUcnVlJTJDJTIwbnVtX3Byb2MlM0Q0KQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>lm_dataset = tokenized_eli5.<span class="hljs-built_in">map</span>(group_texts, batched=<span class="hljs-literal">True</span>, num_proc=<span class="hljs-number">4</span>)',wrap:!1}}),L=new $s({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Os],pytorch:[Ps]},$$scope:{ctx:C}}}),Te=new Ge({props:{title:"Modelado de lenguaje causal",local:"modelado-de-lenguaje-causal",headingTag:"h2"}}),Je=new Ge({props:{title:"Entrenamiento",local:"entrenamiento",headingTag:"h3"}}),N=new $s({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[nt],pytorch:[tt]},$$scope:{ctx:C}}}),xe=new Ge({props:{title:"Modelado de lenguaje por enmascaramiento",local:"modelado-de-lenguaje-por-enmascaramiento",headingTag:"h2"}}),ke=new Ge({props:{title:"Entrenamiento",local:"entrenamiento",headingTag:"h3"}}),S=new $s({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ct],pytorch:[ot]},$$scope:{ctx:C}}}),D=new Re({props:{$$slots:{default:[dt]},$$scope:{ctx:C}}}),Ce=new Ns({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/es/tasks/language_modeling.md"}}),{c(){s=w("meta"),d=m(),t=w("p"),o=m(),M(f.$$.fragment),u=m(),G=w("p"),G.textContent=x,R=m(),M(k.$$.fragment),i=m(),_=w("p"),_.textContent=Z,I=m(),M(z.$$.fragment),p=m(),U=w("p"),U.textContent=W,q=m(),F=w("p"),F.innerHTML=X,Q=m(),M(E.$$.fragment),A=m(),M(Y.$$.fragment),V=m(),H=w("p"),H.textContent=a,b=m(),M(B.$$.fragment),ze=m(),K=w("p"),K.textContent=js,Ie=m(),M(O.$$.fragment),We=m(),ee=w("p"),ee.textContent=bs,Ee=m(),M(se.$$.fragment),Ve=m(),te=w("p"),te.innerHTML=ws,Xe=m(),M(ae.$$.fragment),Fe=m(),M(le.$$.fragment),Ye=m(),ne=w("p"),ne.innerHTML=Ts,He=m(),M(re.$$.fragment),Qe=m(),M(pe.$$.fragment),Be=m(),oe=w("p"),oe.textContent=Us,qe=m(),M(ie.$$.fragment),Ae=m(),me=w("p"),me.innerHTML=Js,Le=m(),M(ce.$$.fragment),Ne=m(),de=w("p"),de.innerHTML=xs,Se=m(),ue=w("p"),ue.textContent=_s,De=m(),M(fe.$$.fragment),Pe=m(),Me=w("p"),Me.innerHTML=ks,Ke=m(),M(ge.$$.fragment),Oe=m(),he=w("p"),he.textContent=Cs,es=m(),ye=w("ul"),ye.innerHTML=Gs,ss=m(),M($e.$$.fragment),ts=m(),je=w("p"),je.innerHTML=Rs,as=m(),M(be.$$.fragment),ls=m(),we=w("p"),we.innerHTML=Zs,ns=m(),M(L.$$.fragment),rs=m(),M(Te.$$.fragment),ps=m(),Ue=w("p"),Ue.innerHTML=vs,os=m(),M(Je.$$.fragment),is=m(),M(N.$$.fragment),ms=m(),M(xe.$$.fragment),cs=m(),_e=w("p"),_e.innerHTML=zs,ds=m(),M(ke.$$.fragment),us=m(),M(S.$$.fragment),fs=m(),M(D.$$.fragment),Ms=m(),M(Ce.$$.fragment),gs=m(),ve=w("p"),this.h()},l(e){const r=As("svelte-u9bgzb",document.head);s=T(r,"META",{name:!0,content:!0}),r.forEach(l),d=c(e),t=T(e,"P",{}),Fs(t).forEach(l),o=c(e),g(f.$$.fragment,e),u=c(e),G=T(e,"P",{"data-svelte-h":!0}),J(G)!=="svelte-1sv8lp6"&&(G.textContent=x),R=c(e),g(k.$$.fragment,e),i=c(e),_=T(e,"P",{"data-svelte-h":!0}),J(_)!=="svelte-o9osiq"&&(_.textContent=Z),I=c(e),g(z.$$.fragment,e),p=c(e),U=T(e,"P",{"data-svelte-h":!0}),J(U)!=="svelte-rdtqpf"&&(U.textContent=W),q=c(e),F=T(e,"P",{"data-svelte-h":!0}),J(F)!=="svelte-zqk5sa"&&(F.innerHTML=X),Q=c(e),g(E.$$.fragment,e),A=c(e),g(Y.$$.fragment,e),V=c(e),H=T(e,"P",{"data-svelte-h":!0}),J(H)!=="svelte-3nech7"&&(H.textContent=a),b=c(e),g(B.$$.fragment,e),ze=c(e),K=T(e,"P",{"data-svelte-h":!0}),J(K)!=="svelte-1fx745g"&&(K.textContent=js),Ie=c(e),g(O.$$.fragment,e),We=c(e),ee=T(e,"P",{"data-svelte-h":!0}),J(ee)!=="svelte-62xfwd"&&(ee.textContent=bs),Ee=c(e),g(se.$$.fragment,e),Ve=c(e),te=T(e,"P",{"data-svelte-h":!0}),J(te)!=="svelte-1pbomcc"&&(te.innerHTML=ws),Xe=c(e),g(ae.$$.fragment,e),Fe=c(e),g(le.$$.fragment,e),Ye=c(e),ne=T(e,"P",{"data-svelte-h":!0}),J(ne)!=="svelte-1300qak"&&(ne.innerHTML=Ts),He=c(e),g(re.$$.fragment,e),Qe=c(e),g(pe.$$.fragment,e),Be=c(e),oe=T(e,"P",{"data-svelte-h":!0}),J(oe)!=="svelte-1ihod96"&&(oe.textContent=Us),qe=c(e),g(ie.$$.fragment,e),Ae=c(e),me=T(e,"P",{"data-svelte-h":!0}),J(me)!=="svelte-18l6uf0"&&(me.innerHTML=Js),Le=c(e),g(ce.$$.fragment,e),Ne=c(e),de=T(e,"P",{"data-svelte-h":!0}),J(de)!=="svelte-1qnu3op"&&(de.innerHTML=xs),Se=c(e),ue=T(e,"P",{"data-svelte-h":!0}),J(ue)!=="svelte-lbchb7"&&(ue.textContent=_s),De=c(e),g(fe.$$.fragment,e),Pe=c(e),Me=T(e,"P",{"data-svelte-h":!0}),J(Me)!=="svelte-1rtefwl"&&(Me.innerHTML=ks),Ke=c(e),g(ge.$$.fragment,e),Oe=c(e),he=T(e,"P",{"data-svelte-h":!0}),J(he)!=="svelte-10yu7cu"&&(he.textContent=Cs),es=c(e),ye=T(e,"UL",{"data-svelte-h":!0}),J(ye)!=="svelte-jdg0mp"&&(ye.innerHTML=Gs),ss=c(e),g($e.$$.fragment,e),ts=c(e),je=T(e,"P",{"data-svelte-h":!0}),J(je)!=="svelte-bteuj6"&&(je.innerHTML=Rs),as=c(e),g(be.$$.fragment,e),ls=c(e),we=T(e,"P",{"data-svelte-h":!0}),J(we)!=="svelte-1llnvt1"&&(we.innerHTML=Zs),ns=c(e),g(L.$$.fragment,e),rs=c(e),g(Te.$$.fragment,e),ps=c(e),Ue=T(e,"P",{"data-svelte-h":!0}),J(Ue)!=="svelte-1pahbnx"&&(Ue.innerHTML=vs),os=c(e),g(Je.$$.fragment,e),is=c(e),g(N.$$.fragment,e),ms=c(e),g(xe.$$.fragment,e),cs=c(e),_e=T(e,"P",{"data-svelte-h":!0}),J(_e)!=="svelte-10amrve"&&(_e.innerHTML=zs),ds=c(e),g(ke.$$.fragment,e),us=c(e),g(S.$$.fragment,e),fs=c(e),g(D.$$.fragment,e),Ms=c(e),g(Ce.$$.fragment,e),gs=c(e),ve=T(e,"P",{}),Fs(ve).forEach(l),this.h()},h(){Ys(s,"name","hf:doc:metadata"),Ys(s,"content",ft)},m(e,r){Ls(document.head,s),n(e,d,r),n(e,t,r),n(e,o,r),h(f,e,r),n(e,u,r),n(e,G,r),n(e,R,r),h(k,e,r),n(e,i,r),n(e,_,r),n(e,I,r),h(z,e,r),n(e,p,r),n(e,U,r),n(e,q,r),n(e,F,r),n(e,Q,r),h(E,e,r),n(e,A,r),h(Y,e,r),n(e,V,r),n(e,H,r),n(e,b,r),h(B,e,r),n(e,ze,r),n(e,K,r),n(e,Ie,r),h(O,e,r),n(e,We,r),n(e,ee,r),n(e,Ee,r),h(se,e,r),n(e,Ve,r),n(e,te,r),n(e,Xe,r),h(ae,e,r),n(e,Fe,r),h(le,e,r),n(e,Ye,r),n(e,ne,r),n(e,He,r),h(re,e,r),n(e,Qe,r),h(pe,e,r),n(e,Be,r),n(e,oe,r),n(e,qe,r),h(ie,e,r),n(e,Ae,r),n(e,me,r),n(e,Le,r),h(ce,e,r),n(e,Ne,r),n(e,de,r),n(e,Se,r),n(e,ue,r),n(e,De,r),h(fe,e,r),n(e,Pe,r),n(e,Me,r),n(e,Ke,r),h(ge,e,r),n(e,Oe,r),n(e,he,r),n(e,es,r),n(e,ye,r),n(e,ss,r),h($e,e,r),n(e,ts,r),n(e,je,r),n(e,as,r),h(be,e,r),n(e,ls,r),n(e,we,r),n(e,ns,r),h(L,e,r),n(e,rs,r),h(Te,e,r),n(e,ps,r),n(e,Ue,r),n(e,os,r),h(Je,e,r),n(e,is,r),h(N,e,r),n(e,ms,r),h(xe,e,r),n(e,cs,r),n(e,_e,r),n(e,ds,r),h(ke,e,r),n(e,us,r),h(S,e,r),n(e,fs,r),h(D,e,r),n(e,Ms,r),h(Ce,e,r),n(e,gs,r),n(e,ve,r),hs=!0},p(e,[r]){const Is={};r&2&&(Is.$$scope={dirty:r,ctx:e}),E.$set(Is);const Ws={};r&2&&(Ws.$$scope={dirty:r,ctx:e}),L.$set(Ws);const Es={};r&2&&(Es.$$scope={dirty:r,ctx:e}),N.$set(Es);const Vs={};r&2&&(Vs.$$scope={dirty:r,ctx:e}),S.$set(Vs);const Xs={};r&2&&(Xs.$$scope={dirty:r,ctx:e}),D.$set(Xs)},i(e){hs||(y(f.$$.fragment,e),y(k.$$.fragment,e),y(z.$$.fragment,e),y(E.$$.fragment,e),y(Y.$$.fragment,e),y(B.$$.fragment,e),y(O.$$.fragment,e),y(se.$$.fragment,e),y(ae.$$.fragment,e),y(le.$$.fragment,e),y(re.$$.fragment,e),y(pe.$$.fragment,e),y(ie.$$.fragment,e),y(ce.$$.fragment,e),y(fe.$$.fragment,e),y(ge.$$.fragment,e),y($e.$$.fragment,e),y(be.$$.fragment,e),y(L.$$.fragment,e),y(Te.$$.fragment,e),y(Je.$$.fragment,e),y(N.$$.fragment,e),y(xe.$$.fragment,e),y(ke.$$.fragment,e),y(S.$$.fragment,e),y(D.$$.fragment,e),y(Ce.$$.fragment,e),hs=!0)},o(e){$(f.$$.fragment,e),$(k.$$.fragment,e),$(z.$$.fragment,e),$(E.$$.fragment,e),$(Y.$$.fragment,e),$(B.$$.fragment,e),$(O.$$.fragment,e),$(se.$$.fragment,e),$(ae.$$.fragment,e),$(le.$$.fragment,e),$(re.$$.fragment,e),$(pe.$$.fragment,e),$(ie.$$.fragment,e),$(ce.$$.fragment,e),$(fe.$$.fragment,e),$(ge.$$.fragment,e),$($e.$$.fragment,e),$(be.$$.fragment,e),$(L.$$.fragment,e),$(Te.$$.fragment,e),$(Je.$$.fragment,e),$(N.$$.fragment,e),$(xe.$$.fragment,e),$(ke.$$.fragment,e),$(S.$$.fragment,e),$(D.$$.fragment,e),$(Ce.$$.fragment,e),hs=!1},d(e){e&&(l(d),l(t),l(o),l(u),l(G),l(R),l(i),l(_),l(I),l(p),l(U),l(q),l(F),l(Q),l(A),l(V),l(H),l(b),l(ze),l(K),l(Ie),l(We),l(ee),l(Ee),l(Ve),l(te),l(Xe),l(Fe),l(Ye),l(ne),l(He),l(Qe),l(Be),l(oe),l(qe),l(Ae),l(me),l(Le),l(Ne),l(de),l(Se),l(ue),l(De),l(Pe),l(Me),l(Ke),l(Oe),l(he),l(es),l(ye),l(ss),l(ts),l(je),l(as),l(ls),l(we),l(ns),l(rs),l(ps),l(Ue),l(os),l(is),l(ms),l(cs),l(_e),l(ds),l(us),l(fs),l(Ms),l(gs),l(ve)),l(s),j(f,e),j(k,e),j(z,e),j(E,e),j(Y,e),j(B,e),j(O,e),j(se,e),j(ae,e),j(le,e),j(re,e),j(pe,e),j(ie,e),j(ce,e),j(fe,e),j(ge,e),j($e,e),j(be,e),j(L,e),j(Te,e),j(Je,e),j(N,e),j(xe,e),j(ke,e),j(S,e),j(D,e),j(Ce,e)}}}const ft='{"title":"Modelado de lenguaje","local":"modelado-de-lenguaje","sections":[{"title":"Carga el dataset ELI5","local":"carga-el-dataset-eli5","sections":[],"depth":2},{"title":"Preprocesamiento","local":"preprocesamiento","sections":[],"depth":2},{"title":"Modelado de lenguaje causal","local":"modelado-de-lenguaje-causal","sections":[{"title":"Entrenamiento","local":"entrenamiento","sections":[],"depth":3}],"depth":2},{"title":"Modelado de lenguaje por enmascaramiento","local":"modelado-de-lenguaje-por-enmascaramiento","sections":[{"title":"Entrenamiento","local":"entrenamiento","sections":[],"depth":3}],"depth":2}],"depth":1}';function Mt(C){return Qs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Tt extends Bs{constructor(s){super(),qs(this,s,Mt,ut,Hs,{})}}export{Tt as component};
