import{s as Qs,o as qs,n as ue}from"../chunks/scheduler.36a0863c.js";import{S as Ls,i as Ns,g as u,s as i,u as $,A as Ss,h as d,f as t,c,j as Y,v as j,y,k as Z,o as I,a as l,w as b,d as w,t as T,x as U}from"../chunks/index.d0f7a4c4.js";import{T as st}from"../chunks/Tip.4c7d7eb1.js";import{Y as ls}from"../chunks/Youtube.d15bb502.js";import{I as Se}from"../chunks/IconCopyLink.bc5fad79.js";import{C as z}from"../chunks/CodeBlock.4236768d.js";import{F as ms,M as at}from"../chunks/Markdown.2bf44d4a.js";function Ps(v){let s,f='Puedes realizar fine-tuning a otras arquitecturas para modelos de lenguaje como <a href="https://huggingface.co/EleutherAI/gpt-neo-125M" rel="nofollow">GPT-Neo</a>, <a href="https://huggingface.co/EleutherAI/gpt-j-6B" rel="nofollow">GPT-J</a> y <a href="https://huggingface.co/bert-base-uncased" rel="nofollow">BERT</a> siguiendo los mismos pasos presentados en esta guía!',a,p,g='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=u("p"),s.innerHTML=f,a=i(),p=u("p"),p.innerHTML=g},l(h){s=d(h,"P",{"data-svelte-h":!0}),y(s)!=="svelte-1ka52f1"&&(s.innerHTML=f),a=c(h),p=d(h,"P",{"data-svelte-h":!0}),y(p)!=="svelte-kfpohj"&&(p.innerHTML=g)},m(h,C){l(h,s,C),l(h,a,C),l(h,p,C)},p:ue,d(h){h&&(t(s),t(a),t(p))}}}function Ds(v){let s,f="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:",a,p,g,h,C="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.",J,R,_;return p=new z({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 z({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=u("p"),s.innerHTML=f,a=i(),$(p.$$.fragment),g=i(),h=u("p"),h.innerHTML=C,J=i(),$(R.$$.fragment)},l(m){s=d(m,"P",{"data-svelte-h":!0}),y(s)!=="svelte-uvilkn"&&(s.innerHTML=f),a=c(m),j(p.$$.fragment,m),g=c(m),h=d(m,"P",{"data-svelte-h":!0}),y(h)!=="svelte-1sc95x7"&&(h.innerHTML=C),J=c(m),j(R.$$.fragment,m)},m(m,k){l(m,s,k),l(m,a,k),b(p,m,k),l(m,g,k),l(m,h,k),l(m,J,k),b(R,m,k),_=!0},p:ue,i(m){_||(w(p.$$.fragment,m),w(R.$$.fragment,m),_=!0)},o(m){T(p.$$.fragment,m),T(R.$$.fragment,m),_=!1},d(m){m&&(t(s),t(a),t(g),t(h),t(J)),U(p,m),U(R,m)}}}function Ks(v){let s,f;return s=new at({props:{$$slots:{default:[Ds]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(a){j(s.$$.fragment,a)},m(a,p){b(s,a,p),f=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){f||(w(s.$$.fragment,a),f=!0)},o(a){T(s.$$.fragment,a),f=!1},d(a){U(s,a)}}}function Os(v){let s,f="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:",a,p,g,h,C="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.",J,R,_;return p=new z({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 z({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=u("p"),s.innerHTML=f,a=i(),$(p.$$.fragment),g=i(),h=u("p"),h.innerHTML=C,J=i(),$(R.$$.fragment)},l(m){s=d(m,"P",{"data-svelte-h":!0}),y(s)!=="svelte-uvilkn"&&(s.innerHTML=f),a=c(m),j(p.$$.fragment,m),g=c(m),h=d(m,"P",{"data-svelte-h":!0}),y(h)!=="svelte-1jtycjg"&&(h.innerHTML=C),J=c(m),j(R.$$.fragment,m)},m(m,k){l(m,s,k),l(m,a,k),b(p,m,k),l(m,g,k),l(m,h,k),l(m,J,k),b(R,m,k),_=!0},p:ue,i(m){_||(w(p.$$.fragment,m),w(R.$$.fragment,m),_=!0)},o(m){T(p.$$.fragment,m),T(R.$$.fragment,m),_=!1},d(m){m&&(t(s),t(a),t(g),t(h),t(J)),U(p,m),U(R,m)}}}function ea(v){let s,f;return s=new at({props:{$$slots:{default:[Os]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(a){j(s.$$.fragment,a)},m(a,p){b(s,a,p),f=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){f||(w(s.$$.fragment,a),f=!0)},o(a){T(s.$$.fragment,a),f=!1},d(a){U(s,a)}}}function ta(v){let s,f='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=u("p"),s.innerHTML=f},l(a){s=d(a,"P",{"data-svelte-h":!0}),y(s)!=="svelte-1rt7ku5"&&(s.innerHTML=f)},m(a,p){l(a,s,p)},p:ue,d(a){a&&t(s)}}}function sa(v){let s,f="Carga DistilGPT2 con <code>AutoModelForCausalLM</code>:",a,p,g,h,C,J,R="A este punto, solo faltan tres pasos:",_,m,k="<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>",G,W,V;return p=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwVHJhaW5pbmdBcmd1bWVudHMlMkMlMjBUcmFpbmVyJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlsZ3B0MiUyMik=",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;distilgpt2&quot;</span>)`,wrap:!1}}),h=new st({props:{$$slots:{default:[ta]},$$scope:{ctx:v}}}),W=new z({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGcmVzdWx0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMGV2YWx1YXRpb25fc3RyYXRlZ3klM0QlMjJlcG9jaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0QyZS01JTJDJTBBJTIwJTIwJTIwJTIwd2VpZ2h0X2RlY2F5JTNEMC4wMSUyQyUwQSklMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEbG1fZGF0YXNldCU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEbG1fZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBkYXRhX2NvbGxhdG9yJTNEZGF0YV9jb2xsYXRvciUyQyUwQSklMEElMEF0cmFpbmVyLnRyYWluKCk=",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>    evaluation_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=u("p"),s.innerHTML=f,a=i(),$(p.$$.fragment),g=i(),$(h.$$.fragment),C=i(),J=u("p"),J.textContent=R,_=i(),m=u("ol"),m.innerHTML=k,G=i(),$(W.$$.fragment)},l(o){s=d(o,"P",{"data-svelte-h":!0}),y(s)!=="svelte-1yy4yh2"&&(s.innerHTML=f),a=c(o),j(p.$$.fragment,o),g=c(o),j(h.$$.fragment,o),C=c(o),J=d(o,"P",{"data-svelte-h":!0}),y(J)!=="svelte-1fkdw25"&&(J.textContent=R),_=c(o),m=d(o,"OL",{"data-svelte-h":!0}),y(m)!=="svelte-16tq1zt"&&(m.innerHTML=k),G=c(o),j(W.$$.fragment,o)},m(o,x){l(o,s,x),l(o,a,x),b(p,o,x),l(o,g,x),b(h,o,x),l(o,C,x),l(o,J,x),l(o,_,x),l(o,m,x),l(o,G,x),b(W,o,x),V=!0},p(o,x){const E={};x&2&&(E.$$scope={dirty:x,ctx:o}),h.$set(E)},i(o){V||(w(p.$$.fragment,o),w(h.$$.fragment,o),w(W.$$.fragment,o),V=!0)},o(o){T(p.$$.fragment,o),T(h.$$.fragment,o),T(W.$$.fragment,o),V=!1},d(o){o&&(t(s),t(a),t(g),t(C),t(J),t(_),t(m),t(G)),U(p,o),U(h,o),U(W,o)}}}function aa(v){let s,f;return s=new at({props:{$$slots:{default:[sa]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(a){j(s.$$.fragment,a)},m(a,p){b(s,a,p),f=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){f||(w(s.$$.fragment,a),f=!0)},o(a){T(s.$$.fragment,a),f=!1},d(a){U(s,a)}}}function la(v){let s,f='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=u("p"),s.innerHTML=f},l(a){s=d(a,"P",{"data-svelte-h":!0}),y(s)!=="svelte-txxfse"&&(s.innerHTML=f)},m(a,p){l(a,s,p)},p:ue,d(a){a&&t(s)}}}function na(v){let s,f='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.html#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:',a,p,g,h,C,J,R="Crea la función optimizadora, la tasa de aprendizaje, y algunos hiperparámetros de entrenamiento:",_,m,k,G,W="Carga DistilGPT2 con <code>TFAutoModelForCausalLM</code>:",V,o,x,E,ee='Configura el modelo para entrenamiento con <a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>:',A,F,B,X,te='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:',Q,H,q;return p=new z({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}}),h=new st({props:{$$slots:{default:[la]},$$scope:{ctx:v}}}),m=new z({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}}),o=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbGdwdDIlMjIp",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;distilgpt2&quot;</span>)`,wrap:!1}}),F=new z({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}}),H=new z({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=u("p"),s.innerHTML=f,a=i(),$(p.$$.fragment),g=i(),$(h.$$.fragment),C=i(),J=u("p"),J.textContent=R,_=i(),$(m.$$.fragment),k=i(),G=u("p"),G.innerHTML=W,V=i(),$(o.$$.fragment),x=i(),E=u("p"),E.innerHTML=ee,A=i(),$(F.$$.fragment),B=i(),X=u("p"),X.innerHTML=te,Q=i(),$(H.$$.fragment)},l(n){s=d(n,"P",{"data-svelte-h":!0}),y(s)!=="svelte-14lg0rt"&&(s.innerHTML=f),a=c(n),j(p.$$.fragment,n),g=c(n),j(h.$$.fragment,n),C=c(n),J=d(n,"P",{"data-svelte-h":!0}),y(J)!=="svelte-qa98st"&&(J.textContent=R),_=c(n),j(m.$$.fragment,n),k=c(n),G=d(n,"P",{"data-svelte-h":!0}),y(G)!=="svelte-r3087k"&&(G.innerHTML=W),V=c(n),j(o.$$.fragment,n),x=c(n),E=d(n,"P",{"data-svelte-h":!0}),y(E)!=="svelte-vifi3w"&&(E.innerHTML=ee),A=c(n),j(F.$$.fragment,n),B=c(n),X=d(n,"P",{"data-svelte-h":!0}),y(X)!=="svelte-meb7zc"&&(X.innerHTML=te),Q=c(n),j(H.$$.fragment,n)},m(n,M){l(n,s,M),l(n,a,M),b(p,n,M),l(n,g,M),b(h,n,M),l(n,C,M),l(n,J,M),l(n,_,M),b(m,n,M),l(n,k,M),l(n,G,M),l(n,V,M),b(o,n,M),l(n,x,M),l(n,E,M),l(n,A,M),b(F,n,M),l(n,B,M),l(n,X,M),l(n,Q,M),b(H,n,M),q=!0},p(n,M){const L={};M&2&&(L.$$scope={dirty:M,ctx:n}),h.$set(L)},i(n){q||(w(p.$$.fragment,n),w(h.$$.fragment,n),w(m.$$.fragment,n),w(o.$$.fragment,n),w(F.$$.fragment,n),w(H.$$.fragment,n),q=!0)},o(n){T(p.$$.fragment,n),T(h.$$.fragment,n),T(m.$$.fragment,n),T(o.$$.fragment,n),T(F.$$.fragment,n),T(H.$$.fragment,n),q=!1},d(n){n&&(t(s),t(a),t(g),t(C),t(J),t(_),t(k),t(G),t(V),t(x),t(E),t(A),t(B),t(X),t(Q)),U(p,n),U(h,n),U(m,n),U(o,n),U(F,n),U(H,n)}}}function ra(v){let s,f;return s=new at({props:{$$slots:{default:[na]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(a){j(s.$$.fragment,a)},m(a,p){b(s,a,p),f=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){f||(w(s.$$.fragment,a),f=!0)},o(a){T(s.$$.fragment,a),f=!1},d(a){U(s,a)}}}function oa(v){let s,f='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=u("p"),s.innerHTML=f},l(a){s=d(a,"P",{"data-svelte-h":!0}),y(s)!=="svelte-1rt7ku5"&&(s.innerHTML=f)},m(a,p){l(a,s,p)},p:ue,d(a){a&&t(s)}}}function pa(v){let s,f="Carga DistilRoBERTa con <code>AutoModelForMaskedlM</code>:",a,p,g,h,C,J,R="A este punto, solo faltan tres pasos:",_,m,k="<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>",G,W,V;return p=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvck1hc2tlZExNJTBBJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JNYXNrZWRMTS5mcm9tX3ByZXRyYWluZWQoJTIyZGlzdGlscm9iZXJ0YS1iYXNlJTIyKQ==",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;distilroberta-base&quot;</span>)`,wrap:!1}}),h=new st({props:{$$slots:{default:[oa]},$$scope:{ctx:v}}}),W=new z({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjIuJTJGcmVzdWx0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMGV2YWx1YXRpb25fc3RyYXRlZ3klM0QlMjJlcG9jaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGxlYXJuaW5nX3JhdGUlM0QyZS01JTJDJTBBJTIwJTIwJTIwJTIwbnVtX3RyYWluX2Vwb2NocyUzRDMlMkMlMEElMjAlMjAlMjAlMjB3ZWlnaHRfZGVjYXklM0QwLjAxJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0RsbV9kYXRhc2V0JTVCJTIydHJhaW4lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0RsbV9kYXRhc2V0JTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",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>    evaluation_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=u("p"),s.innerHTML=f,a=i(),$(p.$$.fragment),g=i(),$(h.$$.fragment),C=i(),J=u("p"),J.textContent=R,_=i(),m=u("ol"),m.innerHTML=k,G=i(),$(W.$$.fragment)},l(o){s=d(o,"P",{"data-svelte-h":!0}),y(s)!=="svelte-7nepae"&&(s.innerHTML=f),a=c(o),j(p.$$.fragment,o),g=c(o),j(h.$$.fragment,o),C=c(o),J=d(o,"P",{"data-svelte-h":!0}),y(J)!=="svelte-1fkdw25"&&(J.textContent=R),_=c(o),m=d(o,"OL",{"data-svelte-h":!0}),y(m)!=="svelte-11bmfc5"&&(m.innerHTML=k),G=c(o),j(W.$$.fragment,o)},m(o,x){l(o,s,x),l(o,a,x),b(p,o,x),l(o,g,x),b(h,o,x),l(o,C,x),l(o,J,x),l(o,_,x),l(o,m,x),l(o,G,x),b(W,o,x),V=!0},p(o,x){const E={};x&2&&(E.$$scope={dirty:x,ctx:o}),h.$set(E)},i(o){V||(w(p.$$.fragment,o),w(h.$$.fragment,o),w(W.$$.fragment,o),V=!0)},o(o){T(p.$$.fragment,o),T(h.$$.fragment,o),T(W.$$.fragment,o),V=!1},d(o){o&&(t(s),t(a),t(g),t(C),t(J),t(_),t(m),t(G)),U(p,o),U(h,o),U(W,o)}}}function ia(v){let s,f;return s=new at({props:{$$slots:{default:[pa]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(a){j(s.$$.fragment,a)},m(a,p){b(s,a,p),f=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){f||(w(s.$$.fragment,a),f=!0)},o(a){T(s.$$.fragment,a),f=!1},d(a){U(s,a)}}}function ca(v){let s,f='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=u("p"),s.innerHTML=f},l(a){s=d(a,"P",{"data-svelte-h":!0}),y(s)!=="svelte-txxfse"&&(s.innerHTML=f)},m(a,p){l(a,s,p)},p:ue,d(a){a&&t(s)}}}function ma(v){let s,f='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.html#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:',a,p,g,h,C,J,R="Crea la función optimizadora, la tasa de aprendizaje, y algunos hiperparámetros de entrenamiento:",_,m,k,G,W="Carga DistilRoBERTa con <code>TFAutoModelForMaskedLM</code>:",V,o,x,E,ee='Configura el modelo para entrenamiento con <a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>:',A,F,B,X,te='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:',Q,H,q;return p=new z({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}}),h=new st({props:{$$slots:{default:[ca]},$$scope:{ctx:v}}}),m=new z({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}}),o=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yTWFza2VkTE0lMEElMEFtb2RlbCUyMCUzRCUyMFRGQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMmRpc3RpbHJvYmVydGEtYmFzZSUyMik=",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;distilroberta-base&quot;</span>)`,wrap:!1}}),F=new z({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}}),H=new z({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=u("p"),s.innerHTML=f,a=i(),$(p.$$.fragment),g=i(),$(h.$$.fragment),C=i(),J=u("p"),J.textContent=R,_=i(),$(m.$$.fragment),k=i(),G=u("p"),G.innerHTML=W,V=i(),$(o.$$.fragment),x=i(),E=u("p"),E.innerHTML=ee,A=i(),$(F.$$.fragment),B=i(),X=u("p"),X.innerHTML=te,Q=i(),$(H.$$.fragment)},l(n){s=d(n,"P",{"data-svelte-h":!0}),y(s)!=="svelte-14lg0rt"&&(s.innerHTML=f),a=c(n),j(p.$$.fragment,n),g=c(n),j(h.$$.fragment,n),C=c(n),J=d(n,"P",{"data-svelte-h":!0}),y(J)!=="svelte-qa98st"&&(J.textContent=R),_=c(n),j(m.$$.fragment,n),k=c(n),G=d(n,"P",{"data-svelte-h":!0}),y(G)!=="svelte-1h9i1wk"&&(G.innerHTML=W),V=c(n),j(o.$$.fragment,n),x=c(n),E=d(n,"P",{"data-svelte-h":!0}),y(E)!=="svelte-vifi3w"&&(E.innerHTML=ee),A=c(n),j(F.$$.fragment,n),B=c(n),X=d(n,"P",{"data-svelte-h":!0}),y(X)!=="svelte-meb7zc"&&(X.innerHTML=te),Q=c(n),j(H.$$.fragment,n)},m(n,M){l(n,s,M),l(n,a,M),b(p,n,M),l(n,g,M),b(h,n,M),l(n,C,M),l(n,J,M),l(n,_,M),b(m,n,M),l(n,k,M),l(n,G,M),l(n,V,M),b(o,n,M),l(n,x,M),l(n,E,M),l(n,A,M),b(F,n,M),l(n,B,M),l(n,X,M),l(n,Q,M),b(H,n,M),q=!0},p(n,M){const L={};M&2&&(L.$$scope={dirty:M,ctx:n}),h.$set(L)},i(n){q||(w(p.$$.fragment,n),w(h.$$.fragment,n),w(m.$$.fragment,n),w(o.$$.fragment,n),w(F.$$.fragment,n),w(H.$$.fragment,n),q=!0)},o(n){T(p.$$.fragment,n),T(h.$$.fragment,n),T(m.$$.fragment,n),T(o.$$.fragment,n),T(F.$$.fragment,n),T(H.$$.fragment,n),q=!1},d(n){n&&(t(s),t(a),t(g),t(C),t(J),t(_),t(k),t(G),t(V),t(x),t(E),t(A),t(B),t(X),t(Q)),U(p,n),U(h,n),U(m,n),U(o,n),U(F,n),U(H,n)}}}function ua(v){let s,f;return s=new at({props:{$$slots:{default:[ma]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(a){j(s.$$.fragment,a)},m(a,p){b(s,a,p),f=!0},p(a,p){const g={};p&2&&(g.$$scope={dirty:p,ctx:a}),s.$set(g)},i(a){f||(w(s.$$.fragment,a),f=!0)},o(a){T(s.$$.fragment,a),f=!1},d(a){U(s,a)}}}function da(v){let s,f=`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=u("p"),s.innerHTML=f},l(a){s=d(a,"P",{"data-svelte-h":!0}),y(s)!=="svelte-1frn7nq"&&(s.innerHTML=f)},m(a,p){l(a,s,p)},p:ue,d(a){a&&t(s)}}}function fa(v){let s,f,a,p,g,h,C,J,R,_,m="Modelado de lenguaje",k,G,W="El modelado de lenguaje predice palabras en un enunciado. Hay dos formas de modelado de lenguaje.",V,o,x,E,ee="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.",A,F,B,X,te="El modelado de lenguaje por enmascaramiento predice un token enmascarado en una secuencia, y el modelo puede considerar los tokens bidireccionalmente.",Q,H,q='Esta guía te mostrará cómo realizar fine-tuning <a href="https://huggingface.co/distilgpt2" rel="nofollow">DistilGPT2</a> para modelos de lenguaje causales y <a href="https://huggingface.co/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>.',n,M,L,N,se,lt,de,ns,Pe,us="Carga el dataset ELI5",ft,fe,ds="Carga solo los primeros 5000 registros desde la biblioteca 🤗 Datasets, dado que es bastante grande:",ht,he,gt,ge,fs="Divide este dataset en subdatasets para el entrenamiento y el test:",Mt,Me,yt,ye,hs="Luego observa un ejemplo:",$t,$e,jt,je,gs="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.",bt,S,ae,nt,be,rs,De,Ms="Preprocesamiento",wt,we,Tt,Te,ys="Para modelados de lenguaje causales carga el tokenizador DistilGPT2 para procesar el subcampo <code>text</code>:",Ut,Ue,Jt,Je,xt,xe,$s="Para modelados de lenguaje por enmascaramiento carga el tokenizador DistilRoBERTa, en lugar de DistilGPT2:",_t,_e,kt,ke,js='Extrae el subcampo <code>text</code> desde su estructura anidado con el método <a href="https://huggingface.co/docs/datasets/process.html#flatten" rel="nofollow"><code>flatten</code></a>:',vt,ve,Ct,Ce,bs="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.",Gt,Ge,ws="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:",Rt,Re,Zt,Ze,Ts='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:',Et,Ee,It,Ie,Us="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:",zt,ze,Js="<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>",Wt,We,Vt,Ve,xs="Aplica la función <code>group_texts</code> sobre todo el dataset:",Ft,Fe,Xt,Xe,_s="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.",Ht,le,Yt,P,ne,rt,He,os,Ke,ks="Modelado de lenguaje causal",At,Ye,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/distilgpt2" rel="nofollow">DistilGPT2</a> para generar nuevo texto.',Bt,D,re,ot,Ae,ps,Oe,Cs="Entrenamiento",Qt,oe,qt,K,pe,pt,Be,is,et,Gs="Modelado de lenguaje por enmascaramiento",Lt,Qe,Rs='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/distilroberta-base" rel="nofollow">DistilRoBERTa</a> para predecir una palabra enmascarada.',Nt,O,ie,it,qe,cs,tt,Zs="Entrenamiento",St,ce,Pt,me,Dt,ct,Kt;return J=new Se({}),o=new ls({props:{id:"Vpjb1lu0MDk"}}),F=new ls({props:{id:"mqElG5QJWUg"}}),M=new st({props:{$$slots:{default:[Ps]},$$scope:{ctx:v}}}),de=new Se({}),he=new z({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}}),Me=new z({props:{code:"ZWxpNSUyMCUzRCUyMGVsaTUudHJhaW5fdGVzdF9zcGxpdCh0ZXN0X3NpemUlM0QwLjIp",highlighted:'eli5 = eli5.train_test_split(test_size=<span class="hljs-number">0.2</span>)',wrap:!1}}),$e=new z({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}}),be=new Se({}),we=new ls({props:{id:"ma1TrR7gE7I"}}),Ue=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxncHQyJTIyKQ==",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;distilgpt2&quot;</span>)`,wrap:!1}}),Je=new ls({props:{id:"8PmhEIXhBvI"}}),_e=new z({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxyb2JlcnRhLWJhc2UlMjIp",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;distilroberta-base&quot;</span>)`,wrap:!1}}),ve=new z({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}}),Re=new z({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}}),Ee=new z({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}}),We=new z({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}}),Fe=new z({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}}),le=new ms({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ea],pytorch:[Ks]},$$scope:{ctx:v}}}),He=new Se({}),Ae=new Se({}),oe=new ms({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ra],pytorch:[aa]},$$scope:{ctx:v}}}),Be=new Se({}),qe=new Se({}),ce=new ms({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ua],pytorch:[ia]},$$scope:{ctx:v}}}),me=new st({props:{$$slots:{default:[da]},$$scope:{ctx:v}}}),{c(){s=u("meta"),f=i(),a=u("p"),p=i(),g=u("h1"),h=u("a"),C=u("span"),$(J.$$.fragment),R=i(),_=u("span"),_.textContent=m,k=i(),G=u("p"),G.textContent=W,V=i(),$(o.$$.fragment),x=i(),E=u("p"),E.textContent=ee,A=i(),$(F.$$.fragment),B=i(),X=u("p"),X.textContent=te,Q=i(),H=u("p"),H.innerHTML=q,n=i(),$(M.$$.fragment),L=i(),N=u("h2"),se=u("a"),lt=u("span"),$(de.$$.fragment),ns=i(),Pe=u("span"),Pe.textContent=us,ft=i(),fe=u("p"),fe.textContent=ds,ht=i(),$(he.$$.fragment),gt=i(),ge=u("p"),ge.textContent=fs,Mt=i(),$(Me.$$.fragment),yt=i(),ye=u("p"),ye.textContent=hs,$t=i(),$($e.$$.fragment),jt=i(),je=u("p"),je.innerHTML=gs,bt=i(),S=u("h2"),ae=u("a"),nt=u("span"),$(be.$$.fragment),rs=i(),De=u("span"),De.textContent=Ms,wt=i(),$(we.$$.fragment),Tt=i(),Te=u("p"),Te.innerHTML=ys,Ut=i(),$(Ue.$$.fragment),Jt=i(),$(Je.$$.fragment),xt=i(),xe=u("p"),xe.textContent=$s,_t=i(),$(_e.$$.fragment),kt=i(),ke=u("p"),ke.innerHTML=js,vt=i(),$(ve.$$.fragment),Ct=i(),Ce=u("p"),Ce.innerHTML=bs,Gt=i(),Ge=u("p"),Ge.textContent=ws,Rt=i(),$(Re.$$.fragment),Zt=i(),Ze=u("p"),Ze.innerHTML=Ts,Et=i(),$(Ee.$$.fragment),It=i(),Ie=u("p"),Ie.textContent=Us,zt=i(),ze=u("ul"),ze.innerHTML=Js,Wt=i(),$(We.$$.fragment),Vt=i(),Ve=u("p"),Ve.innerHTML=xs,Ft=i(),$(Fe.$$.fragment),Xt=i(),Xe=u("p"),Xe.innerHTML=_s,Ht=i(),$(le.$$.fragment),Yt=i(),P=u("h2"),ne=u("a"),rt=u("span"),$(He.$$.fragment),os=i(),Ke=u("span"),Ke.textContent=ks,At=i(),Ye=u("p"),Ye.innerHTML=vs,Bt=i(),D=u("h3"),re=u("a"),ot=u("span"),$(Ae.$$.fragment),ps=i(),Oe=u("span"),Oe.textContent=Cs,Qt=i(),$(oe.$$.fragment),qt=i(),K=u("h2"),pe=u("a"),pt=u("span"),$(Be.$$.fragment),is=i(),et=u("span"),et.textContent=Gs,Lt=i(),Qe=u("p"),Qe.innerHTML=Rs,Nt=i(),O=u("h3"),ie=u("a"),it=u("span"),$(qe.$$.fragment),cs=i(),tt=u("span"),tt.textContent=Zs,St=i(),$(ce.$$.fragment),Pt=i(),$(me.$$.fragment),Dt=i(),ct=u("p"),this.h()},l(e){const r=Ss("svelte-1phssyn",document.head);s=d(r,"META",{name:!0,content:!0}),r.forEach(t),f=c(e),a=d(e,"P",{}),Y(a).forEach(t),p=c(e),g=d(e,"H1",{class:!0});var Le=Y(g);h=d(Le,"A",{id:!0,class:!0,href:!0});var mt=Y(h);C=d(mt,"SPAN",{});var ut=Y(C);j(J.$$.fragment,ut),ut.forEach(t),mt.forEach(t),R=c(Le),_=d(Le,"SPAN",{"data-svelte-h":!0}),y(_)!=="svelte-1nuqda4"&&(_.textContent=m),Le.forEach(t),k=c(e),G=d(e,"P",{"data-svelte-h":!0}),y(G)!=="svelte-1sv8lp6"&&(G.textContent=W),V=c(e),j(o.$$.fragment,e),x=c(e),E=d(e,"P",{"data-svelte-h":!0}),y(E)!=="svelte-o9osiq"&&(E.textContent=ee),A=c(e),j(F.$$.fragment,e),B=c(e),X=d(e,"P",{"data-svelte-h":!0}),y(X)!=="svelte-rdtqpf"&&(X.textContent=te),Q=c(e),H=d(e,"P",{"data-svelte-h":!0}),y(H)!=="svelte-mri092"&&(H.innerHTML=q),n=c(e),j(M.$$.fragment,e),L=c(e),N=d(e,"H2",{class:!0});var Ne=Y(N);se=d(Ne,"A",{id:!0,class:!0,href:!0});var dt=Y(se);lt=d(dt,"SPAN",{});var Es=Y(lt);j(de.$$.fragment,Es),Es.forEach(t),dt.forEach(t),ns=c(Ne),Pe=d(Ne,"SPAN",{"data-svelte-h":!0}),y(Pe)!=="svelte-jrkd3h"&&(Pe.textContent=us),Ne.forEach(t),ft=c(e),fe=d(e,"P",{"data-svelte-h":!0}),y(fe)!=="svelte-3nech7"&&(fe.textContent=ds),ht=c(e),j(he.$$.fragment,e),gt=c(e),ge=d(e,"P",{"data-svelte-h":!0}),y(ge)!=="svelte-1fx745g"&&(ge.textContent=fs),Mt=c(e),j(Me.$$.fragment,e),yt=c(e),ye=d(e,"P",{"data-svelte-h":!0}),y(ye)!=="svelte-62xfwd"&&(ye.textContent=hs),$t=c(e),j($e.$$.fragment,e),jt=c(e),je=d(e,"P",{"data-svelte-h":!0}),y(je)!=="svelte-1pbomcc"&&(je.innerHTML=gs),bt=c(e),S=d(e,"H2",{class:!0});var Ot=Y(S);ae=d(Ot,"A",{id:!0,class:!0,href:!0});var Is=Y(ae);nt=d(Is,"SPAN",{});var zs=Y(nt);j(be.$$.fragment,zs),zs.forEach(t),Is.forEach(t),rs=c(Ot),De=d(Ot,"SPAN",{"data-svelte-h":!0}),y(De)!=="svelte-klvb09"&&(De.textContent=Ms),Ot.forEach(t),wt=c(e),j(we.$$.fragment,e),Tt=c(e),Te=d(e,"P",{"data-svelte-h":!0}),y(Te)!=="svelte-1300qak"&&(Te.innerHTML=ys),Ut=c(e),j(Ue.$$.fragment,e),Jt=c(e),j(Je.$$.fragment,e),xt=c(e),xe=d(e,"P",{"data-svelte-h":!0}),y(xe)!=="svelte-1ihod96"&&(xe.textContent=$s),_t=c(e),j(_e.$$.fragment,e),kt=c(e),ke=d(e,"P",{"data-svelte-h":!0}),y(ke)!=="svelte-fe48nn"&&(ke.innerHTML=js),vt=c(e),j(ve.$$.fragment,e),Ct=c(e),Ce=d(e,"P",{"data-svelte-h":!0}),y(Ce)!=="svelte-1qnu3op"&&(Ce.innerHTML=bs),Gt=c(e),Ge=d(e,"P",{"data-svelte-h":!0}),y(Ge)!=="svelte-lbchb7"&&(Ge.textContent=ws),Rt=c(e),j(Re.$$.fragment,e),Zt=c(e),Ze=d(e,"P",{"data-svelte-h":!0}),y(Ze)!=="svelte-1rtefwl"&&(Ze.innerHTML=Ts),Et=c(e),j(Ee.$$.fragment,e),It=c(e),Ie=d(e,"P",{"data-svelte-h":!0}),y(Ie)!=="svelte-10yu7cu"&&(Ie.textContent=Us),zt=c(e),ze=d(e,"UL",{"data-svelte-h":!0}),y(ze)!=="svelte-jdg0mp"&&(ze.innerHTML=Js),Wt=c(e),j(We.$$.fragment,e),Vt=c(e),Ve=d(e,"P",{"data-svelte-h":!0}),y(Ve)!=="svelte-bteuj6"&&(Ve.innerHTML=xs),Ft=c(e),j(Fe.$$.fragment,e),Xt=c(e),Xe=d(e,"P",{"data-svelte-h":!0}),y(Xe)!=="svelte-1llnvt1"&&(Xe.innerHTML=_s),Ht=c(e),j(le.$$.fragment,e),Yt=c(e),P=d(e,"H2",{class:!0});var es=Y(P);ne=d(es,"A",{id:!0,class:!0,href:!0});var Ws=Y(ne);rt=d(Ws,"SPAN",{});var Vs=Y(rt);j(He.$$.fragment,Vs),Vs.forEach(t),Ws.forEach(t),os=c(es),Ke=d(es,"SPAN",{"data-svelte-h":!0}),y(Ke)!=="svelte-x09b83"&&(Ke.textContent=ks),es.forEach(t),At=c(e),Ye=d(e,"P",{"data-svelte-h":!0}),y(Ye)!=="svelte-o0gs1y"&&(Ye.innerHTML=vs),Bt=c(e),D=d(e,"H3",{class:!0});var ts=Y(D);re=d(ts,"A",{id:!0,class:!0,href:!0});var Fs=Y(re);ot=d(Fs,"SPAN",{});var Xs=Y(ot);j(Ae.$$.fragment,Xs),Xs.forEach(t),Fs.forEach(t),ps=c(ts),Oe=d(ts,"SPAN",{"data-svelte-h":!0}),y(Oe)!=="svelte-1b8djky"&&(Oe.textContent=Cs),ts.forEach(t),Qt=c(e),j(oe.$$.fragment,e),qt=c(e),K=d(e,"H2",{class:!0});var ss=Y(K);pe=d(ss,"A",{id:!0,class:!0,href:!0});var Hs=Y(pe);pt=d(Hs,"SPAN",{});var Ys=Y(pt);j(Be.$$.fragment,Ys),Ys.forEach(t),Hs.forEach(t),is=c(ss),et=d(ss,"SPAN",{"data-svelte-h":!0}),y(et)!=="svelte-mce37a"&&(et.textContent=Gs),ss.forEach(t),Lt=c(e),Qe=d(e,"P",{"data-svelte-h":!0}),y(Qe)!=="svelte-kmhyul"&&(Qe.innerHTML=Rs),Nt=c(e),O=d(e,"H3",{class:!0});var as=Y(O);ie=d(as,"A",{id:!0,class:!0,href:!0});var As=Y(ie);it=d(As,"SPAN",{});var Bs=Y(it);j(qe.$$.fragment,Bs),Bs.forEach(t),As.forEach(t),cs=c(as),tt=d(as,"SPAN",{"data-svelte-h":!0}),y(tt)!=="svelte-1b8djky"&&(tt.textContent=Zs),as.forEach(t),St=c(e),j(ce.$$.fragment,e),Pt=c(e),j(me.$$.fragment,e),Dt=c(e),ct=d(e,"P",{}),Y(ct).forEach(t),this.h()},h(){Z(s,"name","hf:doc:metadata"),Z(s,"content",JSON.stringify(ha)),Z(h,"id","modelado-de-lenguaje"),Z(h,"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"),Z(h,"href","#modelado-de-lenguaje"),Z(g,"class","relative group"),Z(se,"id","carga-el-dataset-eli5"),Z(se,"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"),Z(se,"href","#carga-el-dataset-eli5"),Z(N,"class","relative group"),Z(ae,"id","preprocesamiento"),Z(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),Z(ae,"href","#preprocesamiento"),Z(S,"class","relative group"),Z(ne,"id","modelado-de-lenguaje-causal"),Z(ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),Z(ne,"href","#modelado-de-lenguaje-causal"),Z(P,"class","relative group"),Z(re,"id","entrenamiento"),Z(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),Z(re,"href","#entrenamiento"),Z(D,"class","relative group"),Z(pe,"id","modelado-de-lenguaje-por-enmascaramiento"),Z(pe,"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"),Z(pe,"href","#modelado-de-lenguaje-por-enmascaramiento"),Z(K,"class","relative group"),Z(ie,"id","entrenamiento"),Z(ie,"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"),Z(ie,"href","#entrenamiento"),Z(O,"class","relative group")},m(e,r){I(document.head,s),l(e,f,r),l(e,a,r),l(e,p,r),l(e,g,r),I(g,h),I(h,C),b(J,C,null),I(g,R),I(g,_),l(e,k,r),l(e,G,r),l(e,V,r),b(o,e,r),l(e,x,r),l(e,E,r),l(e,A,r),b(F,e,r),l(e,B,r),l(e,X,r),l(e,Q,r),l(e,H,r),l(e,n,r),b(M,e,r),l(e,L,r),l(e,N,r),I(N,se),I(se,lt),b(de,lt,null),I(N,ns),I(N,Pe),l(e,ft,r),l(e,fe,r),l(e,ht,r),b(he,e,r),l(e,gt,r),l(e,ge,r),l(e,Mt,r),b(Me,e,r),l(e,yt,r),l(e,ye,r),l(e,$t,r),b($e,e,r),l(e,jt,r),l(e,je,r),l(e,bt,r),l(e,S,r),I(S,ae),I(ae,nt),b(be,nt,null),I(S,rs),I(S,De),l(e,wt,r),b(we,e,r),l(e,Tt,r),l(e,Te,r),l(e,Ut,r),b(Ue,e,r),l(e,Jt,r),b(Je,e,r),l(e,xt,r),l(e,xe,r),l(e,_t,r),b(_e,e,r),l(e,kt,r),l(e,ke,r),l(e,vt,r),b(ve,e,r),l(e,Ct,r),l(e,Ce,r),l(e,Gt,r),l(e,Ge,r),l(e,Rt,r),b(Re,e,r),l(e,Zt,r),l(e,Ze,r),l(e,Et,r),b(Ee,e,r),l(e,It,r),l(e,Ie,r),l(e,zt,r),l(e,ze,r),l(e,Wt,r),b(We,e,r),l(e,Vt,r),l(e,Ve,r),l(e,Ft,r),b(Fe,e,r),l(e,Xt,r),l(e,Xe,r),l(e,Ht,r),b(le,e,r),l(e,Yt,r),l(e,P,r),I(P,ne),I(ne,rt),b(He,rt,null),I(P,os),I(P,Ke),l(e,At,r),l(e,Ye,r),l(e,Bt,r),l(e,D,r),I(D,re),I(re,ot),b(Ae,ot,null),I(D,ps),I(D,Oe),l(e,Qt,r),b(oe,e,r),l(e,qt,r),l(e,K,r),I(K,pe),I(pe,pt),b(Be,pt,null),I(K,is),I(K,et),l(e,Lt,r),l(e,Qe,r),l(e,Nt,r),l(e,O,r),I(O,ie),I(ie,it),b(qe,it,null),I(O,cs),I(O,tt),l(e,St,r),b(ce,e,r),l(e,Pt,r),b(me,e,r),l(e,Dt,r),l(e,ct,r),Kt=!0},p(e,[r]){const Le={};r&2&&(Le.$$scope={dirty:r,ctx:e}),M.$set(Le);const mt={};r&2&&(mt.$$scope={dirty:r,ctx:e}),le.$set(mt);const ut={};r&2&&(ut.$$scope={dirty:r,ctx:e}),oe.$set(ut);const Ne={};r&2&&(Ne.$$scope={dirty:r,ctx:e}),ce.$set(Ne);const dt={};r&2&&(dt.$$scope={dirty:r,ctx:e}),me.$set(dt)},i(e){Kt||(w(J.$$.fragment,e),w(o.$$.fragment,e),w(F.$$.fragment,e),w(M.$$.fragment,e),w(de.$$.fragment,e),w(he.$$.fragment,e),w(Me.$$.fragment,e),w($e.$$.fragment,e),w(be.$$.fragment,e),w(we.$$.fragment,e),w(Ue.$$.fragment,e),w(Je.$$.fragment,e),w(_e.$$.fragment,e),w(ve.$$.fragment,e),w(Re.$$.fragment,e),w(Ee.$$.fragment,e),w(We.$$.fragment,e),w(Fe.$$.fragment,e),w(le.$$.fragment,e),w(He.$$.fragment,e),w(Ae.$$.fragment,e),w(oe.$$.fragment,e),w(Be.$$.fragment,e),w(qe.$$.fragment,e),w(ce.$$.fragment,e),w(me.$$.fragment,e),Kt=!0)},o(e){T(J.$$.fragment,e),T(o.$$.fragment,e),T(F.$$.fragment,e),T(M.$$.fragment,e),T(de.$$.fragment,e),T(he.$$.fragment,e),T(Me.$$.fragment,e),T($e.$$.fragment,e),T(be.$$.fragment,e),T(we.$$.fragment,e),T(Ue.$$.fragment,e),T(Je.$$.fragment,e),T(_e.$$.fragment,e),T(ve.$$.fragment,e),T(Re.$$.fragment,e),T(Ee.$$.fragment,e),T(We.$$.fragment,e),T(Fe.$$.fragment,e),T(le.$$.fragment,e),T(He.$$.fragment,e),T(Ae.$$.fragment,e),T(oe.$$.fragment,e),T(Be.$$.fragment,e),T(qe.$$.fragment,e),T(ce.$$.fragment,e),T(me.$$.fragment,e),Kt=!1},d(e){e&&(t(f),t(a),t(p),t(g),t(k),t(G),t(V),t(x),t(E),t(A),t(B),t(X),t(Q),t(H),t(n),t(L),t(N),t(ft),t(fe),t(ht),t(gt),t(ge),t(Mt),t(yt),t(ye),t($t),t(jt),t(je),t(bt),t(S),t(wt),t(Tt),t(Te),t(Ut),t(Jt),t(xt),t(xe),t(_t),t(kt),t(ke),t(vt),t(Ct),t(Ce),t(Gt),t(Ge),t(Rt),t(Zt),t(Ze),t(Et),t(It),t(Ie),t(zt),t(ze),t(Wt),t(Vt),t(Ve),t(Ft),t(Xt),t(Xe),t(Ht),t(Yt),t(P),t(At),t(Ye),t(Bt),t(D),t(Qt),t(qt),t(K),t(Lt),t(Qe),t(Nt),t(O),t(St),t(Pt),t(Dt),t(ct)),t(s),U(J),U(o,e),U(F,e),U(M,e),U(de),U(he,e),U(Me,e),U($e,e),U(be),U(we,e),U(Ue,e),U(Je,e),U(_e,e),U(ve,e),U(Re,e),U(Ee,e),U(We,e),U(Fe,e),U(le,e),U(He),U(Ae),U(oe,e),U(Be),U(qe),U(ce,e),U(me,e)}}}const ha={local:"modelado-de-lenguaje",sections:[{local:"carga-el-dataset-eli5",title:"Carga el dataset ELI5"},{local:"preprocesamiento",title:"Preprocesamiento"},{local:"modelado-de-lenguaje-causal",sections:[{local:"entrenamiento",title:"Entrenamiento"}],title:"Modelado de lenguaje causal"},{local:"modelado-de-lenguaje-por-enmascaramiento",sections:[{local:"entrenamiento",title:"Entrenamiento"}],title:"Modelado de lenguaje por enmascaramiento"}],title:"Modelado de lenguaje"};function ga(v){return qs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ua extends Ls{constructor(s){super(),Ns(this,s,ga,fa,Qs,{})}}export{Ua as component};
