Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"env","local":"env","sections":[{"title":"env.apis","local":"envapis","sections":[],"depth":2},{"title":"env.env : <code> TransformersEnvironment </code>","local":"envenv--code-transformersenvironment-code","sections":[],"depth":2},{"title":"env~IS_BROWSER_ENV","local":"envisbrowserenv","sections":[],"depth":2},{"title":"env~IS_WEBWORKER_ENV","local":"enviswebworkerenv","sections":[],"depth":2},{"title":"env~IS_WEB_CACHE_AVAILABLE","local":"enviswebcacheavailable","sections":[],"depth":2},{"title":"env~IS_WEBGPU_AVAILABLE","local":"enviswebgpuavailable","sections":[],"depth":2},{"title":"env~IS_WEBNN_AVAILABLE","local":"enviswebnnavailable","sections":[],"depth":2},{"title":"env~IS_PROCESS_AVAILABLE","local":"envisprocessavailable","sections":[],"depth":2},{"title":"env~IS_NODE_ENV","local":"envisnodeenv","sections":[],"depth":2},{"title":"env~IS_FS_AVAILABLE","local":"envisfsavailable","sections":[],"depth":2},{"title":"env~IS_PATH_AVAILABLE","local":"envispathavailable","sections":[],"depth":2},{"title":"env~TransformersEnvironment : <code> Object </code>","local":"envtransformersenvironment--code-object-code","sections":[],"depth":2}],"depth":1}"> | |
| <link href="/docs/transformers.js/pr_1113/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/entry/start.88a6e140.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/chunks/scheduler.0219f8bd.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/chunks/singletons.c59c6d8d.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/chunks/paths.8e090985.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/entry/app.0003020d.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/chunks/index.f61edf3b.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/nodes/0.25c65ab2.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/nodes/4.f85dc8b4.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/chunks/CodeBlock.38e566ae.js"> | |
| <link rel="modulepreload" href="/docs/transformers.js/pr_1113/en/_app/immutable/chunks/EditOnGithub.48fa589f.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{"title":"env","local":"env","sections":[{"title":"env.apis","local":"envapis","sections":[],"depth":2},{"title":"env.env : <code> TransformersEnvironment </code>","local":"envenv--code-transformersenvironment-code","sections":[],"depth":2},{"title":"env~IS_BROWSER_ENV","local":"envisbrowserenv","sections":[],"depth":2},{"title":"env~IS_WEBWORKER_ENV","local":"enviswebworkerenv","sections":[],"depth":2},{"title":"env~IS_WEB_CACHE_AVAILABLE","local":"enviswebcacheavailable","sections":[],"depth":2},{"title":"env~IS_WEBGPU_AVAILABLE","local":"enviswebgpuavailable","sections":[],"depth":2},{"title":"env~IS_WEBNN_AVAILABLE","local":"enviswebnnavailable","sections":[],"depth":2},{"title":"env~IS_PROCESS_AVAILABLE","local":"envisprocessavailable","sections":[],"depth":2},{"title":"env~IS_NODE_ENV","local":"envisnodeenv","sections":[],"depth":2},{"title":"env~IS_FS_AVAILABLE","local":"envisfsavailable","sections":[],"depth":2},{"title":"env~IS_PATH_AVAILABLE","local":"envispathavailable","sections":[],"depth":2},{"title":"env~TransformersEnvironment : <code> Object </code>","local":"envtransformersenvironment--code-object-code","sections":[],"depth":2}],"depth":1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <a id="module_env" class="group"></a> <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">'@huggingface/transformers'</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">'@huggingface/transformers'</span>; | |
| env.<span class="hljs-property">localModelPath</span> = <span class="hljs-string">'/path/to/local/models/'</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">'@huggingface/transformers'</span>; | |
| env.<span class="hljs-property">cacheDir</span> = <span class="hljs-string">'/path/to/cache/directory/'</span>;<!-- HTML_TAG_END --></pre></div> <ul data-svelte-h="svelte-tgfd0f"><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.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_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_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..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.env" class="group"></a> <h2 class="relative group"><a id="envenv--code-transformersenvironment-code" 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--code-transformersenvironment-code"><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 : <code> TransformersEnvironment </code></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_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_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-4r0hfy">Whether we are running in a Node.js 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_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..TransformersEnvironment" class="group"></a> <h2 class="relative group"><a id="envtransformersenvironment--code-object-code" 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--code-object-code"><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 : <code> Object </code></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-1tq63gg"><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>*</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>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></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>Object</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></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/docs/source/api/env.md" target="_blank"><span data-svelte-h="svelte-1kd6by1"><</span> <span data-svelte-h="svelte-x0xyl0">></span> <span data-svelte-h="svelte-1dajgef"><span class="underline ml-1.5">Update</span> on GitHub</span></a> <p></p> | |
| <script> | |
| { | |
| __sveltekit_kuyevp = { | |
| assets: "/docs/transformers.js/pr_1113/en", | |
| base: "/docs/transformers.js/pr_1113/en", | |
| env: {} | |
| }; | |
| const element = document.currentScript.parentElement; | |
| const data = [null,null]; | |
| Promise.all([ | |
| import("/docs/transformers.js/pr_1113/en/_app/immutable/entry/start.88a6e140.js"), | |
| import("/docs/transformers.js/pr_1113/en/_app/immutable/entry/app.0003020d.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 4], | |
| data, | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 32.3 kB
- Xet hash:
- b39cf561b0cf0e4b35e235772084a79ceb6035c9f8c86cf11c8cc426cb1d1eb1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.