1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([["15277"],{93336(e,s,l){l.r(s),l.d(s,{metadata:()=>o,default:()=>p,frontMatter:()=>i,contentTitle:()=>n,toc:()=>d,assets:()=>t});var o=JSON.parse('{"id":"whisper-webgpu/clear-stale-models","title":"clearStaleModels()","description":"Removes cached model files that are no longer returned by getAvailableModels(). There are no stale models in the current version, so this function resolves without changing the cache.","source":"@site/docs/whisper-webgpu/clear-stale-models.mdx","sourceDirName":"whisper-webgpu","slug":"/whisper-webgpu/clear-stale-models","permalink":"/docs/whisper-webgpu/clear-stale-models","draft":false,"unlisted":false,"editUrl":"https://github.com/remotion-dev/remotion/edit/main/packages/docs/docs/whisper-webgpu/clear-stale-models.mdx","tags":[],"version":"current","lastUpdatedAt":1790778889000,"frontMatter":{"image":"/generated/articles-docs-whisper-webgpu-clear-stale-models.png","title":"clearStaleModels()","crumb":"@remotion/whisper-webgpu"},"sidebar":"apiSidebar","previous":{"title":"getAvailableModels()","permalink":"/docs/whisper-webgpu/get-available-models"},"next":{"title":"isWhisperModelCached()","permalink":"/docs/whisper-webgpu/is-whisper-model-cached"}}'),r=l(57825),a=l(29721);let i={image:"/generated/articles-docs-whisper-webgpu-clear-stale-models.png",title:"clearStaleModels()",crumb:"@remotion/whisper-webgpu"},n="clearStaleModels()",t={},d=[{value:"Return type",id:"return-type",level:2},{value:"Compatibility",id:"compatibility",level:2},{value:"See also",id:"see-also",level:2}];function c(e){let s={a:"a",code:"code",div:"div",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",ul:"ul",...(0,a.R)(),...e.components}
1,{AvailableFrom:l,CompatibilityTable:o,RawMarkdownCarrier:i}=s;return l||h("AvailableFrom",!0),o||h("CompatibilityTable",!0),i||h("RawMarkdownCarrier",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i,{raw:'---\nimage: /generated/articles-docs-whisper-webgpu-clear-stale-models.png\ntitle: clearStaleModels()\ncrumb: \'@remotion/whisper-webgpu\'\n---\n\n# clearStaleModels()<AvailableFrom v="4.0.518" />\n\nRemoves cached model files that are no longer returned by [`getAvailableModels()`](/docs/whisper-webgpu/get-available-models). There are no stale models in the current version, so this function resolves without changing the cache.\n\nCall this function when the page loads to remove models discontinued by a newer version of `@remotion/whisper-webgpu`.\n\nThis also removes model files downloaded from Hugging Face by versions before 4.0.522. Current models downloaded from `remotion.media` and models used by other Transformers.js workflows are preserved.\n\n```ts twoslash title="clear-stale-models.ts"\nimport {clearStaleModels} from \'@remotion/whisper-webgpu\';\n\nawait clearStaleModels();\n```\n\n## Return type\n\nA `Promise<void>` that resolves after stale models have been removed.\n\n## Compatibility\n\n<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering={false} serverSideRendering player studio hideServers />\n\n## See also\n\n- [`getAvailableModels()`](/docs/whisper-webgpu/get-available-models)\n- [`isWhisperModelCached()`](/docs/whisper-webgpu/is-whisper-model-cached)\n'}),"\n",(0,r.jsx)(s.header,{children:(0,r.jsxs)(s.h1,{id:"clearstalemodels",children:["clearStaleModels()",(0,r.jsx)(l,{v:"4.0.518"})]})}),"\n",(0,r.jsxs)(s.p,{children:["Removes cached model files that are no longer returned by ",(0,r.jsx)(s.a,{href:"/docs/whisper-webgpu/get-available-models",children:(0,r.jsx)(s.code,{children:"getAvailableModels()"})}),". There are no stale models in the current version, so this function resolves without changing the cache."]}),"\n",(0,r.jsxs)(s.p,{children:["Call this function when the page loads to remove models discontinued by a newer version of ",(0,r.jsx)(s.code,{children:"@remotion/whisper-webgpu"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:["This also removes model files downloaded from Hugging Face by versions before 4.0.522. Current models downloaded from ",(0,r.jsx)(s.code,{children:"remotion.media"})," and models used by other Transformers.js workflows are preserved."]}),"\n",(0,r.jsx)(s.div,{dangerouslySetInnerHTML:{__html:'<pre class="shiki with-title github-dark twoslash lsp" style="background-color:#24292e;color:#e1e4e8" tabindex="0"><div class="code-title">clear-stale-models.ts</div><code><span class="line"><span style="color:#F97583">import</span><span style="color:#E1E4E8"> {</span><span style="color:#E1E4E8"><data-lsp lsp="(alias) const clearStaleModels: () => Promise<void>\nimport clearStaleModels">clearStaleModels</data-lsp></span><span style="color:#E1E4E8">} </span><span style="color:#F97583">from</span><span style="color:#9ECBFF"> \'@remotion/whisper-webgpu\'</span><span style="color:#E1E4E8">;</span></span>\n<span class="line"></span>\n<span class="line"><span style="color:#F97583">await</span><span style="color:#B392F0"> </span><span style="color:#B392F0"><data-lsp lsp="(alias) clearStaleModels(): Promise<void>\nimport clearStaleModels">clearStaleModels</data-lsp></span><span style="color:#E1E4E8">();</span></span></code><button class="copy-button" aria-label="Copy code to clipboard">Copy</button></pre>'}}),"\n",(0,r.jsx)(s.h2,{id:"return-type",children:"Return type"}),"\n",(0,r.jsxs)(s.p,{children:["A ",(0,r.jsx)(s.code,{children:"Promise<void>"})," that resolves after stale models have been removed."]}),"\n",(0,r.jsx)(s.h2,{id:"compatibility",children:"Compatibility"}),"\n",(0,r.jsx)(o,{chrome:!0,firefox:!0,safari:!0,nodejs:"",bun:"",serverlessFunctions:"",clientSideRendering:!1,serverSideRendering:!0,player:!0,studio:!0,hideServers:!0}),"\n",(0,r.jsx)(s.h2,{id:"see-also",children:"See also"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsx)(s.li,{children:(0,r.jsx)(s.a,{href:"/docs/whisper-webgpu/get-available-models",children:(0,r.jsx)(s.code,{children:"getAvailableModels()"})})}),"\n",(0,r.jsx)(s.li,{children:(0,r.jsx)(s.a,{href:"/docs/whisper-webgpu/is-whisper-model-cached",children:(0,r.jsx)(s.code,{children:"isWhisperModelCached()"})})}),"\n"]})]})}function p(e={}){let{wrapper:s}={...(0,a.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}function h(e,s){throw Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.