Buckets:

rtrm's picture
download
raw
10.4 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;AutoTrain Configs&quot;,&quot;local&quot;:&quot;autotrain-configs&quot;,&quot;sections&quot;:[],&quot;depth&quot;:1}">
<link href="/docs/autotrain/pr_739/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/entry/start.0692486c.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/chunks/scheduler.0219f8bd.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/chunks/singletons.9483577c.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/chunks/paths.f43b8d19.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/entry/app.0ceabe8e.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/chunks/index.f61edf3b.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/nodes/0.9ba14acc.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/nodes/4.554ab4ae.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/chunks/CodeBlock.38e566ae.js">
<link rel="modulepreload" href="/docs/autotrain/pr_739/en/_app/immutable/chunks/EditOnGithub.48fa589f.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;AutoTrain Configs&quot;,&quot;local&quot;:&quot;autotrain-configs&quot;,&quot;sections&quot;:[],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <h1 class="relative group"><a id="autotrain-configs" 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" href="#autotrain-configs"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>AutoTrain Configs</span></h1> <p data-svelte-h="svelte-1eim3ay">AutoTrain Configs are the way to use and train models using AutoTrain locally.</p> <p data-svelte-h="svelte-vg07k5">Once you have installed AutoTrain Advanced, you can use the following command to train models using AutoTrain config files:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->$ <span class="hljs-built_in">export</span> HF_USERNAME=your_hugging_face_username
$ <span class="hljs-built_in">export</span> HF_TOKEN=your_hugging_face_write_token
$ autotrain --config path/to/config.yaml<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-g36qrt">Example configurations for all tasks can be found in the <code>configs</code> directory of
the <a href="https://github.com/huggingface/autotrain-advanced" rel="nofollow">AutoTrain Advanced GitHub repository</a>.</p> <p data-svelte-h="svelte-w9dhtm">Here is an example of an AutoTrain config file:</p> <div class="code-block relative"><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-attr">task:</span> <span class="hljs-string">llm</span>
<span class="hljs-attr">base_model:</span> <span class="hljs-string">meta-llama/Meta-Llama-3-8B-Instruct</span>
<span class="hljs-attr">project_name:</span> <span class="hljs-string">autotrain-llama3-8b-orpo</span>
<span class="hljs-attr">log:</span> <span class="hljs-string">tensorboard</span>
<span class="hljs-attr">backend:</span> <span class="hljs-string">local</span>
<span class="hljs-attr">data:</span>
<span class="hljs-attr">path:</span> <span class="hljs-string">argilla/distilabel-capybara-dpo-7k-binarized</span>
<span class="hljs-attr">train_split:</span> <span class="hljs-string">train</span>
<span class="hljs-attr">valid_split:</span> <span class="hljs-literal">null</span>
<span class="hljs-attr">chat_template:</span> <span class="hljs-string">chatml</span>
<span class="hljs-attr">column_mapping:</span>
<span class="hljs-attr">text_column:</span> <span class="hljs-string">chosen</span>
<span class="hljs-attr">rejected_text_column:</span> <span class="hljs-string">rejected</span>
<span class="hljs-attr">params:</span>
<span class="hljs-attr">trainer:</span> <span class="hljs-string">orpo</span>
<span class="hljs-attr">block_size:</span> <span class="hljs-number">1024</span>
<span class="hljs-attr">model_max_length:</span> <span class="hljs-number">2048</span>
<span class="hljs-attr">max_prompt_length:</span> <span class="hljs-number">512</span>
<span class="hljs-attr">epochs:</span> <span class="hljs-number">3</span>
<span class="hljs-attr">batch_size:</span> <span class="hljs-number">2</span>
<span class="hljs-attr">lr:</span> <span class="hljs-number">3e-5</span>
<span class="hljs-attr">peft:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">quantization:</span> <span class="hljs-string">int4</span>
<span class="hljs-attr">target_modules:</span> <span class="hljs-string">all-linear</span>
<span class="hljs-attr">padding:</span> <span class="hljs-string">right</span>
<span class="hljs-attr">optimizer:</span> <span class="hljs-string">adamw_torch</span>
<span class="hljs-attr">scheduler:</span> <span class="hljs-string">linear</span>
<span class="hljs-attr">gradient_accumulation:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">mixed_precision:</span> <span class="hljs-string">bf16</span>
<span class="hljs-attr">hub:</span>
<span class="hljs-attr">username:</span> <span class="hljs-string">${HF_USERNAME}</span>
<span class="hljs-attr">token:</span> <span class="hljs-string">${HF_TOKEN}</span>
<span class="hljs-attr">push_to_hub:</span> <span class="hljs-literal">true</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-krc8fr">In this config, we are finetuning the <code>meta-llama/Meta-Llama-3-8B-Instruct</code> model
on the <code>argilla/distilabel-capybara-dpo-7k-binarized</code> dataset using the <code>orpo</code>
trainer for 3 epochs with a batch size of 2 and a learning rate of <code>3e-5</code>.
More information on the available parameters can be found in the <em>Data Formats and Parameters</em> section.</p> <p data-svelte-h="svelte-i1s9p9">In case you dont want to push the model to hub, you can set <code>push_to_hub</code> to <code>false</code> in the config file.
If not pushing the model to hub username and token are not required. Note: they may still be needed
if you are trying to access gated models or datasets.</p> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/autotrain-advanced/blob/main/docs/source/config.mdx" target="_blank"><span data-svelte-h="svelte-1kd6by1">&lt;</span> <span data-svelte-h="svelte-x0xyl0">&gt;</span> <span data-svelte-h="svelte-1dajgef"><span class="underline ml-1.5">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_9o2j7e = {
assets: "/docs/autotrain/pr_739/en",
base: "/docs/autotrain/pr_739/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/autotrain/pr_739/en/_app/immutable/entry/start.0692486c.js"),
import("/docs/autotrain/pr_739/en/_app/immutable/entry/app.0ceabe8e.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 4],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
10.4 kB
·
Xet hash:
46d6630394a41eae6eb248e00a34eaf93b12e65cd1860445a6877dfdbc1586d5

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.