Buckets:

download
raw
60.4 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;env&quot;,&quot;local&quot;:&quot;env&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;env.apis&quot;,&quot;local&quot;:&quot;envapis&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env.LogLevel&quot;,&quot;local&quot;:&quot;envloglevel&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env.env : TransformersEnvironment&quot;,&quot;local&quot;:&quot;envenv--transformersenvironment&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_BROWSER_ENV&quot;,&quot;local&quot;:&quot;envisbrowserenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEBWORKER_ENV&quot;,&quot;local&quot;:&quot;enviswebworkerenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEB_ENV&quot;,&quot;local&quot;:&quot;enviswebenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_SERVICE_WORKER_ENV&quot;,&quot;local&quot;:&quot;envisserviceworkerenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_DENO_WEB_RUNTIME&quot;,&quot;local&quot;:&quot;envisdenowebruntime&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEB_CACHE_AVAILABLE&quot;,&quot;local&quot;:&quot;enviswebcacheavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEBGPU_AVAILABLE&quot;,&quot;local&quot;:&quot;enviswebgpuavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEBNN_AVAILABLE&quot;,&quot;local&quot;:&quot;enviswebnnavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_SAFARI&quot;,&quot;local&quot;:&quot;envissafari&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_PROCESS_AVAILABLE&quot;,&quot;local&quot;:&quot;envisprocessavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_NODE_ENV&quot;,&quot;local&quot;:&quot;envisnodeenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_FS_AVAILABLE&quot;,&quot;local&quot;:&quot;envisfsavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_PATH_AVAILABLE&quot;,&quot;local&quot;:&quot;envispathavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_CRYPTO_AVAILABLE&quot;,&quot;local&quot;:&quot;enviscryptoavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_CHROME_AVAILABLE&quot;,&quot;local&quot;:&quot;envischromeavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~DEBUG&quot;,&quot;local&quot;:&quot;envdebug&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~INFO&quot;,&quot;local&quot;:&quot;envinfo&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~WARNING&quot;,&quot;local&quot;:&quot;envwarning&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~ERROR&quot;,&quot;local&quot;:&quot;enverror&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~NONE&quot;,&quot;local&quot;:&quot;envnone&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~isSafari() ⇒ boolean&quot;,&quot;local&quot;:&quot;envissafari--boolean&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~TransformersEnvironment : Object&quot;,&quot;local&quot;:&quot;envtransformersenvironment--object&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/transformers.js/pr_1649/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/entry/start.5f753a22.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/scheduler.6efaaf90.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/singletons.c0807d75.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/paths.c5938264.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/entry/app.db3dfcb7.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/preload-helper.1d8e1e5d.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/index.eb3e1f0f.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/nodes/0.1b727385.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/nodes/4.3a63089e.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.16f13047.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/CodeBlock.72c8dd07.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;env&quot;,&quot;local&quot;:&quot;env&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;env.apis&quot;,&quot;local&quot;:&quot;envapis&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env.LogLevel&quot;,&quot;local&quot;:&quot;envloglevel&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env.env : TransformersEnvironment&quot;,&quot;local&quot;:&quot;envenv--transformersenvironment&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_BROWSER_ENV&quot;,&quot;local&quot;:&quot;envisbrowserenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEBWORKER_ENV&quot;,&quot;local&quot;:&quot;enviswebworkerenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEB_ENV&quot;,&quot;local&quot;:&quot;enviswebenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_SERVICE_WORKER_ENV&quot;,&quot;local&quot;:&quot;envisserviceworkerenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_DENO_WEB_RUNTIME&quot;,&quot;local&quot;:&quot;envisdenowebruntime&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEB_CACHE_AVAILABLE&quot;,&quot;local&quot;:&quot;enviswebcacheavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEBGPU_AVAILABLE&quot;,&quot;local&quot;:&quot;enviswebgpuavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_WEBNN_AVAILABLE&quot;,&quot;local&quot;:&quot;enviswebnnavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_SAFARI&quot;,&quot;local&quot;:&quot;envissafari&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_PROCESS_AVAILABLE&quot;,&quot;local&quot;:&quot;envisprocessavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_NODE_ENV&quot;,&quot;local&quot;:&quot;envisnodeenv&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_FS_AVAILABLE&quot;,&quot;local&quot;:&quot;envisfsavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_PATH_AVAILABLE&quot;,&quot;local&quot;:&quot;envispathavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_CRYPTO_AVAILABLE&quot;,&quot;local&quot;:&quot;enviscryptoavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~IS_CHROME_AVAILABLE&quot;,&quot;local&quot;:&quot;envischromeavailable&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~DEBUG&quot;,&quot;local&quot;:&quot;envdebug&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~INFO&quot;,&quot;local&quot;:&quot;envinfo&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~WARNING&quot;,&quot;local&quot;:&quot;envwarning&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~ERROR&quot;,&quot;local&quot;:&quot;enverror&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~NONE&quot;,&quot;local&quot;:&quot;envnone&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~isSafari() ⇒ boolean&quot;,&quot;local&quot;:&quot;envissafari--boolean&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;env~TransformersEnvironment : Object&quot;,&quot;local&quot;:&quot;envtransformersenvironment--object&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <a id="module_env" class="group"></a> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" 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></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="env" 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="#env"><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>env</span></h1> <p data-svelte-h="svelte-14jubvb">Module used to configure Transformers.js.</p> <p data-svelte-h="svelte-ooim1v"><strong>Example:</strong> Disable remote models.</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-keyword">import</span> { env } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@huggingface/transformers&#x27;</span>;
env.<span class="hljs-property">allowRemoteModels</span> = <span class="hljs-literal">false</span>;<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1rbhmcc"><strong>Example:</strong> Set local model path.</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-keyword">import</span> { env } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@huggingface/transformers&#x27;</span>;
env.<span class="hljs-property">localModelPath</span> = <span class="hljs-string">&#x27;/path/to/local/models/&#x27;</span>;<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-13xd89q"><strong>Example:</strong> Set cache directory.</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-keyword">import</span> { env } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@huggingface/transformers&#x27;</span>;
env.<span class="hljs-property">cacheDir</span> = <span class="hljs-string">&#x27;/path/to/cache/directory/&#x27;</span>;<!-- HTML_TAG_END --></pre></div> <ul data-svelte-h="svelte-1rsyw4l"><li><a href="#module_env">env</a> <ul><li><em>static</em> <ul><li><a href="#module_env.apis"><code>.apis</code></a></li> <li><a href="#module_env.LogLevel"><code>.LogLevel</code></a></li> <li><a href="#module_env.env"><code>.env</code></a> : <code>TransformersEnvironment</code></li></ul></li> <li><em>inner</em> <ul><li><a href="#module_env..IS_BROWSER_ENV"><code>~IS_BROWSER_ENV</code></a></li> <li><a href="#module_env..IS_WEBWORKER_ENV"><code>~IS_WEBWORKER_ENV</code></a></li> <li><a href="#module_env..IS_WEB_ENV"><code>~IS_WEB_ENV</code></a></li> <li><a href="#module_env..IS_SERVICE_WORKER_ENV"><code>~IS_SERVICE_WORKER_ENV</code></a></li> <li><a href="#module_env..IS_DENO_WEB_RUNTIME"><code>~IS_DENO_WEB_RUNTIME</code></a></li> <li><a href="#module_env..IS_WEB_CACHE_AVAILABLE"><code>~IS_WEB_CACHE_AVAILABLE</code></a></li> <li><a href="#module_env..IS_WEBGPU_AVAILABLE"><code>~IS_WEBGPU_AVAILABLE</code></a></li> <li><a href="#module_env..IS_WEBNN_AVAILABLE"><code>~IS_WEBNN_AVAILABLE</code></a></li> <li><a href="#module_env..IS_SAFARI"><code>~IS_SAFARI</code></a></li> <li><a href="#module_env..IS_PROCESS_AVAILABLE"><code>~IS_PROCESS_AVAILABLE</code></a></li> <li><a href="#module_env..IS_NODE_ENV"><code>~IS_NODE_ENV</code></a></li> <li><a href="#module_env..IS_FS_AVAILABLE"><code>~IS_FS_AVAILABLE</code></a></li> <li><a href="#module_env..IS_PATH_AVAILABLE"><code>~IS_PATH_AVAILABLE</code></a></li> <li><a href="#module_env..IS_CRYPTO_AVAILABLE"><code>~IS_CRYPTO_AVAILABLE</code></a></li> <li><a href="#module_env..IS_CHROME_AVAILABLE"><code>~IS_CHROME_AVAILABLE</code></a></li> <li><a href="#module_env..DEBUG"><code>~DEBUG</code></a></li> <li><a href="#module_env..INFO"><code>~INFO</code></a></li> <li><a href="#module_env..WARNING"><code>~WARNING</code></a></li> <li><a href="#module_env..ERROR"><code>~ERROR</code></a></li> <li><a href="#module_env..NONE"><code>~NONE</code></a></li> <li><a href="#module_env..isSafari"><code>~isSafari()</code></a><code>boolean</code></li> <li><a href="#module_env..TransformersEnvironment"><code>~TransformersEnvironment</code></a> : <code>Object</code></li></ul></li></ul></li></ul> <hr> <a id="module_env.apis" class="group"></a> <h2 class="relative group"><a id="envapis" 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="#envapis"><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>env.apis</span></h2> <p data-svelte-h="svelte-3i2dk3">A read-only object containing information about the APIs available in the current environment.</p> <p data-svelte-h="svelte-g17yg2"><strong>Kind</strong>: static constant of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env.LogLevel" class="group"></a> <h2 class="relative group"><a id="envloglevel" 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="#envloglevel"><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>env.LogLevel</span></h2> <p data-svelte-h="svelte-1x4tmzb">Log levels for controlling output verbosity.</p> <p data-svelte-h="svelte-ogck02">Each level is represented by a number, where higher numbers include all lower level messages.
Use these values to set <code>env.logLevel</code>.</p> <p data-svelte-h="svelte-1u46oyz"><strong>Kind</strong>: static constant of <a href="#module_env"><code>env</code></a><br> <strong>Example</strong></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-keyword">import</span> { env, <span class="hljs-title class_">LogLevel</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;@huggingface/transformers&#x27;</span>;
<span class="hljs-comment">// Set log level to show only errors</span>
env.<span class="hljs-property">logLevel</span> = <span class="hljs-title class_">LogLevel</span>.<span class="hljs-property">ERROR</span>;
<span class="hljs-comment">// Set log level to show errors, warnings, and info</span>
env.<span class="hljs-property">logLevel</span> = <span class="hljs-title class_">LogLevel</span>.<span class="hljs-property">INFO</span>;
<span class="hljs-comment">// Disable all logging</span>
env.<span class="hljs-property">logLevel</span> = <span class="hljs-title class_">LogLevel</span>.<span class="hljs-property">NONE</span>;<!-- HTML_TAG_END --></pre></div> <hr> <a id="module_env.env" class="group"></a> <h2 class="relative group"><a id="envenv--transformersenvironment" 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="#envenv--transformersenvironment"><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>env.env : TransformersEnvironment</span></h2> <p data-svelte-h="svelte-g17yg2"><strong>Kind</strong>: static constant of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_BROWSER_ENV" class="group"></a> <h2 class="relative group"><a id="envisbrowserenv" 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="#envisbrowserenv"><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>env~IS_BROWSER_ENV</span></h2> <p data-svelte-h="svelte-jh7q7z">Whether we are running in a browser environment (and not a web worker)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_WEBWORKER_ENV" class="group"></a> <h2 class="relative group"><a id="enviswebworkerenv" 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="#enviswebworkerenv"><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>env~IS_WEBWORKER_ENV</span></h2> <p data-svelte-h="svelte-1yxpxh">Whether we are running in a web worker environment</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_WEB_ENV" class="group"></a> <h2 class="relative group"><a id="enviswebenv" 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="#enviswebenv"><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>env~IS_WEB_ENV</span></h2> <p data-svelte-h="svelte-7dq7vr">Whether we are running in a web-like environment (browser, web worker, or Deno web runtime)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_SERVICE_WORKER_ENV" class="group"></a> <h2 class="relative group"><a id="envisserviceworkerenv" 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="#envisserviceworkerenv"><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>env~IS_SERVICE_WORKER_ENV</span></h2> <p data-svelte-h="svelte-148xwc">Whether we are running in a service worker environment</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_DENO_WEB_RUNTIME" class="group"></a> <h2 class="relative group"><a id="envisdenowebruntime" 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="#envisdenowebruntime"><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>env~IS_DENO_WEB_RUNTIME</span></h2> <p data-svelte-h="svelte-zm2sby">Whether we are running in Deno’s web runtime (CDN imports, Cache API available, no filesystem)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_WEB_CACHE_AVAILABLE" class="group"></a> <h2 class="relative group"><a id="enviswebcacheavailable" 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="#enviswebcacheavailable"><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>env~IS_WEB_CACHE_AVAILABLE</span></h2> <p data-svelte-h="svelte-10rfojt">Whether the Cache API is available</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_WEBGPU_AVAILABLE" class="group"></a> <h2 class="relative group"><a id="enviswebgpuavailable" 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="#enviswebgpuavailable"><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>env~IS_WEBGPU_AVAILABLE</span></h2> <p data-svelte-h="svelte-1rg36ch">Whether the WebGPU API is available</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_WEBNN_AVAILABLE" class="group"></a> <h2 class="relative group"><a id="enviswebnnavailable" 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="#enviswebnnavailable"><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>env~IS_WEBNN_AVAILABLE</span></h2> <p data-svelte-h="svelte-gsf7hp">Whether the WebNN API is available</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_SAFARI" class="group"></a> <h2 class="relative group"><a id="envissafari" 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="#envissafari"><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>env~IS_SAFARI</span></h2> <p data-svelte-h="svelte-1g37g2y">Whether we are running in a Safari browser</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_PROCESS_AVAILABLE" class="group"></a> <h2 class="relative group"><a id="envisprocessavailable" 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="#envisprocessavailable"><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>env~IS_PROCESS_AVAILABLE</span></h2> <p data-svelte-h="svelte-1bn7tmv">Whether the Node.js process API is available</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_NODE_ENV" class="group"></a> <h2 class="relative group"><a id="envisnodeenv" 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="#envisnodeenv"><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>env~IS_NODE_ENV</span></h2> <p data-svelte-h="svelte-1g4enls">Whether we are running in a Node.js-like environment (node, deno, bun)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_FS_AVAILABLE" class="group"></a> <h2 class="relative group"><a id="envisfsavailable" 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="#envisfsavailable"><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>env~IS_FS_AVAILABLE</span></h2> <p data-svelte-h="svelte-13lrs7s">Whether the filesystem API is available</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_PATH_AVAILABLE" class="group"></a> <h2 class="relative group"><a id="envispathavailable" 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="#envispathavailable"><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>env~IS_PATH_AVAILABLE</span></h2> <p data-svelte-h="svelte-1ncyrvw">Whether the path API is available</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_CRYPTO_AVAILABLE" class="group"></a> <h2 class="relative group"><a id="enviscryptoavailable" 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="#enviscryptoavailable"><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>env~IS_CRYPTO_AVAILABLE</span></h2> <p data-svelte-h="svelte-5il4i6">Whether the crypto API is available</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..IS_CHROME_AVAILABLE" class="group"></a> <h2 class="relative group"><a id="envischromeavailable" 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="#envischromeavailable"><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>env~IS_CHROME_AVAILABLE</span></h2> <p data-svelte-h="svelte-351fc3">Whether the Chrome runtime API is available</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..DEBUG" class="group"></a> <h2 class="relative group"><a id="envdebug" 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="#envdebug"><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>env~DEBUG</span></h2> <p data-svelte-h="svelte-8e1r8n">All messages including debug output (value: 10)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..INFO" class="group"></a> <h2 class="relative group"><a id="envinfo" 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="#envinfo"><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>env~INFO</span></h2> <p data-svelte-h="svelte-38bm0r">Errors, warnings, and info messages (value: 20)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..WARNING" class="group"></a> <h2 class="relative group"><a id="envwarning" 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="#envwarning"><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>env~WARNING</span></h2> <p data-svelte-h="svelte-11eowv0">Errors and warnings (value: 30)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..ERROR" class="group"></a> <h2 class="relative group"><a id="enverror" 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="#enverror"><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>env~ERROR</span></h2> <p data-svelte-h="svelte-19ddln6">Only error messages (value: 40)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..NONE" class="group"></a> <h2 class="relative group"><a id="envnone" 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="#envnone"><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>env~NONE</span></h2> <p data-svelte-h="svelte-1t3ebi6">No logging output (value: 50)</p> <p data-svelte-h="svelte-136zjuj"><strong>Kind</strong>: inner property of <a href="#module_env"><code>env</code></a></p> <hr> <a id="module_env..isSafari" class="group"></a> <h2 class="relative group"><a id="envissafari--boolean" 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="#envissafari--boolean"><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>env~isSafari() ⇒ boolean</span></h2> <p data-svelte-h="svelte-1dmxl1j">Check if the current environment is Safari browser.
Works in both browser and web worker contexts.</p> <p data-svelte-h="svelte-fgedwb"><strong>Kind</strong>: inner method of <a href="#module_env"><code>env</code></a><br> <strong>Returns</strong>: <code>boolean</code> - Whether the current environment is Safari.</p> <hr> <a id="module_env..TransformersEnvironment" class="group"></a> <h2 class="relative group"><a id="envtransformersenvironment--object" 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="#envtransformersenvironment--object"><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>env~TransformersEnvironment : Object</span></h2> <p data-svelte-h="svelte-1ijjkph">Global variable given visible to users to control execution. This provides users a simple way to configure Transformers.js.</p> <p data-svelte-h="svelte-1k5edin"><strong>Kind</strong>: inner typedef of <a href="#module_env"><code>env</code></a><br> <strong>Properties</strong></p> <table data-svelte-h="svelte-1h58n5l"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>version</td><td><code>string</code></td><td><p>This version of Transformers.js.</p></td> </tr><tr><td>backends</td><td><code>Object</code></td><td><p>Expose environment variables of different backends,
allowing users to set these variables if they want to.</p></td> </tr><tr><td>logLevel</td><td><code>number</code></td><td><p>The logging level. Use LogLevel enum values. Defaults to LogLevel.ERROR.</p></td> </tr><tr><td>allowRemoteModels</td><td><code>boolean</code></td><td><p>Whether to allow loading of remote files, defaults to <code>true</code>.
If set to <code>false</code>, it will have the same effect as setting <code>local_files_only=true</code> when loading pipelines, models, tokenizers, processors, etc.</p></td> </tr><tr><td>remoteHost</td><td><code>string</code></td><td><p>Host URL to load models from. Defaults to the Hugging Face Hub.</p></td> </tr><tr><td>remotePathTemplate</td><td><code>string</code></td><td><p>Path template to fill in and append to <code>remoteHost</code> when loading models.</p></td> </tr><tr><td>allowLocalModels</td><td><code>boolean</code></td><td><p>Whether to allow loading of local files, defaults to <code>false</code> if running in-browser, and <code>true</code> otherwise.
If set to <code>false</code>, it will skip the local file check and try to load the model from the remote host.</p></td> </tr><tr><td>localModelPath</td><td><code>string</code></td><td><p>Path to load local models from. Defaults to <code>/models/</code>.</p></td> </tr><tr><td>useFS</td><td><code>boolean</code></td><td><p>Whether to use the file system to load files. By default, it is <code>true</code> if available.</p></td> </tr><tr><td>useBrowserCache</td><td><code>boolean</code></td><td><p>Whether to use Cache API to cache models. By default, it is <code>true</code> if available.</p></td> </tr><tr><td>useFSCache</td><td><code>boolean</code></td><td><p>Whether to use the file system to cache files. By default, it is <code>true</code> if available.</p></td> </tr><tr><td>cacheDir</td><td><code>string</code> | <code>null</code></td><td><p>The directory to use for caching files with the file system. By default, it is <code>./.cache</code>.</p></td> </tr><tr><td>useCustomCache</td><td><code>boolean</code></td><td><p>Whether to use a custom cache system (defined by <code>customCache</code>), defaults to <code>false</code>.</p></td> </tr><tr><td>customCache</td><td><code><a href="#CacheInterface">CacheInterface</a></code> | <code>null</code></td><td><p>The custom cache to use. Defaults to <code>null</code>. Note: this must be an object which
implements the <code>match</code> and <code>put</code> functions of the Web Cache API. For more information, see <a href="https://developer.mozilla.org/en-US/docs/Web/API/Cache">https://developer.mozilla.org/en-US/docs/Web/API/Cache</a>.</p></td> </tr><tr><td>useWasmCache</td><td><code>boolean</code></td><td><p>Whether to pre-load and cache WASM binaries and the WASM factory (.mjs) for ONNX Runtime.
Defaults to <code>true</code> when cache is available. This can improve performance and enables offline usage by avoiding repeated downloads.</p></td> </tr><tr><td>cacheKey</td><td><code>string</code></td><td><p>The cache key to use for storing models and WASM binaries. Defaults to &#39;transformers-cache&#39;.</p></td> </tr><tr><td>experimental_useCrossOriginStorage</td><td><code>boolean</code></td><td><p>Whether to use the Cross-Origin Storage API to cache model files
across origins, allowing different sites to share the same cached model weights. Defaults to <code>false</code>.
Requires the Cross-Origin Storage Chrome extension: <a href="https://chromewebstore.google.com/detail/cross-origin-storage/denpnpcgjgikjpoglpjefakmdcbmlgih">https://chromewebstore.google.com/detail/cross-origin-storage/denpnpcgjgikjpoglpjefakmdcbmlgih</a>.
The <code>experimental_</code> prefix indicates that the underlying browser API is not yet standardised and may change or be
removed without a major version bump. For more information, see <a href="https://github.com/WICG/cross-origin-storage">https://github.com/WICG/cross-origin-storage</a>.</p></td> </tr><tr><td>fetch</td><td><code>function</code></td><td><p>The fetch function to use. Defaults to <code>fetch</code>.</p></td></tr></tbody></table> <hr> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/transformers.js/blob/main/packages/transformers/docs/source/api/env.md" target="_blank"><svg class="mr-1" 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="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_rvrl7f = {
assets: "/docs/transformers.js/pr_1649/en",
base: "/docs/transformers.js/pr_1649/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/transformers.js/pr_1649/en/_app/immutable/entry/start.5f753a22.js"),
import("/docs/transformers.js/pr_1649/en/_app/immutable/entry/app.db3dfcb7.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 4],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
60.4 kB
·
Xet hash:
d3c4e906121f6f963cc20d2e1f87591ecba3adc3e033159e759d552e172b5042

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