Add dist files with progress bar support
Browse files- .gitignore +0 -3
- dist/assets/index-B9t0_3v7.css +1 -0
- dist/assets/index-BBJjCKoR.js +0 -0
- dist/assets/worker-DcvJnSbR.js +1 -0
- source/dist/assets/hub-BlMT648A.js +1 -0
- source/dist/assets/index-4ud1a0so.css +1 -0
- source/dist/assets/index-D32DZD7n.js +0 -0
- source/dist/assets/models-Dq2DCePq.js +1 -0
- source/dist/assets/onnxruntime-l0sNRNKZ.js +1 -0
- source/dist/assets/ort-wasm-simd-threaded.jsep-6MnTkKum.wasm +3 -0
- source/dist/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm +3 -0
- source/dist/assets/ort.bundle.min-LxnbbrqV.js +0 -0
- source/dist/assets/parakeet-l0sNRNKZ.js +1 -0
- source/dist/assets/parakeet-xcg-VHSn.js +1 -0
- source/dist/assets/worker-D2CeqmVH.js +1 -0
- source/dist/index.html +15 -0
.gitignore
CHANGED
|
@@ -1,9 +1,6 @@
|
|
| 1 |
# Dependencies
|
| 2 |
node_modules/
|
| 3 |
|
| 4 |
-
# Build outputs - keep dist/ but it's now reorganized
|
| 5 |
-
dist/
|
| 6 |
-
|
| 7 |
# Public folder (Vite default)
|
| 8 |
public/
|
| 9 |
|
|
|
|
| 1 |
# Dependencies
|
| 2 |
node_modules/
|
| 3 |
|
|
|
|
|
|
|
|
|
|
| 4 |
# Public folder (Vite default)
|
| 5 |
public/
|
| 6 |
|
dist/assets/index-B9t0_3v7.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-4{margin-left:1rem}.mt-1{margin-top:.25rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-full{height:100%}.max-h-\[400px\]{max-height:400px}.min-h-\[200px\]{min-height:200px}.min-h-screen{min-height:100vh}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-full{width:100%}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-cyan-400{--tw-border-opacity: 1;border-color:rgb(34 211 238 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-red-700{--tw-border-opacity: 1;border-color:rgb(185 28 28 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.bg-cyan-400{--tw-bg-opacity: 1;background-color:rgb(34 211 238 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-gray-950\/50{background-color:#0a0a0a80}.bg-green-900\/30{background-color:#14532d4d}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-cyan-400{--tw-gradient-from: #22d3ee var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 211 238 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-950{--tw-gradient-from: #0a0a0a var(--tw-gradient-from-position);--tw-gradient-to: rgb(10 10 10 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-yellow-500{--tw-gradient-to: rgb(234 179 8 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #eab308 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-gray-900{--tw-gradient-to: #111827 var(--tw-gradient-to-position)}.to-indigo-500{--tw-gradient-to: #6366f1 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-red-500{--tw-gradient-to: #ef4444 var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-4{padding-bottom:1rem}.pt-4{padding-top:1rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wider{letter-spacing:.05em}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-75{transition-duration:75ms}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:dark;color:#ffffffde;background-color:#0a0a0a;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{margin:0;min-width:320px;min-height:100vh}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#1a1a1a}::-webkit-scrollbar-thumb{background:#444;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#555}.hover\:bg-red-900\/50:hover{background-color:#7f1d1d80}.hover\:from-cyan-600:hover{--tw-gradient-from: #0891b2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(8 145 178 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-green-600:hover{--tw-gradient-from: #16a34a var(--tw-gradient-from-position);--tw-gradient-to: rgb(22 163 74 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-purple-600:hover{--tw-gradient-from: #9333ea var(--tw-gradient-from-position);--tw-gradient-to: rgb(147 51 234 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-red-600:hover{--tw-gradient-from: #dc2626 var(--tw-gradient-from-position);--tw-gradient-to: rgb(220 38 38 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-blue-600:hover{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.hover\:to-emerald-600:hover{--tw-gradient-to: #059669 var(--tw-gradient-to-position)}.hover\:to-indigo-600:hover{--tw-gradient-to: #4f46e5 var(--tw-gradient-to-position)}.hover\:to-pink-600:hover{--tw-gradient-to: #db2777 var(--tw-gradient-to-position)}.hover\:text-cyan-300:hover{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media(min-width:768px){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
|
dist/assets/index-BBJjCKoR.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/worker-DcvJnSbR.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
async function u(t,a={}){const{getParakeetModel:e}=await import("./hub-BlMT648A.js"),{ParakeetModel:s}=await import("./parakeet-xcg-VHSn.js"),{MODELS:n}=await import("./models-Dq2DCePq.js"),r=n[t]?.repoId||t,o=await e(r,a);return s.fromUrls({...o.urls,filenames:o.filenames,preprocessorBackend:o.preprocessorBackend,...a})}let i=null,c=!1;async function m(t="parakeet-tdt-0.6b-v3",a={}){if(c)return{status:"loading",message:"Model is already loading..."};if(i)return{status:"ready",message:"Model already loaded"};try{c=!0;const e=a.device==="webgpu"?"webgpu-hybrid":"wasm";self.postMessage({status:"loading",message:`Downloading Parakeet ${t}... (~2.1GB, this may take 1-2 minutes)`}),console.log(`[Worker] Loading model with backend: ${e}`),i=await u(t,{backend:e,...e==="wasm"?{encoderQuant:"int8",decoderQuant:"int8",preprocessor:"nemo128"}:{encoderQuant:"fp32",decoderQuant:"int8",preprocessor:"nemo128"}});const n=i.session?.executionProviders?.[0]||e;console.log(`[Worker] Model loaded. Requested: ${e}, Actual provider: ${n}`),self.postMessage({status:"loading",message:"Model downloaded, warming up..."});const r=new Float32Array(16e3);return await i.transcribe(r,16e3),self.postMessage({status:"ready",message:`Parakeet ${t} loaded successfully!`,device:e,modelVersion:t}),{status:"ready",device:e}}catch(e){return console.error("Failed to load model:",e),self.postMessage({status:"error",message:`Failed to load model: ${e.message}`,error:e.toString()}),{status:"error",error:e.toString()}}finally{c=!1}}async function g(t,a=null){if(!i)throw new Error("Model not loaded. Call load() first.");try{const e=performance.now(),s=await i.transcribe(t,16e3,{returnTimestamps:!0,returnConfidences:!0,temperature:1}),r=(performance.now()-e)/1e3,o=t.length/16e3,l=o/r,d=p(s.words||[]);return{text:s.utterance_text||"",sentences:d,words:s.words||[],chunks:s.words||[],metadata:{latency:r,audioDuration:o,rtf:l,language:a,confidence:s.confidence_scores,metrics:s.metrics}}}catch(e){throw console.error("Transcription error:",e),e}}function p(t){if(!t||t.length===0)return[];const a=[];let e=[],s=t[0].start_time||0;for(let n=0;n<t.length;n++){const r=t[n];e.push(r.text),(/[.!?]$/.test(r.text)||n===t.length-1)&&(a.push({text:e.join(" ").trim(),start:s,end:r.end_time||r.start_time||0}),n<t.length-1&&(e=[],s=t[n+1].start_time||r.end_time||0))}return a}self.onmessage=async t=>{const{type:a,data:e}=t.data;try{switch(a){case"load":await m(e?.modelVersion,e?.options||{});break;case"transcribe":const s=await g(e.audio,e.language);self.postMessage({status:"transcription",result:s});break;case"ping":self.postMessage({status:"pong"});break;default:self.postMessage({status:"error",message:`Unknown message type: ${a}`})}}catch(s){self.postMessage({status:"error",message:s.message,error:s.toString()})}};
|
source/dist/assets/hub-BlMT648A.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{getModelConfig as P}from"./models-Dq2DCePq.js";const H="parakeet-cache-db",h="file-store";let B=null;const $=new Map;async function E(t,e="main"){const o=`${t}@${e}`;if($.has(o))return $.get(o);const r=`https://huggingface.co/api/models/${t}?revision=${e}`;try{const n=await fetch(r);if(!n.ok)throw new Error(`Failed to list repo files: ${n.status}`);const c=(await n.json()).siblings?.map(s=>s.rfilename)||[];return $.set(o,c),c}catch(n){return console.warn("[Hub] Could not fetch repo file list – falling back to optimistic fetch",n),$.set(o,[]),[]}}function U(){return B||(B=new Promise((t,e)=>{const o=indexedDB.open(H,1);o.onerror=()=>e("Error opening IndexedDB"),o.onsuccess=()=>t(o.result),o.onupgradeneeded=r=>{const n=r.target.result;n.objectStoreNames.contains(h)||n.createObjectStore(h)}})),B}async function S(t){const e=await U();return new Promise((o,r)=>{const c=e.transaction([h],"readonly").objectStore(h).get(t);c.onerror=()=>r("Error reading from DB"),c.onsuccess=()=>o(c.result)})}async function N(t,e){const o=await U();return new Promise((r,n)=>{const s=o.transaction([h],"readwrite").objectStore(h).put(e,t);s.onerror=()=>n("Error writing to DB"),s.onsuccess=()=>r(s.result)})}async function R(t,e,o={}){const{revision:r="main",subfolder:n="",progress:d}=o,c="https://huggingface.co",s=[t,"resolve",r];n&&s.push(n),s.push(e);const b=`${c}/${s.join("/")}`,w=`hf-${t}-${r}-${n}-${e}`;if(typeof indexedDB<"u")try{const a=await S(w);if(a)return console.log(`[Hub] Using cached ${e} from IndexedDB`),URL.createObjectURL(a)}catch(a){console.warn("[Hub] IndexedDB cache check failed:",a)}console.log(`[Hub] Downloading ${e} from ${t}...`);const i=await fetch(b);if(!i.ok)throw new Error(`Failed to download ${e}: ${i.status} ${i.statusText}`);const l=i.headers.get("content-length"),g=l?parseInt(l):0;let m=0;const y=i.body.getReader(),u=[];for(;;){const{done:a,value:p}=await y.read();if(a)break;u.push(p),m+=p.length,d&&g>0&&d({loaded:m,total:g,file:e})}const f=new Blob(u,{type:i.headers.get("content-type")||"application/octet-stream"});if(typeof indexedDB<"u")try{await N(w,f),console.log(`[Hub] Cached ${e} in IndexedDB`)}catch(a){console.warn("[Hub] Failed to cache in IndexedDB:",a)}return URL.createObjectURL(f)}async function C(t,e={}){const o=P(t),r=o?.repoId||t,n=o?.preprocessor||"nemo128",{encoderQuant:d="int8",decoderQuant:c="int8",preprocessor:s=n,preprocessorBackend:b="js",backend:w="webgpu",progress:i}=e;let l=d,g=c;w.startsWith("webgpu")&&l==="int8"&&(console.warn("[Hub] Forcing encoder to fp32 on WebGPU (int8 unsupported)"),l="fp32");const m=l==="int8"?".int8.onnx":".onnx",y=g==="int8"?".int8.onnx":".onnx",u=`encoder-model${m}`,f=`decoder_joint-model${y}`,a=await E(r,e.revision||"main"),p=[{key:"encoderUrl",name:u},{key:"decoderUrl",name:f},{key:"tokenizerUrl",name:"vocab.txt"}];b!=="js"?(p.push({key:"preprocessorUrl",name:`${s}.onnx`}),console.log(`[Hub] Preprocessor: ONNX — will download ${s}.onnx`)):console.log(`[Hub] Preprocessor: JS (mel.js) — skipping ${s}.onnx download`),a.includes(`${u}.data`)&&p.push({key:"encoderDataUrl",name:`${u}.data`}),a.includes(`${f}.data`)&&p.push({key:"decoderDataUrl",name:`${f}.data`});const x={urls:{},filenames:{encoder:u,decoder:f},quantisation:{encoder:l,decoder:g},modelConfig:o||null,preprocessorBackend:b};for(const{key:k,name:D}of p)try{const j=i?F=>i({...F,file:D}):void 0;x.urls[k]=await R(r,D,{...e,progress:j})}catch(j){if(k.endsWith("DataUrl"))console.warn(`[Hub] Optional external data file not found: ${D}. This is expected if the model is small.`),x.urls[k]=null;else throw j}return x}export{R as getModelFile,C as getParakeetModel};
|
source/dist/assets/index-4ud1a0so.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-2{height:.5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-full{height:100%}.max-h-\[400px\]{max-height:400px}.min-h-\[200px\]{min-height:200px}.min-h-screen{min-height:100vh}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-full{width:100%}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-cyan-400{--tw-border-opacity: 1;border-color:rgb(34 211 238 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-green-700{--tw-border-opacity: 1;border-color:rgb(21 128 61 / var(--tw-border-opacity, 1))}.border-red-700{--tw-border-opacity: 1;border-color:rgb(185 28 28 / var(--tw-border-opacity, 1))}.border-t-transparent{border-top-color:transparent}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-cyan-400{--tw-bg-opacity: 1;background-color:rgb(34 211 238 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-800\/50{background-color:#1f293780}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-gray-950\/50{background-color:#0a0a0a80}.bg-green-900\/30{background-color:#14532d4d}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-cyan-400{--tw-gradient-from: #22d3ee var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 211 238 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-cyan-500{--tw-gradient-from: #06b6d4 var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 182 212 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-gray-950{--tw-gradient-from: #0a0a0a var(--tw-gradient-from-position);--tw-gradient-to: rgb(10 10 10 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position);--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position);--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-yellow-500{--tw-gradient-to: rgb(234 179 8 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #eab308 var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position)}.to-emerald-500{--tw-gradient-to: #10b981 var(--tw-gradient-to-position)}.to-gray-900{--tw-gradient-to: #111827 var(--tw-gradient-to-position)}.to-indigo-500{--tw-gradient-to: #6366f1 var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position)}.to-red-500{--tw-gradient-to: #ef4444 var(--tw-gradient-to-position)}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-4{padding-bottom:1rem}.pt-4{padding-top:1rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wider{letter-spacing:.05em}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-75{transition-duration:75ms}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:dark;color:#ffffffde;background-color:#0a0a0a;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{margin:0;min-width:320px;min-height:100vh}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#1a1a1a}::-webkit-scrollbar-thumb{background:#444;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#555}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-red-900\/50:hover{background-color:#7f1d1d80}.hover\:from-cyan-600:hover{--tw-gradient-from: #0891b2 var(--tw-gradient-from-position);--tw-gradient-to: rgb(8 145 178 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-green-600:hover{--tw-gradient-from: #16a34a var(--tw-gradient-from-position);--tw-gradient-to: rgb(22 163 74 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-purple-600:hover{--tw-gradient-from: #9333ea var(--tw-gradient-from-position);--tw-gradient-to: rgb(147 51 234 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:from-red-600:hover{--tw-gradient-from: #dc2626 var(--tw-gradient-from-position);--tw-gradient-to: rgb(220 38 38 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\:to-blue-600:hover{--tw-gradient-to: #2563eb var(--tw-gradient-to-position)}.hover\:to-emerald-600:hover{--tw-gradient-to: #059669 var(--tw-gradient-to-position)}.hover\:to-indigo-600:hover{--tw-gradient-to: #4f46e5 var(--tw-gradient-to-position)}.hover\:to-pink-600:hover{--tw-gradient-to: #db2777 var(--tw-gradient-to-position)}.hover\:text-cyan-300:hover{--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.hover\:shadow-xl:hover{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media(min-width:768px){.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
|
source/dist/assets/index-D32DZD7n.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
source/dist/assets/models-Dq2DCePq.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
const a={"parakeet-tdt-0.6b-v2":{repoId:"ysdede/parakeet-tdt-0.6b-v2-onnx",displayName:"Parakeet TDT 0.6B v2 (English)",languages:["en"],defaultLanguage:"en",vocabSize:1025,featuresSize:128,preprocessor:"nemo128",subsampling:8,predHidden:640,predLayers:2},"parakeet-tdt-0.6b-v3":{repoId:"istupakov/parakeet-tdt-0.6b-v3-onnx",displayName:"Parakeet TDT 0.6B v3 (Multilingual)",languages:["en","fr","de","es","it","pt","nl","pl","ru","uk","ja","ko","zh"],defaultLanguage:"en",vocabSize:4097,featuresSize:128,preprocessor:"nemo128",subsampling:8,predHidden:640,predLayers:2}};function t(e){if(a[e])return a[e];for(const[r,n]of Object.entries(a))if(n.repoId===e)return n;return null}export{a as MODELS,t as getModelConfig};
|
source/dist/assets/onnxruntime-l0sNRNKZ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
|
source/dist/assets/ort-wasm-simd-threaded.jsep-6MnTkKum.wasm
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5febcf74919ee7ba3c7e838290c9ef2c03d6da297f06a8facfd7d22f623d7cd9
|
| 3 |
+
size 24911187
|
source/dist/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c46655e8a94afc45338d4cb2b840475f88e5012d524509916e505079c00bfa39
|
| 3 |
+
size 21596019
|
source/dist/assets/ort.bundle.min-LxnbbrqV.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
source/dist/assets/parakeet-l0sNRNKZ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
|
source/dist/assets/parakeet-xcg-VHSn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
async function Ne({backend:f="webgpu",wasmPaths:e,numThreads:s}={}){let t;try{const n=await import("./ort.bundle.min-LxnbbrqV.js");t=n.default||n,console.log("[Parakeet.js] ORT structure:",{hasDefault:!!n.default,hasEnv:!!t.env,hasWasm:!!t.env?.wasm,hasWebgpu:!!t.env?.webgpu,keys:Object.keys(t).slice(0,10)}),t.env||(console.log("[Parakeet.js] Trying alternative access patterns..."),console.log("[Parakeet.js] ortModule keys:",Object.keys(n)),n.ort&&(t=n.ort,console.log("[Parakeet.js] Found ort in ortModule.ort")))}catch(n){throw console.error("[Parakeet.js] Failed to import onnxruntime-web:",n),new Error("Failed to load ONNX Runtime Web. Please check your network connection.")}if(!t||!t.env)throw new Error("ONNX Runtime Web loaded but env is not available. This might be a bundling issue.");if(!t.env.wasm.wasmPaths){const n="1.22.0-dev.20250409-89f8206ba4";t.env.wasm.wasmPaths=`https://cdn.jsdelivr.net/npm/onnxruntime-web@${n}/dist/`}if((f==="wasm"||f==="webgpu")&&(typeof SharedArrayBuffer<"u"?(t.env.wasm.numThreads=s||navigator.hardwareConcurrency||4,t.env.wasm.simd=!0,console.log(`[Parakeet.js] WASM configured with ${t.env.wasm.numThreads} threads, SIMD enabled`)):(console.warn("[Parakeet.js] SharedArrayBuffer not available - using single-threaded WASM"),t.env.wasm.numThreads=1),t.env.wasm.proxy=!1),f==="webgpu"){const n="gpu"in navigator;if(console.log(`[Parakeet.js] WebGPU supported: ${n}`),n)try{console.log("[Parakeet.js] WebGPU will be initialized automatically when creating session")}catch(r){console.warn("[Parakeet.js] WebGPU initialization failed:",r),console.warn("[Parakeet.js] Falling back to WASM"),f="wasm"}else console.warn("[Parakeet.js] WebGPU not supported – falling back to WASM"),f="wasm"}return typeof globalThis<"u"&&(globalThis.ort=t),typeof self<"u"&&(self.ort=t),t}async function Ue(f){const e=await fetch(f);if(!e.ok)throw new Error(`Failed to fetch ${f}: ${e.status}`);return e.text()}class Se{constructor(e){this.id2token=e,this.blankToken="<blk>",this.blankId=e.findIndex(s=>s==="<blk>"),this.blankId===-1&&(console.warn("[ParakeetTokenizer] Blank token <blk> not found in vocabulary, defaulting to 1024"),this.blankId=1024)}static async fromUrl(e){const t=(await Ue(e)).split(/\r?\n/).filter(Boolean),n=[];for(const r of t){const[c,i]=r.split(/\s+/),a=parseInt(i,10);n[a]=c}return new Se(n)}decode(e){const s=[];for(const n of e){const r=this.id2token[n];r!==void 0&&r!==this.blankToken&&s.push(r.replace(/\u2581/g," "))}let t=s.join("");return t=t.replace(/^\s+/,""),t=t.replace(/\s+(?=[^\w\s])/g,""),t=t.replace(/\s+/g," "),t.trim()}}class Ge{constructor(e,s={}){this.modelUrl=e,this.opts=s,this.opts.enableGraphCapture===void 0&&(this.opts.enableGraphCapture=this.opts.backend==="wasm"),this.session=null,this.ort=null}async _ensureSession(){if(!this.session){this.ort=await Ne(this.opts);const e=this.opts.enableGraphCapture?{enableProfiling:this.opts.enableProfiling||!1,enableGraphCapture:!0}:{enableProfiling:this.opts.enableProfiling||!1},s=async()=>{try{return await this.ort.InferenceSession.create(this.modelUrl,e)}catch(t){const n=(t.message||"")+"";if(e.enableGraphCapture&&n.includes("graph capture"))return console.warn("[Preprocessor] Graph capture unsupported, retrying without it"),await this.ort.InferenceSession.create(this.modelUrl,{...e,enableGraphCapture:!1});throw t}};this.session=await s()}}async process(e){await this._ensureSession();let s;e instanceof Float32Array?s=e.byteOffset===0||e.byteLength===e.length*4?e:new Float32Array(e):s=new Float32Array(e);const t=new this.ort.Tensor("float32",s,[1,s.length]),n=new BigInt64Array([BigInt(s.length)]),r=new this.ort.Tensor("int64",n,[1]),c={waveforms:t,waveforms_lens:r},i=await this.session.run(c),a=i.features,l=i.features_lens;return{features:a.data,length:Number(l.data[0])}}}const Xe=16e3,O=512,xe=400,ee=160,Ce=.97,je=2**-24,B=(O>>1)+1,ye=200/3,me=1e3,Pe=me/ye,Be=Math.log(6.4)/27;function Oe(f){return f>=me?Pe+Math.log(f/me)/Be:f/ye}function He(f){return f>=Pe?me*Math.exp(Be*(f-Pe)):f*ye}function Ve(f){const s=Xe/2,t=new Float64Array(B);for(let o=0;o<B;o++)t[o]=s*o/(B-1);const n=Oe(0),r=Oe(s),c=f+2,i=new Float64Array(c);for(let o=0;o<c;o++)i[o]=He(n+(r-n)*o/(c-1));const a=new Float64Array(c-1);for(let o=0;o<c-1;o++)a[o]=i[o+1]-i[o];const l=new Float32Array(f*B);for(let o=0;o<f;o++){const m=2/(i[o+2]-i[o]),k=o*B;for(let d=0;d<B;d++){const u=(t[d]-i[o])/a[o],x=(i[o+2]-t[d])/a[o+1];l[k+d]=Math.max(0,Math.min(u,x))*m}}return l}function Je(){const f=new Float64Array(O),e=O-xe>>1;for(let s=0;s<xe;s++)f[e+s]=.5*(1-Math.cos(2*Math.PI*s/(xe-1)));return f}function qe(f){const e=f>>1,s=new Float64Array(e),t=new Float64Array(e);for(let n=0;n<e;n++){const r=-2*Math.PI*n/f;s[n]=Math.cos(r),t[n]=Math.sin(r)}return{cos:s,sin:t}}function Le(f,e,s,t){let n=0;for(let r=0;r<s-1;r++){if(r<n){let i=f[r];f[r]=f[n],f[n]=i,i=e[r],e[r]=e[n],e[n]=i}let c=s>>1;for(;c<=n;)n-=c,c>>=1;n+=c}for(let r=2;r<=s;r<<=1){const c=r>>1,i=s/r;for(let a=0;a<s;a+=r)for(let l=0;l<c;l++){const o=l*i,m=t.cos[o],k=t.sin[o],d=a+l,u=d+c,x=f[u]*m-e[u]*k,A=f[u]*k+e[u]*m;f[u]=f[d]-x,e[u]=e[d]-A,f[d]+=x,e[d]+=A}}}class oe{constructor(e={}){this.nMels=e.nMels||128,this.melFilterbank=Ve(this.nMels),this.hannWindow=Je(),this.twiddles=qe(O),this._fftRe=new Float64Array(O),this._fftIm=new Float64Array(O),this._powerBuf=new Float32Array(B)}process(e){const s=e.length;if(s===0)return{features:new Float32Array(0),length:0};const t=new Float32Array(s);t[0]=e[0];for(let p=1;p<s;p++)t[p]=e[p]-Ce*e[p-1];const n=O>>1,r=s+2*n,c=new Float64Array(r);for(let p=0;p<s;p++)c[n+p]=t[p];const i=Math.floor((r-O)/ee)+1,a=Math.floor(s/ee);if(a===0)return{features:new Float32Array(0),length:0};const l=new Float32Array(this.nMels*i),o=this._fftRe,m=this._fftIm,k=this._powerBuf,d=this.hannWindow,u=this.melFilterbank,x=this.nMels,A=this.twiddles;for(let p=0;p<i;p++){const _=p*ee;for(let w=0;w<O;w++)o[w]=c[_+w]*d[w],m[w]=0;Le(o,m,O,A);for(let w=0;w<B;w++)k[w]=o[w]*o[w]+m[w]*m[w];for(let w=0;w<x;w++){let S=0;const T=w*B;for(let P=0;P<B;P++)S+=k[P]*u[T+P];l[w*i+p]=Math.log(S+je)}}const F=new Float32Array(x*a);for(let p=0;p<x;p++){const _=p*i,w=p*a;let S=0;for(let b=0;b<a;b++)S+=l[_+b];const T=S/a;let P=0;for(let b=0;b<a;b++){const v=l[_+b]-T;P+=v*v}const z=a>1?1/(Math.sqrt(P/(a-1))+1e-5):0;for(let b=0;b<a;b++)F[w+b]=(l[_+b]-T)*z}return{features:F,length:a}}computeRawMel(e){const s=e.length;if(s===0)return{rawMel:new Float32Array(0),nFrames:0,featuresLen:0};const t=new Float32Array(s);t[0]=e[0];for(let F=1;F<s;F++)t[F]=e[F]-Ce*e[F-1];const n=O>>1,r=s+2*n,c=new Float64Array(r);for(let F=0;F<s;F++)c[n+F]=t[F];const i=Math.floor((r-O)/ee)+1,a=Math.floor(s/ee);if(a===0)return{rawMel:new Float32Array(0),nFrames:0,featuresLen:0};const l=new Float32Array(this.nMels*i),o=this._fftRe,m=this._fftIm,k=this._powerBuf,d=this.hannWindow,u=this.melFilterbank,x=this.nMels,A=this.twiddles;for(let F=0;F<i;F++){const p=F*ee;for(let _=0;_<O;_++)o[_]=c[p+_]*d[_],m[_]=0;Le(o,m,O,A);for(let _=0;_<B;_++)k[_]=o[_]*o[_]+m[_]*m[_];for(let _=0;_<x;_++){let w=0;const S=_*B;for(let T=0;T<B;T++)w+=k[T]*u[S+T];l[_*i+F]=Math.log(w+je)}}return{rawMel:l,nFrames:i,featuresLen:a}}normalizeFeatures(e,s,t){const n=this.nMels,r=new Float32Array(n*t);for(let c=0;c<n;c++){const i=c*s,a=c*t;let l=0;for(let d=0;d<t;d++)l+=e[i+d];const o=l/t;let m=0;for(let d=0;d<t;d++){const u=e[i+d]-o;m+=u*u}const k=t>1?1/(Math.sqrt(m/(t-1))+1e-5):0;for(let d=0;d<t;d++)r[a+d]=(e[i+d]-o)*k}return r}}class $e{constructor(e={}){this.preprocessor=new oe({nMels:e.nMels||128}),this.nMels=this.preprocessor.nMels,this.boundaryFrames=e.boundaryFrames||3,this._cachedRawMel=null,this._cachedNFrames=0,this._cachedAudioLen=0,this._cachedFeaturesLen=0}reset(){this._cachedRawMel=null,this._cachedNFrames=0,this._cachedAudioLen=0,this._cachedFeaturesLen=0}process(e,s=0){const t=e.length;if(t===0)return{features:new Float32Array(0),length:0,cached:!1,cachedFrames:0,newFrames:0};if(!(s>0&&this._cachedRawMel!==null&&s<=this._cachedAudioLen)){const m=this.preprocessor.process(e),{rawMel:k,nFrames:d,featuresLen:u}=this.preprocessor.computeRawMel(e);return this._cachedRawMel=k,this._cachedNFrames=d,this._cachedAudioLen=t,this._cachedFeaturesLen=u,{...m,cached:!1,cachedFrames:0,newFrames:u}}const r=Math.floor(s/ee),c=Math.max(0,Math.min(r-this.boundaryFrames,this._cachedFeaturesLen)),{rawMel:i,nFrames:a,featuresLen:l}=this.preprocessor.computeRawMel(e);if(c>0&&this._cachedRawMel)for(let m=0;m<this.nMels;m++){const k=m*this._cachedNFrames,d=m*a;for(let u=0;u<c;u++)i[d+u]=this._cachedRawMel[k+u]}const o=this.preprocessor.normalizeFeatures(i,a,l);return this._cachedRawMel=i,this._cachedNFrames=a,this._cachedAudioLen=t,this._cachedFeaturesLen=l,{features:o,length:l,cached:!0,cachedFrames:c,newFrames:l-c}}clear(){this._cachedRawMel=null,this._cachedNFrames=0,this._cachedAudioLen=0,this._cachedFeaturesLen=0}}class Re{constructor({tokenizer:e,encoderSession:s,joinerSession:t,preprocessor:n,ort:r,subsampling:c=8,windowStride:i=.01,normalizer:a=m=>m,onnxPreprocessor:l=null,nMels:o}){this.tokenizer=e,this.encoderSession=s,this.joinerSession=t,this.preprocessor=n,this.ort=r,this._onnxPreprocessor=l,this._jsPreprocessor=n instanceof oe?n:null,this._incrementalMel=n instanceof oe?new $e({nMels:n.nMels}):null,this.blankId=e.blankId,this.predHidden=640,this.predLayers=2,this.maxTokensPerStep=10;const m=this.predLayers,k=this.predHidden,d=m*1*k,u=new Float32Array(d);this._combState1=new r.Tensor("float32",u,[m,1,k]),this._combState2=new r.Tensor("float32",u.slice(),[m,1,k]),this._normalizer=a,this.subsampling=c,this.windowStride=i,this._nMels=o||128,this._targetIdArray=new Int32Array(1),this._targetTensor=new r.Tensor("int32",this._targetIdArray,[1,1]),this._targetLenArray=new Int32Array([1]),this._targetLenTensor=new r.Tensor("int32",this._targetLenArray,[1]),this._encoderFrameBuffer=null,this._encoderFrameTensor=null,this._incrementalCache=new Map}static async fromUrls(e){const{encoderUrl:s,decoderUrl:t,tokenizerUrl:n,preprocessorUrl:r,encoderDataUrl:c,decoderDataUrl:i,filenames:a,backend:l="webgpu-hybrid",wasmPaths:o,subsampling:m=8,windowStride:k=.01,verbose:d=!1,enableProfiling:u=!1,enableGraphCapture:x,cpuThreads:A=void 0,preprocessorBackend:F="js",nMels:p}=e,_=F==="js";if(console.log(`[Parakeet.js] Preprocessor backend requested: '${F}' → ${_?"JS (mel.js)":"ONNX"}`),!s||!t||!n||!r&&!_)throw new Error('fromUrls requires encoderUrl, decoderUrl, tokenizerUrl and preprocessorUrl (preprocessorUrl not needed if preprocessorBackend="js")');let w=l;l.startsWith("webgpu")&&(w="webgpu");const S=await Ne({backend:w,wasmPaths:o,numThreads:A}),P={executionProviders:[],graphOptimizationLevel:"all",executionMode:"parallel",enableCpuMemArena:!0,enableMemPattern:!0,enableProfiling:u,enableGraphCapture:!!x&&l==="webgpu-strict",logSeverityLevel:d?0:2};l==="webgpu-hybrid"?P.executionProviders=[{name:"webgpu",deviceType:"gpu",powerPreference:"high-performance"},"wasm"]:l==="webgpu-strict"?P.executionProviders=[{name:"webgpu",deviceType:"gpu",powerPreference:"high-performance"}]:l==="wasm"&&(P.executionProviders=["wasm"]),console.log(`[Parakeet.js] Creating ONNX sessions with execution mode '${l}'. Providers:`,P.executionProviders),d&&console.log("[Parakeet.js] Verbose logging enabled for ONNX Runtime.");const z={...P};c&&a?.encoder&&(z.externalData=[{data:c,path:a.encoder+".data"}]);const b={...P};i&&a?.decoder&&(b.externalData=[{data:i,path:a.decoder+".data"}]),l.startsWith("webgpu")&&(b.executionProviders=["wasm"]);async function v(D,W){try{return await S.InferenceSession.create(D,W)}catch(ie){const ce=(ie.message||"")+"";if(W.enableGraphCapture&&ce.includes("graph capture")){console.warn("[Parakeet] Graph-capture unsupported for this model/backend; retrying without it");const Z={...W,enableGraphCapture:!1};return await S.InferenceSession.create(D,Z)}throw ie}}const H=Se.fromUrl(n),I=p||128,te=new oe({nMels:I});let V=null;!_&&r?(V=new Ge(r,{backend:"wasm",wasmPaths:o,enableProfiling:u,enableGraphCapture:!1,numThreads:A}),console.log(`[Parakeet.js] ONNX preprocessor session created (${I} mel bins)`)):!_&&!r&&console.warn("[Parakeet.js] ONNX preprocessor requested but no URL provided — falling back to JS");const U=_?te:V||te,pe=Promise.resolve(U);console.log(`[Parakeet.js] Active preprocessor: ${(U===te?"js":"onnx")==="js"?"JS (mel.js) — no ONNX preprocessor needed":"ONNX (nemo128.onnx)"}, ${I} mel bins`);let ae,L;l==="webgpu-hybrid"?(ae=await v(s,z),L=await v(t,b)):[ae,L]=await Promise.all([v(s,z),v(t,b)]);const[C,R]=await Promise.all([H,pe]);try{const D=new Float32Array(1600);await R.process(D),d&&console.log("[Parakeet.js] Preprocessor warmed up")}catch(D){console.warn("[Parakeet.js] Preprocessor warm-up failed (non-fatal):",D.message)}return new Re({tokenizer:C,encoderSession:ae,joinerSession:L,preprocessor:R,ort:S,subsampling:m,windowStride:k,onnxPreprocessor:V!==R?V:null,nMels:I})}async _runCombinedStep(e,s,t=null){const n=typeof s=="number"?s:this.blankId;this._targetIdArray[0]=n;const r=t?.state1||this._combState1,c=t?.state2||this._combState2,i={encoder_outputs:e,targets:this._targetTensor,target_length:this._targetLenTensor,input_states_1:r,input_states_2:c},a=await this.joinerSession.run(i),l=a.outputs,o=this.tokenizer.id2token.length,m=l.dims[3],k=l.data,d=k.slice(0,o),u=k.slice(o,m);let x=0;if(u.length){let F=-1/0;for(let p=0;p<u.length;++p)u[p]>F&&(F=u[p],x=p)}const A={state1:a.output_states_1||r,state2:a.output_states_2||c};return{tokenLogits:d,step:x,newState:A}}_snapshotDecoderState(e){if(!e)return null;const s=e.state1,t=e.state2;return{s1:new Float32Array(s.data),s2:new Float32Array(t.data),dims1:s.dims.slice(),dims2:t.dims.slice()}}_restoreDecoderState(e){if(!e)return null;const s=new this.ort.Tensor("float32",new Float32Array(e.s1),e.dims1),t=new this.ort.Tensor("float32",new Float32Array(e.s2),e.dims2);return{state1:s,state2:t}}async computeFeatures(e,s=16e3,t={}){const{prefixSamples:n=0}=t;if(this._incrementalMel&&n>0){const a=this._incrementalMel.process(e,n),l=a.length;return{features:a.features,T:l,melBins:this._nMels,cached:a.cached,cachedFrames:a.cachedFrames,newFrames:a.newFrames}}const{features:r,length:c}=await this.preprocessor.process(e),i=r.length/this._nMels;return{features:r,T:i,melBins:this._nMels,validLength:c}}setPreprocessorBackend(e){if(e==="onnx"){if(!this._onnxPreprocessor)throw new Error("ONNX preprocessor not available. Load model with preprocessorUrl to enable ONNX backend.");this.preprocessor=this._onnxPreprocessor,this._incrementalMel=null,console.log("[Parakeet.js] Switched to ONNX preprocessor")}else if(e==="js")this._jsPreprocessor||(this._jsPreprocessor=new oe({nMels:128})),this.preprocessor=this._jsPreprocessor,this._incrementalMel=new $e({nMels:this._jsPreprocessor.nMels}),console.log("[Parakeet.js] Switched to JS preprocessor (incremental caching enabled)");else throw new Error(`Unknown preprocessor backend: ${e}. Use 'js' or 'onnx'.`)}getPreprocessorBackend(){return this.preprocessor instanceof oe?"js":"onnx"}resetMelCache(){this._incrementalMel&&this._incrementalMel.reset()}getFrameTimeStride(){return this.subsampling*this.windowStride}frameToTime(e,s=0){return s+e*this.getFrameTimeStride()}getStreamingConstants(){return{subsampling:this.subsampling,windowStride:this.windowStride,frameTimeStride:this.getFrameTimeStride(),melBins:80,blankId:this.blankId,maxTokensPerStep:this.maxTokensPerStep}}async transcribe(e,s=16e3,t={}){const{returnTimestamps:n=!1,returnConfidences:r=!1,temperature:c=1,debug:i=!1,skipCMVN:a=!1,frameStride:l=1,previousDecoderState:o=null,returnDecoderState:m=!1,timeOffset:k=0,returnTokenIds:d=!1,returnFrameIndices:u=!1,returnLogProbs:x=!1,returnTdtSteps:A=!1,prefixSamples:F=0,precomputedFeatures:p=null}=t,_=!0;let w,S=0,T=0,P=0,z=0;w=performance.now();let b,v,H,I,te,V=p?"mel-worker":this.getPreprocessorBackend();if(p)b=p.features,v=p.T,H=p.melBins,I={},console.log(`[Parakeet] Preprocessor: mel-worker (precomputed ${v} frames × ${H} mel bins, 0 ms)`);else{const h=performance.now();({features:b,T:v,melBins:H,validLength:te,...I}=await this.computeFeatures(e,s,{prefixSamples:F})),S=performance.now()-h;const g=I?.cached?` (cached: ${I.cachedFrames} frames, new: ${I.newFrames} frames)`:"";console.log(`[Parakeet] Preprocessor: ${V}, ${v} frames × ${H} mel bins, ${S.toFixed(1)} ms${g}`)}if(!b||!b.length||v<=0||H<=0)return{utterance_text:"",words:[],tokens:[],confidence_scores:{overall_log_prob:null,frame:null,frame_avg:null},metrics:_?{preprocess_ms:+S.toFixed(1),encode_ms:0,decode_ms:0,tokenize_ms:0,total_ms:+(performance.now()-w).toFixed(1),rtf:0}:null,is_final:!t?.incremental};const U=e?e.length/s:v*160/s,pe=new this.ort.Tensor("float32",b,[1,H,v]),Me=te??v,ae=new this.ort.Tensor("int64",BigInt64Array.from([BigInt(Me)]),[1]);let L;{const h=performance.now(),g=await this.encoderSession.run({audio_signal:pe,length:ae});T=performance.now()-h,L=g.outputs??Object.values(g)[0]}const[,C,R]=L.dims;let D;if(L.dims.length===3&&L.dims[0]===1&&L.dims[1]===C&&L.dims[2]===R){D=new Float32Array(R*C);const h=L.data,g=Math.min(64,C);for(let M=0;M<C;M+=g){const $=Math.min(M+g,C);for(let j=0;j<R;j++){const X=j*C;for(let N=M;N<$;N++)D[X+N]=h[N*R+j]}}}else console.warn("[Parakeet] Unexpected encoder output format:",L.dims),D=new Float32Array(L.data);(!this._encoderFrameBuffer||this._encoderFrameBuffer.length!==C)&&(this._encoderFrameBuffer=new Float32Array(C),this._encoderFrameTensor=new this.ort.Tensor("float32",this._encoderFrameBuffer,[1,C,1]));const W=[],ie=[],ce=[],Z=[];let Te=0;const we=[],_e=[],ge=[],de=this.subsampling*this.windowStride;let ke=0,Fe=k,Q=null;o&&(Q=this._restoreDecoderState(o),i&&console.log("[Parakeet] Restored decoder state from previous chunk"));let G=0;const J=t.incremental;if(J&&J.cacheKey){G=Math.max(0,Math.min(R,Math.floor(((J.prefixSeconds||0)+1e-6)/de)));const h=this._incrementalCache.get(J.cacheKey);h&&h.prefixFrames===G&&h.D===C&&(ke=G,Fe=k+G*de,Q=this._restoreDecoderState(h.state),i&&console.log(`[Parakeet] Incremental cache hit: skipping ${G}/${R} frames (${(G/R*100).toFixed(0)}%)`))}let he=0;const We=performance.now();let ve=ke>0||G===0;for(let h=ke;h<R;){const g=h*C;for(let y=0;y<C;y++)this._encoderFrameBuffer[y]=D[g+y];const M=W.length?W[W.length-1]:this.blankId,{tokenLogits:$,step:j,newState:X}=await this._runCombinedStep(this._encoderFrameTensor,M,Q);let N=-1/0,E=0;for(let y=0;y<$.length;y++){const K=$[y]/c;K>N&&(N=K,E=y)}let re=1,ue=0;if(r||x){let y=0;for(let K=0;K<$.length;K++)y+=Math.exp($[K]/c-N);re=1/y,ue=$[E]/c-N-Math.log(y),r&&(Z.push(re),Te+=Math.log(re))}if(E!==this.blankId){if(Q=X,W.push(E),u&&we.push(h),x&&_e.push(ue),A&&ge.push(j),n){const y=j>0?j:1,K=Fe+h*de,Ee=Fe+(h+y)*de;ie.push([K,Ee])}r&&ce.push(re),he+=1}if(j>0?(h+=j,he=0):(E===this.blankId||he>=this.maxTokensPerStep)&&(h+=l,he=0),J&&J.cacheKey&&!ve&&h>=G){const y=this._snapshotDecoderState(Q);this._incrementalCache.set(J.cacheKey,{state:y,prefixFrames:G,D:C}),ve=!0}}P=performance.now()-We;let Ie;Ie=performance.now();const Ae=this._normalizer(this.tokenizer.decode(W));if(z=performance.now()-Ie,!n&&!r){{const M=performance.now()-w,$=U/(M/1e3);console.log(`[Perf] RTF: ${$.toFixed(2)}x (audio ${U.toFixed(2)} s, time ${(M/1e3).toFixed(2)} s)`),console.table({Preprocess:`${S.toFixed(1)} ms`,Encode:`${T.toFixed(1)} ms`,Decode:`${P.toFixed(1)} ms`,Tokenize:`${z.toFixed(1)} ms`,Total:`${M.toFixed(1)} ms`})}const h=_?{preprocess_ms:+S.toFixed(1),encode_ms:+T.toFixed(1),decode_ms:+P.toFixed(1),tokenize_ms:+z.toFixed(1),total_ms:+(performance.now()-w).toFixed(1),rtf:+(U/((performance.now()-w)/1e3)).toFixed(2),preprocessor_backend:V,mel_cache:I?.cached?{cached_frames:I.cachedFrames,new_frames:I.newFrames}:null}:null,g={utterance_text:Ae,words:[],metrics:h,is_final:!o};return m&&(g.decoderState=this._snapshotDecoderState(Q)),d&&(g.tokenIds=W.slice()),u&&(g.frameIndices=we.slice()),x&&(g.logProbs=_e.slice()),A&&(g.tdtSteps=ge.slice()),g}const Y=[],le=[];let se="",be=0,fe=0,q=[];if(W.forEach((h,g)=>{const M=this.tokenizer.id2token[h];if(M===this.tokenizer.blankToken)return;const $=M.startsWith("▁"),j=$?M.slice(1):M,X=ie[g]||[null,null],N=ce[g],E={token:j,raw_token:M,is_word_start:$};if(n&&(E.start_time=+X[0].toFixed(3),E.end_time=+X[1].toFixed(3)),r&&(E.confidence=+N.toFixed(4)),le.push(E),$){if(se){const re=q.length?q.reduce((ue,y)=>ue+y,0)/q.length:0;Y.push({text:se,start_time:+be.toFixed(3),end_time:+fe.toFixed(3),confidence:+re.toFixed(4)})}se=j,n&&(be=X[0],fe=X[1]),q=r?[N]:[]}else se+=j,n&&(fe=X[1]),r&&q.push(N)}),se){const h=q.length?q.reduce((g,M)=>g+M,0)/q.length:0;Y.push({text:se,start_time:+be.toFixed(3),end_time:+fe.toFixed(3),confidence:+h.toFixed(4)})}const ze=Y.length&&r?Y.reduce((h,g)=>h+g.confidence,0)/Y.length:null,De=le.length&&r?le.reduce((h,g)=>h+(g.confidence||0),0)/le.length:null;{const h=performance.now()-w,g=U/(h/1e3);console.log(`[Perf] RTF: ${g.toFixed(2)}x (audio ${U.toFixed(2)} s, time ${(h/1e3).toFixed(2)} s)`),console.table({Preprocess:`${S.toFixed(1)} ms`,Encode:`${T.toFixed(1)} ms`,Decode:`${P.toFixed(1)} ms`,Tokenize:`${z.toFixed(1)} ms`,Total:`${h.toFixed(1)} ms`})}const ne={utterance_text:Ae,words:Y,tokens:le,confidence_scores:r?{token:ce.map(h=>+h.toFixed(4)),token_avg:+De?.toFixed(4),word:Y.map(h=>h.confidence),word_avg:+ze?.toFixed(4),frame:Z.map(h=>+h.toFixed(4)),frame_avg:Z.length?+(Z.reduce((h,g)=>h+g,0)/Z.length).toFixed(4):null,overall_log_prob:+Te.toFixed(6)}:{overall_log_prob:null,frame:null,frame_avg:null},metrics:_?{preprocess_ms:+S.toFixed(1),encode_ms:+T.toFixed(1),decode_ms:+P.toFixed(1),tokenize_ms:+z.toFixed(1),total_ms:+(performance.now()-w).toFixed(1),rtf:+(U/((performance.now()-w)/1e3)).toFixed(2),preprocessor_backend:V,mel_cache:I?.cached?{cached_frames:I.cachedFrames,new_frames:I.newFrames}:null}:null,is_final:!J&&!o};return m&&(ne.decoderState=this._snapshotDecoderState(Q)),d&&(ne.tokenIds=W.slice()),u&&(ne.frameIndices=we.slice()),x&&(ne.logProbs=_e.map(h=>+h.toFixed(6))),A&&(ne.tdtSteps=ge.slice()),ne}createStreamingTranscriber(e={}){return new Ke(this,e)}endProfiling(){try{this.encoderSession?.endProfiling()}catch{}try{this.joinerSession?.endProfiling()}catch{}const e=this.ort?.env?.wasm?.FS;if(!e)return console.warn("[Parakeet] Profiling FS not accessible"),null;const s=e.readdir("/tmp").filter(n=>n.startsWith("profile_")&&n.endsWith(".json"));if(!s.length)return console.warn("[Parakeet] No profiling files found. Was profiling enabled?"),null;const t={};for(const n of s)try{const r=e.readFile("/tmp/"+n,{encoding:"utf8"}),c=JSON.parse(r);let i=0,a=0;for(const l of c)if(l.cat==="Node"){const o=l.args?.provider;o==="webgpu"?i+=l.dur:o&&(a+=l.dur)}t[n]={gpu_us:i,cpu_us:a,total_us:i+a}}catch(r){console.warn("[Parakeet] Failed to parse profile file",n,r)}return console.table(t),t}}class Ke{constructor(e,s={}){this.model=e,this.opts={returnTimestamps:s.returnTimestamps??!0,returnConfidences:s.returnConfidences??!1,returnTokenIds:s.returnTokenIds??!1,sampleRate:s.sampleRate??16e3,debug:s.debug??!1},this._decoderState=null,this._currentOffset=0,this._totalWords=[],this._totalTokenIds=[],this._chunkCount=0,this._isFinalized=!1}async processChunk(e){if(this._isFinalized)throw new Error("Streamer is finalized. Create a new instance to process more audio.");const s=e.length/this.opts.sampleRate,t=await this.model.transcribe(e,this.opts.sampleRate,{returnTimestamps:this.opts.returnTimestamps,returnConfidences:this.opts.returnConfidences,returnTokenIds:this.opts.returnTokenIds,previousDecoderState:this._decoderState,returnDecoderState:!0,timeOffset:this._currentOffset});return this._decoderState=t.decoderState,this._currentOffset+=s,this._chunkCount++,t.words&&t.words.length>0&&this._totalWords.push(...t.words),this.opts.returnTokenIds&&t.tokenIds&&this._totalTokenIds.push(...t.tokenIds),this.opts.debug&&console.log(`[Streamer] Chunk ${this._chunkCount}: "${t.utterance_text}" (${t.words?.length||0} words, offset: ${this._currentOffset.toFixed(2)}s)`),{chunkText:t.utterance_text,chunkWords:t.words||[],text:this._totalWords.map(n=>n.text).join(" "),words:this._totalWords.slice(),totalDuration:this._currentOffset,chunkCount:this._chunkCount,is_final:!1,...this.opts.returnTokenIds?{tokenIds:this._totalTokenIds.slice()}:{},...this.opts.returnConfidences&&t.confidence_scores?{confidence_scores:t.confidence_scores}:{},metrics:t.metrics}}finalize(){return this._isFinalized=!0,{text:this._totalWords.map(e=>e.text).join(" "),words:this._totalWords.slice(),totalDuration:this._currentOffset,chunkCount:this._chunkCount,is_final:!0,...this.opts.returnTokenIds?{tokenIds:this._totalTokenIds.slice()}:{}}}reset(){this._decoderState=null,this._currentOffset=0,this._totalWords=[],this._totalTokenIds=[],this._chunkCount=0,this._isFinalized=!1}getState(){return{hasDecoderState:this._decoderState!==null,currentOffset:this._currentOffset,wordCount:this._totalWords.length,chunkCount:this._chunkCount,isFinalized:this._isFinalized}}}export{Re as ParakeetModel,Ke as StatefulStreamingTranscriber};
|
source/dist/assets/worker-D2CeqmVH.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
async function f(t,a={}){const{getParakeetModel:e}=await import("./hub-BlMT648A.js"),{ParakeetModel:s}=await import("./parakeet-xcg-VHSn.js"),{MODELS:r}=await import("./models-Dq2DCePq.js"),o=r[t]?.repoId||t,n=await e(o,a);return s.fromUrls({...n.urls,filenames:n.filenames,preprocessorBackend:n.preprocessorBackend,...a})}let i=null,m=!1;async function w(t="parakeet-tdt-0.6b-v3",a={}){if(m)return{status:"loading",message:"Model is already loading..."};if(i)return{status:"ready",message:"Model already loaded"};try{m=!0;const e=a.device==="webgpu"?"webgpu-hybrid":"wasm";self.postMessage({status:"loading",message:`Downloading Parakeet ${t}... (~2.5GB, this may take 1-2 minutes)`}),console.log(`[Worker] Loading model with backend: ${e}`);const s=e==="wasm"?{encoderQuant:"int8",decoderQuant:"int8",preprocessor:"nemo128"}:{encoderQuant:"fp32",decoderQuant:"int8",preprocessor:"nemo128"},r=new Set;i=await f(t,{backend:e,...s,progress:u=>{const{loaded:g,total:c,file:l}=u,p=c>0?Math.round(g/c*100):0;r.has(l)||(r.add(l),self.postMessage({status:"initiate",file:l,progress:0,total:c})),self.postMessage({status:"progress",file:l,progress:p,total:c,loaded:g}),g>=c&&self.postMessage({status:"done",file:l})}});const n=i.session?.executionProviders?.[0]||e;console.log(`[Worker] Model loaded. Requested: ${e}, Actual provider: ${n}`),self.postMessage({status:"loading",message:"Model downloaded, warming up..."});const d=new Float32Array(16e3);return await i.transcribe(d,16e3),self.postMessage({status:"ready",message:`Parakeet ${t} loaded successfully!`,device:e,modelVersion:t}),{status:"ready",device:e}}catch(e){return console.error("Failed to load model:",e),self.postMessage({status:"error",message:`Failed to load model: ${e.message}`,error:e.toString()}),{status:"error",error:e.toString()}}finally{m=!1}}async function h(t,a=null){if(!i)throw new Error("Model not loaded. Call load() first.");try{const e=performance.now(),s=await i.transcribe(t,16e3,{returnTimestamps:!0,returnConfidences:!0,temperature:1}),o=(performance.now()-e)/1e3,n=t.length/16e3,d=n/o,u=k(s.words||[]);return{text:s.utterance_text||"",sentences:u,words:s.words||[],chunks:s.words||[],metadata:{latency:o,audioDuration:n,rtf:d,language:a,confidence:s.confidence_scores,metrics:s.metrics}}}catch(e){throw console.error("Transcription error:",e),e}}function k(t){if(!t||t.length===0)return[];const a=[];let e=[],s=t[0].start_time||0;for(let r=0;r<t.length;r++){const o=t[r];e.push(o.text),(/[.!?]$/.test(o.text)||r===t.length-1)&&(a.push({text:e.join(" ").trim(),start:s,end:o.end_time||o.start_time||0}),r<t.length-1&&(e=[],s=t[r+1].start_time||o.end_time||0))}return a}self.onmessage=async t=>{const{type:a,data:e}=t.data;try{switch(a){case"load":await w(e?.modelVersion,e?.options||{});break;case"transcribe":const s=await h(e.audio,e.language);self.postMessage({status:"transcription",result:s});break;case"ping":self.postMessage({status:"pong"});break;default:self.postMessage({status:"error",message:`Unknown message type: ${a}`})}}catch(s){self.postMessage({status:"error",message:s.message,error:s.toString()})}};
|
source/dist/index.html
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<meta name="description" content="Real-time speech recognition with Parakeet STT and WebGPU acceleration. Progressive transcription demo." />
|
| 8 |
+
<title>Parakeet STT Progressive Transcription | WebGPU Demo</title>
|
| 9 |
+
<script type="module" crossorigin src="/assets/index-D32DZD7n.js"></script>
|
| 10 |
+
<link rel="stylesheet" crossorigin href="/assets/index-4ud1a0so.css">
|
| 11 |
+
</head>
|
| 12 |
+
<body>
|
| 13 |
+
<div id="root"></div>
|
| 14 |
+
</body>
|
| 15 |
+
</html>
|