Spaces:
Running
Running
Commit
·
e3476c0
1
Parent(s):
4a3af20
release: build cc4b1371cdf5907e64f325d33a01dc0b8b191626
Browse files
assets/{index-PdGS-RWe.js → index-Bo5C9AUw.js}
RENAMED
@@ -4017,5 +4017,5 @@ void main() {
|
|
4017 |
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
4018 |
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
4019 |
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
4020 |
-
}`})}}so.BlurDirectionX=new re(1,0);so.BlurDirectionY=new re(0,1);const QU=["args","set-size"],e3=["args"],t3=["args","strength"],n3=["set-size"],i3=er({__name:"BloomScene",props:{frequency:{}},setup(n){const e=n;ru({EffectComposer:$U,OutputPass:ZU,UnrealBloomPass:so,RenderPass:KU});const{renderer:t,scene:i,camera:s,sizes:r}=v2(),o=Yn();return y2().render(()=>{o.value&&o.value.render()}),dt([r.width,r.height],()=>{var a;(a=o.value)==null||a.setSize(r.width.value,r.height.value)}),(a,l)=>(Ai(),Ci("TresEffectComposer",{ref_key:"composer",ref:o,args:[mt(t)],"set-size":[mt(r).width.value,mt(r).height.value]},[Pt("TresRenderPass",{args:[mt(i),mt(s)],attach:"passes-0"},null,8,e3),Pt("TresUnrealBloomPass",{args:[[mt(r).width,mt(r).height],.2,1,0],strength:.2+e.frequency/1e3,attach:"passes-1"},null,8,t3),Pt("TresOutputPass",{attach:"passes-2","set-size":[mt(r).width.value,mt(r).height.value]},null,8,n3)],8,QU))}}),U0=16e3,s3="/assets/processor-0sEQXaXZ.js";var Do=(n=>(n.Status="status",n.Output="output",n.Info="info",n.Request="request",n.Error="error",n.Load="load",n))(Do||{});const r3="/assets/worker-
|
4021 |
`),u=new Blob([c],{type:"text/plain"}),h=URL.createObjectURL(u),f=document.createElement("a");f.href=h,f.download="transcript.txt",f.click(),URL.revokeObjectURL(h)}return(c,u)=>{const h=oM("motion");return Ai(),Ci("div",o3,[Gb((Ai(),Ci("div",a3,u[1]||(u[1]=[Pt("h1",{class:"text-6xl text-white font-bold lg:text-8xl sm:text-7xl"}," Moonshine Web ",-1),Pt("h2",{class:"text-2xl text-white"}," Real-time in-browser speech recognition, powered by Transformers.js ",-1)]))),[[h]]),t.value?(Ai(),Ci("div",l3,[u[2]||(u[2]=Pt("div",{class:"mb-1 text-4xl text-white font-semibold md:text-5xl"}," An error occurred ",-1)),Pt("div",c3,vf(t.value),1)])):(Ai(),Ci(ln,{key:1},[Pt("div",u3,[Jt(MS,{name:"fade-up",tag:"div"},{default:Sf(()=>[(Ai(!0),Ci(ln,null,lM(i.value,f=>(Ai(),Ci("div",{key:f.message||"",initial:{opacity:0,y:25},enter:{opacity:1,y:0},duration:200,class:Ca(["mb-1",[f.type==="output"?"text-5xl":"text-2xl text-green-300 font-light"]])},[Pt("div",null,vf(f.message),1)],2))),128))]),_:1})]),Jt(mt($y),{"window-size":"",alpha:!0,antialias:!0,"power-preference":"high-performance","output-color-space":mt(jt),"tone-mapping":mt(ro)},{default:Sf(()=>[u[3]||(u[3]=Pt("TresPerspectiveCamera",{position:[0,0,8],fov:75,near:.1,far:1e3},null,-1)),u[4]||(u[4]=Pt("TresAmbientLight",{intensity:.5},null,-1)),Jt(HU,{ready:e.value!==null,active:e.value==="recording_start",frequency:s.value},null,8,["ready","active","frequency"]),Jt(i3,{frequency:s.value},null,8,["frequency"])]),_:1},8,["output-color-space","tone-mapping"]),Pt("div",h3,[Pt("button",{class:"h-10 w-10 flex items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Download Transcript",onClick:u[0]||(u[0]=()=>l())},u[5]||(u[5]=[Pt("svg",{class:"h-7 w-7 cursor-pointer text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Pt("path",{fillRule:"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z",clipRule:"evenodd"}),Pt("path",{fillRule:"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z",clipRule:"evenodd"})],-1)])),u[6]||(u[6]=Pt("a",{href:"https://github.com/huggingface/transformers.js-examples/tree/main/moonshine-web",target:"_blank",class:"h-10 w-10 flex cursor-pointer items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Source Code"},[Pt("svg",{class:"h-7 w-7 text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Pt("path",{fillRule:"evenodd",d:"M12.006 2a9.847 9.847 0 0 0-6.484 2.44 10.32 10.32 0 0 0-3.393 6.17 10.48 10.48 0 0 0 1.317 6.955 10.045 10.045 0 0 0 5.4 4.418c.504.095.683-.223.683-.494 0-.245-.01-1.052-.014-1.908-2.78.62-3.366-1.21-3.366-1.21a2.711 2.711 0 0 0-1.11-1.5c-.907-.637.07-.621.07-.621.317.044.62.163.885.346.266.183.487.426.647.71.135.253.318.476.538.655a2.079 2.079 0 0 0 2.37.196c.045-.52.27-1.006.635-1.37-2.219-.259-4.554-1.138-4.554-5.07a4.022 4.022 0 0 1 1.031-2.75 3.77 3.77 0 0 1 .096-2.713s.839-.275 2.749 1.05a9.26 9.26 0 0 1 5.004 0c1.906-1.325 2.74-1.05 2.74-1.05.37.858.406 1.828.101 2.713a4.017 4.017 0 0 1 1.029 2.75c0 3.939-2.339 4.805-4.564 5.058a2.471 2.471 0 0 1 .679 1.897c0 1.372-.012 2.477-.012 2.814 0 .272.18.592.687.492a10.05 10.05 0 0 0 5.388-4.421 10.473 10.473 0 0 0 1.313-6.948 10.32 10.32 0 0 0-3.39-6.165A9.847 9.847 0 0 0 12.007 2Z",clipRule:"evenodd"})])],-1))])],64))])}}}),d3=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},p3=d3(f3,[["__scopeId","data-v-820e08ca"]]);RS(p3).use(DU).use(B2).mount("#app");
|
|
|
4017 |
lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +
|
4018 |
lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +
|
4019 |
lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );
|
4020 |
+
}`})}}so.BlurDirectionX=new re(1,0);so.BlurDirectionY=new re(0,1);const QU=["args","set-size"],e3=["args"],t3=["args","strength"],n3=["set-size"],i3=er({__name:"BloomScene",props:{frequency:{}},setup(n){const e=n;ru({EffectComposer:$U,OutputPass:ZU,UnrealBloomPass:so,RenderPass:KU});const{renderer:t,scene:i,camera:s,sizes:r}=v2(),o=Yn();return y2().render(()=>{o.value&&o.value.render()}),dt([r.width,r.height],()=>{var a;(a=o.value)==null||a.setSize(r.width.value,r.height.value)}),(a,l)=>(Ai(),Ci("TresEffectComposer",{ref_key:"composer",ref:o,args:[mt(t)],"set-size":[mt(r).width.value,mt(r).height.value]},[Pt("TresRenderPass",{args:[mt(i),mt(s)],attach:"passes-0"},null,8,e3),Pt("TresUnrealBloomPass",{args:[[mt(r).width,mt(r).height],.2,1,0],strength:.2+e.frequency/1e3,attach:"passes-1"},null,8,t3),Pt("TresOutputPass",{attach:"passes-2","set-size":[mt(r).width.value,mt(r).height.value]},null,8,n3)],8,QU))}}),U0=16e3,s3="/assets/processor-0sEQXaXZ.js";var Do=(n=>(n.Status="status",n.Output="output",n.Info="info",n.Request="request",n.Error="error",n.Load="load",n))(Do||{});const r3="/assets/worker-CwWz5BqG.js";function O0(n){return new Date(n).toLocaleString("zh",{hour12:!1,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3})}const o3={class:"h-full w-screen flex flex-col items-center justify-center bg-gray-900"},a3={initial:{opacity:0},enter:{opacity:100},visible:{opacity:0},class:"fixed inset-0 z-20 h-full w-full flex flex-col items-center justify-center bg-black/90 p-2 text-center text-black backdrop-blur-md transition-all duration-2000 delay-1500 ease-in-out"},l3={key:0,class:"h-full flex flex-col justify-center p-2 text-center"},c3={class:"text-xl text-red-300"},u3={class:"absolute bottom-0 z-10 w-full overflow-hidden pb-8 text-center text-white"},h3={class:"absolute bottom-6 right-6 z-10 flex flex-col space-y-2"},f3=er({__name:"App",setup(n){const e=Fe(null),t=Fe(null),i=Fe([]),s=Fe(0),{post:r,data:o}=FU(r3,{type:"module"});function a(c){t.value=c.message}dt(o,()=>{if("error"in o.value)return a(o.value.error);o.value.type===Do.Status?(e.value=o.value.message,i.value.push(o.value),i.value.length>1&&(i.value=i.value.slice(-1))):(i.value.push(o.value),i.value.length>1&&(i.value=i.value.slice(-1)))}),rs(()=>{r({type:Do.Load})}),rs(()=>{let c=!1;const u=navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0,sampleRate:U0}});let h,f,d;return u.then(async p=>{if(c)return;f=new(window.AudioContext||"webkitAudioContext"in window&&window.webkitAudioContext)({sampleRate:U0,latencyHint:"interactive"});const _=f.createAnalyser();_.fftSize=32,d=f.createMediaStreamSource(p),d.connect(_);const g=new Uint8Array(_.frequencyBinCount),m=()=>(_.getByteFrequencyData(g),g.reduce((y,v)=>y+v,0)/g.length),x=()=>{const y=m();s.value=y,requestAnimationFrame(x)};x(),await f.audioWorklet.addModule(new URL(s3,import.meta.url)),h=new AudioWorkletNode(f,"vad-processor",{numberOfInputs:1,numberOfOutputs:0,channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"}),d.connect(h),h.port.onmessage=y=>{const{buffer:v}=y.data;r({type:Do.Request,buffer:v})}}).catch(p=>{t.value=p.message,console.error(p)}),()=>{c=!0,u.then(p=>p.getTracks().forEach(_=>_.stop())),d==null||d.disconnect(),h==null||h.disconnect(),f==null||f.close()}});function l(){const c=i.value.filter(d=>d.type===Do.Output).map(d=>`${O0(d.start)} - ${O0(d.end)} | ${d.message}`).join(`
|
4021 |
`),u=new Blob([c],{type:"text/plain"}),h=URL.createObjectURL(u),f=document.createElement("a");f.href=h,f.download="transcript.txt",f.click(),URL.revokeObjectURL(h)}return(c,u)=>{const h=oM("motion");return Ai(),Ci("div",o3,[Gb((Ai(),Ci("div",a3,u[1]||(u[1]=[Pt("h1",{class:"text-6xl text-white font-bold lg:text-8xl sm:text-7xl"}," Moonshine Web ",-1),Pt("h2",{class:"text-2xl text-white"}," Real-time in-browser speech recognition, powered by Transformers.js ",-1)]))),[[h]]),t.value?(Ai(),Ci("div",l3,[u[2]||(u[2]=Pt("div",{class:"mb-1 text-4xl text-white font-semibold md:text-5xl"}," An error occurred ",-1)),Pt("div",c3,vf(t.value),1)])):(Ai(),Ci(ln,{key:1},[Pt("div",u3,[Jt(MS,{name:"fade-up",tag:"div"},{default:Sf(()=>[(Ai(!0),Ci(ln,null,lM(i.value,f=>(Ai(),Ci("div",{key:f.message||"",initial:{opacity:0,y:25},enter:{opacity:1,y:0},duration:200,class:Ca(["mb-1",[f.type==="output"?"text-5xl":"text-2xl text-green-300 font-light"]])},[Pt("div",null,vf(f.message),1)],2))),128))]),_:1})]),Jt(mt($y),{"window-size":"",alpha:!0,antialias:!0,"power-preference":"high-performance","output-color-space":mt(jt),"tone-mapping":mt(ro)},{default:Sf(()=>[u[3]||(u[3]=Pt("TresPerspectiveCamera",{position:[0,0,8],fov:75,near:.1,far:1e3},null,-1)),u[4]||(u[4]=Pt("TresAmbientLight",{intensity:.5},null,-1)),Jt(HU,{ready:e.value!==null,active:e.value==="recording_start",frequency:s.value},null,8,["ready","active","frequency"]),Jt(i3,{frequency:s.value},null,8,["frequency"])]),_:1},8,["output-color-space","tone-mapping"]),Pt("div",h3,[Pt("button",{class:"h-10 w-10 flex items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Download Transcript",onClick:u[0]||(u[0]=()=>l())},u[5]||(u[5]=[Pt("svg",{class:"h-7 w-7 cursor-pointer text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Pt("path",{fillRule:"evenodd",d:"M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z",clipRule:"evenodd"}),Pt("path",{fillRule:"evenodd",d:"M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z",clipRule:"evenodd"})],-1)])),u[6]||(u[6]=Pt("a",{href:"https://github.com/huggingface/transformers.js-examples/tree/main/moonshine-web",target:"_blank",class:"h-10 w-10 flex cursor-pointer items-center justify-center rounded-full bg-white shadow-md hover:bg-gray-100",title:"Source Code"},[Pt("svg",{class:"h-7 w-7 text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 24 24"},[Pt("path",{fillRule:"evenodd",d:"M12.006 2a9.847 9.847 0 0 0-6.484 2.44 10.32 10.32 0 0 0-3.393 6.17 10.48 10.48 0 0 0 1.317 6.955 10.045 10.045 0 0 0 5.4 4.418c.504.095.683-.223.683-.494 0-.245-.01-1.052-.014-1.908-2.78.62-3.366-1.21-3.366-1.21a2.711 2.711 0 0 0-1.11-1.5c-.907-.637.07-.621.07-.621.317.044.62.163.885.346.266.183.487.426.647.71.135.253.318.476.538.655a2.079 2.079 0 0 0 2.37.196c.045-.52.27-1.006.635-1.37-2.219-.259-4.554-1.138-4.554-5.07a4.022 4.022 0 0 1 1.031-2.75 3.77 3.77 0 0 1 .096-2.713s.839-.275 2.749 1.05a9.26 9.26 0 0 1 5.004 0c1.906-1.325 2.74-1.05 2.74-1.05.37.858.406 1.828.101 2.713a4.017 4.017 0 0 1 1.029 2.75c0 3.939-2.339 4.805-4.564 5.058a2.471 2.471 0 0 1 .679 1.897c0 1.372-.012 2.477-.012 2.814 0 .272.18.592.687.492a10.05 10.05 0 0 0 5.388-4.421 10.473 10.473 0 0 0 1.313-6.948 10.32 10.32 0 0 0-3.39-6.165A9.847 9.847 0 0 0 12.007 2Z",clipRule:"evenodd"})])],-1))])],64))])}}}),d3=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},p3=d3(f3,[["__scopeId","data-v-820e08ca"]]);RS(p3).use(DU).use(B2).mount("#app");
|
assets/{worker-BSStYFQ8.js → worker-CwWz5BqG.js}
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
index.html
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
document.documentElement.classList.toggle('dark', true)
|
14 |
})()
|
15 |
</script>
|
16 |
-
<script type="module" crossorigin src="/assets/index-
|
17 |
<link rel="stylesheet" crossorigin href="/assets/index-NxcRAxmX.css">
|
18 |
</head>
|
19 |
<body class="font-sans">
|
|
|
13 |
document.documentElement.classList.toggle('dark', true)
|
14 |
})()
|
15 |
</script>
|
16 |
+
<script type="module" crossorigin src="/assets/index-Bo5C9AUw.js"></script>
|
17 |
<link rel="stylesheet" crossorigin href="/assets/index-NxcRAxmX.css">
|
18 |
</head>
|
19 |
<body class="font-sans">
|