Built site for gh-pages
This commit is contained in:
@@ -20,41 +20,6 @@ ul.task-list li input[type="checkbox"] {
|
||||
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
||||
vertical-align: middle;
|
||||
}
|
||||
/* CSS for syntax highlighting */
|
||||
html { -webkit-text-size-adjust: 100%; }
|
||||
pre > code.sourceCode { white-space: pre; position: relative; }
|
||||
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
|
||||
pre > code.sourceCode > span:empty { height: 1.2em; }
|
||||
.sourceCode { overflow: visible; }
|
||||
code.sourceCode > span { color: inherit; text-decoration: inherit; }
|
||||
div.sourceCode { margin: 1em 0; }
|
||||
pre.sourceCode { margin: 0; }
|
||||
@media screen {
|
||||
div.sourceCode { overflow: auto; }
|
||||
}
|
||||
@media print {
|
||||
pre > code.sourceCode { white-space: pre-wrap; }
|
||||
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
|
||||
}
|
||||
pre.numberSource code
|
||||
{ counter-reset: source-line 0; }
|
||||
pre.numberSource code > span
|
||||
{ position: relative; left: -4em; counter-increment: source-line; }
|
||||
pre.numberSource code > span > a:first-child::before
|
||||
{ content: counter(source-line);
|
||||
position: relative; left: -1em; text-align: right; vertical-align: baseline;
|
||||
border: none; display: inline-block;
|
||||
-webkit-touch-callout: none; -webkit-user-select: none;
|
||||
-khtml-user-select: none; -moz-user-select: none;
|
||||
-ms-user-select: none; user-select: none;
|
||||
padding: 0 4px; width: 4em;
|
||||
}
|
||||
pre.numberSource { margin-left: 3em; padding-left: 4px; }
|
||||
div.sourceCode
|
||||
{ }
|
||||
@media screen {
|
||||
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -482,20 +447,7 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
|
||||
<h2 id="toc-title">On this page</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#axolotl.cli.utils" id="toc-axolotl.cli.utils" class="nav-link active" data-scroll-target="#axolotl.cli.utils">cli.utils</a>
|
||||
<ul class="collapse">
|
||||
<li><a href="#functions" id="toc-functions" class="nav-link" data-scroll-target="#functions">Functions</a>
|
||||
<ul class="collapse">
|
||||
<li><a href="#axolotl.cli.utils.add_options_from_config" id="toc-axolotl.cli.utils.add_options_from_config" class="nav-link" data-scroll-target="#axolotl.cli.utils.add_options_from_config">add_options_from_config</a></li>
|
||||
<li><a href="#axolotl.cli.utils.add_options_from_dataclass" id="toc-axolotl.cli.utils.add_options_from_dataclass" class="nav-link" data-scroll-target="#axolotl.cli.utils.add_options_from_dataclass">add_options_from_dataclass</a></li>
|
||||
<li><a href="#axolotl.cli.utils.build_command" id="toc-axolotl.cli.utils.build_command" class="nav-link" data-scroll-target="#axolotl.cli.utils.build_command">build_command</a></li>
|
||||
<li><a href="#axolotl.cli.utils.download_file" id="toc-axolotl.cli.utils.download_file" class="nav-link" data-scroll-target="#axolotl.cli.utils.download_file">download_file</a></li>
|
||||
<li><a href="#axolotl.cli.utils.fetch_from_github" id="toc-axolotl.cli.utils.fetch_from_github" class="nav-link" data-scroll-target="#axolotl.cli.utils.fetch_from_github">fetch_from_github</a></li>
|
||||
<li><a href="#axolotl.cli.utils.filter_none_kwargs" id="toc-axolotl.cli.utils.filter_none_kwargs" class="nav-link" data-scroll-target="#axolotl.cli.utils.filter_none_kwargs">filter_none_kwargs</a></li>
|
||||
<li><a href="#axolotl.cli.utils.load_model_and_tokenizer" id="toc-axolotl.cli.utils.load_model_and_tokenizer" class="nav-link" data-scroll-target="#axolotl.cli.utils.load_model_and_tokenizer">load_model_and_tokenizer</a></li>
|
||||
<li><a href="#axolotl.cli.utils.strip_optional_type" id="toc-axolotl.cli.utils.strip_optional_type" class="nav-link" data-scroll-target="#axolotl.cli.utils.strip_optional_type">strip_optional_type</a></li>
|
||||
</ul></li>
|
||||
</ul></li>
|
||||
<li><a href="#axolotl.cli.utils" id="toc-axolotl.cli.utils" class="nav-link active" data-scroll-target="#axolotl.cli.utils">cli.utils</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -508,496 +460,9 @@ gtag('config', 'G-9KYCVJBNMQ', { 'anonymize_ip': true});
|
||||
<section id="axolotl.cli.utils" class="level1">
|
||||
<h1>cli.utils</h1>
|
||||
<p><code>cli.utils</code></p>
|
||||
<p>Utility methods for axolotl CLI.</p>
|
||||
<section id="functions" class="level2">
|
||||
<h2 class="anchored" data-anchor-id="functions">Functions</h2>
|
||||
<table class="caption-top table">
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><a href="#axolotl.cli.utils.add_options_from_config">add_options_from_config</a></td>
|
||||
<td>Create Click options from the fields of a Pydantic model.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#axolotl.cli.utils.add_options_from_dataclass">add_options_from_dataclass</a></td>
|
||||
<td>Create Click options from the fields of a dataclass.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#axolotl.cli.utils.build_command">build_command</a></td>
|
||||
<td>Build command list from base command and options.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#axolotl.cli.utils.download_file">download_file</a></td>
|
||||
<td>Download a single file and return its processing status.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#axolotl.cli.utils.fetch_from_github">fetch_from_github</a></td>
|
||||
<td>Sync files from a specific directory in the GitHub repository.</td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#axolotl.cli.utils.filter_none_kwargs">filter_none_kwargs</a></td>
|
||||
<td>Wraps function to remove <code>None</code>-valued <code>kwargs</code>.</td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#axolotl.cli.utils.load_model_and_tokenizer">load_model_and_tokenizer</a></td>
|
||||
<td>Helper function for loading a model, tokenizer, and processor specified in the given <code>axolotl</code></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td><a href="#axolotl.cli.utils.strip_optional_type">strip_optional_type</a></td>
|
||||
<td>Extracts the non-<code>None</code> type from an <code>Optional</code> / <code>Union</code> type.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<section id="axolotl.cli.utils.add_options_from_config" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.cli.utils.add_options_from_config">add_options_from_config</h3>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>cli.utils.add_options_from_config(config_class)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
<p>Create Click options from the fields of a Pydantic model.</p>
|
||||
<section id="parameters" class="level4 doc-section doc-section-parameters">
|
||||
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters">Parameters</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 14%">
|
||||
<col style="width: 20%">
|
||||
<col style="width: 52%">
|
||||
<col style="width: 12%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>config_class</td>
|
||||
<td>Type[BaseModel]</td>
|
||||
<td>PyDantic model with fields to parse from the CLI</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section id="returns" class="level4 doc-section doc-section-returns">
|
||||
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns">Returns</h4>
|
||||
<table class="caption-top table">
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td></td>
|
||||
<td>Callable</td>
|
||||
<td>Function decorator for Axolotl CLI command.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</section>
|
||||
<section id="axolotl.cli.utils.add_options_from_dataclass" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.cli.utils.add_options_from_dataclass">add_options_from_dataclass</h3>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>cli.utils.add_options_from_dataclass(config_class)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
<p>Create Click options from the fields of a dataclass.</p>
|
||||
<section id="parameters-1" class="level4 doc-section doc-section-parameters">
|
||||
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-1">Parameters</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 16%">
|
||||
<col style="width: 15%">
|
||||
<col style="width: 54%">
|
||||
<col style="width: 14%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>config_class</td>
|
||||
<td>Type[Any]</td>
|
||||
<td>Dataclass with fields to parse from the CLI.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section id="returns-1" class="level4 doc-section doc-section-returns">
|
||||
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-1">Returns</h4>
|
||||
<table class="caption-top table">
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td></td>
|
||||
<td>Callable</td>
|
||||
<td>Function decorator for Axolotl CLI command.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</section>
|
||||
<section id="axolotl.cli.utils.build_command" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.cli.utils.build_command">build_command</h3>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>cli.utils.build_command(base_cmd, options)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
<p>Build command list from base command and options.</p>
|
||||
<section id="parameters-2" class="level4 doc-section doc-section-parameters">
|
||||
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-2">Parameters</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 11%">
|
||||
<col style="width: 20%">
|
||||
<col style="width: 53%">
|
||||
<col style="width: 13%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>base_cmd</td>
|
||||
<td>list[str]</td>
|
||||
<td>Command without options.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>options</td>
|
||||
<td>dict[str, Any]</td>
|
||||
<td>Options to parse and append to base command.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section id="returns-2" class="level4 doc-section doc-section-returns">
|
||||
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-2">Returns</h4>
|
||||
<table class="caption-top table">
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td></td>
|
||||
<td>list[str]</td>
|
||||
<td>List of strings giving shell command.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</section>
|
||||
<section id="axolotl.cli.utils.download_file" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.cli.utils.download_file">download_file</h3>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>cli.utils.download_file(file_info, raw_base_url, dest_path, dir_prefix)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
<p>Download a single file and return its processing status.</p>
|
||||
<section id="parameters-3" class="level4 doc-section doc-section-parameters">
|
||||
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-3">Parameters</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 20%">
|
||||
<col style="width: 11%">
|
||||
<col style="width: 50%">
|
||||
<col style="width: 17%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>file_info</td>
|
||||
<td>tuple</td>
|
||||
<td>Tuple of (file_path, remote_sha).</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>raw_base_url</td>
|
||||
<td>str</td>
|
||||
<td>Base URL for raw GitHub content.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>dest_path</td>
|
||||
<td>Path</td>
|
||||
<td>Local destination directory.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>dir_prefix</td>
|
||||
<td>str</td>
|
||||
<td>Directory prefix to filter files.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section id="returns-3" class="level4 doc-section doc-section-returns">
|
||||
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-3">Returns</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 7%">
|
||||
<col style="width: 17%">
|
||||
<col style="width: 74%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td></td>
|
||||
<td>tuple[str, str]</td>
|
||||
<td>Tuple of (file_path, status) where status is ‘new’, ‘updated’, or ‘unchanged’.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</section>
|
||||
<section id="axolotl.cli.utils.fetch_from_github" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.cli.utils.fetch_from_github">fetch_from_github</h3>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>cli.utils.fetch_from_github(dir_prefix, dest_dir<span class="op">=</span><span class="va">None</span>, max_workers<span class="op">=</span><span class="dv">5</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
<p>Sync files from a specific directory in the GitHub repository.
|
||||
Only downloads files that don’t exist locally or have changed.</p>
|
||||
<section id="parameters-4" class="level4 doc-section doc-section-parameters">
|
||||
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-4">Parameters</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 11%">
|
||||
<col style="width: 11%">
|
||||
<col style="width: 66%">
|
||||
<col style="width: 10%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>dir_prefix</td>
|
||||
<td>str</td>
|
||||
<td>Directory prefix to filter files (e.g., ‘examples/’, ‘deepspeed_configs/’).</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>dest_dir</td>
|
||||
<td>str | None</td>
|
||||
<td>Local destination directory.</td>
|
||||
<td><code>None</code></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td>max_workers</td>
|
||||
<td>int</td>
|
||||
<td>Maximum number of concurrent downloads.</td>
|
||||
<td><code>5</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</section>
|
||||
<section id="axolotl.cli.utils.filter_none_kwargs" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.cli.utils.filter_none_kwargs">filter_none_kwargs</h3>
|
||||
<div class="sourceCode" id="cb6"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a>cli.utils.filter_none_kwargs(func)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
<p>Wraps function to remove <code>None</code>-valued <code>kwargs</code>.</p>
|
||||
<section id="parameters-5" class="level4 doc-section doc-section-parameters">
|
||||
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-5">Parameters</h4>
|
||||
<table class="caption-top table">
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>func</td>
|
||||
<td>Callable</td>
|
||||
<td>Function to wrap.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section id="returns-4" class="level4 doc-section doc-section-returns">
|
||||
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-4">Returns</h4>
|
||||
<table class="caption-top table">
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td></td>
|
||||
<td>Callable</td>
|
||||
<td>Wrapped function.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</section>
|
||||
<section id="axolotl.cli.utils.load_model_and_tokenizer" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.cli.utils.load_model_and_tokenizer">load_model_and_tokenizer</h3>
|
||||
<div class="sourceCode" id="cb7"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>cli.utils.load_model_and_tokenizer(cfg, inference<span class="op">=</span><span class="va">False</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
<p>Helper function for loading a model, tokenizer, and processor specified in the given <code>axolotl</code>
|
||||
config.</p>
|
||||
<section id="parameters-6" class="level4 doc-section doc-section-parameters">
|
||||
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-6">Parameters</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 12%">
|
||||
<col style="width: 14%">
|
||||
<col style="width: 59%">
|
||||
<col style="width: 13%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>cfg</td>
|
||||
<td>DictDefault</td>
|
||||
<td>Dictionary mapping <code>axolotl</code> config keys to values.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
<tr class="even">
|
||||
<td>inference</td>
|
||||
<td>bool</td>
|
||||
<td>Boolean denoting inference mode.</td>
|
||||
<td><code>False</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section id="returns-5" class="level4 doc-section doc-section-returns">
|
||||
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-5">Returns</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 4%">
|
||||
<col style="width: 58%">
|
||||
<col style="width: 36%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td></td>
|
||||
<td>tuple[PreTrainedModel, PreTrainedTokenizer | PreTrainedTokenizerFast | Any, ProcessorMixin | None]</td>
|
||||
<td>Tuple of (PreTrainedModel, PreTrainedTokenizer, ProcessorMixin).</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</section>
|
||||
<section id="axolotl.cli.utils.strip_optional_type" class="level3">
|
||||
<h3 class="anchored" data-anchor-id="axolotl.cli.utils.strip_optional_type">strip_optional_type</h3>
|
||||
<div class="sourceCode" id="cb8"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>cli.utils.strip_optional_type(field_type)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
|
||||
<p>Extracts the non-<code>None</code> type from an <code>Optional</code> / <code>Union</code> type.</p>
|
||||
<section id="parameters-7" class="level4 doc-section doc-section-parameters">
|
||||
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-7">Parameters</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 14%">
|
||||
<col style="width: 24%">
|
||||
<col style="width: 47%">
|
||||
<col style="width: 14%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td>field_type</td>
|
||||
<td>type | str | None</td>
|
||||
<td>Type of field for Axolotl CLI command.</td>
|
||||
<td><em>required</em></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<section id="returns-6" class="level4 doc-section doc-section-returns">
|
||||
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-6">Returns</h4>
|
||||
<table class="caption-top table">
|
||||
<colgroup>
|
||||
<col style="width: 6%">
|
||||
<col style="width: 6%">
|
||||
<col style="width: 87%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>If the input type is <code>Union[T, None]</code> or <code>Optional[T]</code>, returns <code>T</code>. Otherwise returns the input type unchanged.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Init for axolotl.cli.utils module.</p>
|
||||
|
||||
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</main> <!-- /main -->
|
||||
|
||||
Reference in New Issue
Block a user