Comments (9)
Make sure you have your URL (en-model.tgz
) to point to a valid one. The one on the example should be in the examples folder. You can download the model and place it in the directory of the HTML file, or you can replace it with https://github.com/msqr1/Vosklet/raw/main/examples/en-model.tgz
to fetch it directly from github
from vosklet.
Make sure you have your URL (
en-model.tgz
) to point to a valid one. The one on the example should be in the examples folder. You can download the model and place it in the directory of the HTML file, or you can replace it withhttps://github.com/msqr1/Vosklet/raw/main/examples/en-model.tgz
to fetch it directly from github
Thank you, for a quick response, unfortunately, the accessibility of the model files is not a case.
127.0.0.1 - - [13/May/2024 10:10:18] "GET /static/Vosklet.js HTTP/1.1" 304 -
127.0.0.1 - - [13/May/2024 10:10:28] "GET /static/en-model.tgz HTTP/1.1" 200 -
I digged in a bit, an error arise at
tar = await new Response(tar.pipeThrough(new DecompressionStream("gzip"))).arrayBuffer();
at the call of arrayBuffer()
from vosklet.
I found out, that browser extract gzipped stream on the fly, I removed content-type of model.tgz to avoid this
usage of https://github.com/msqr1/Vosklet/raw/main/examples/en-model.tgz seems impossible due to CORS restrictions, so I still use my local file
from vosklet.
removing gzip piping from Vosklet.js works
from vosklet.
Ah crap I am hitting this too.
removing gzip piping from Vosklet.js works
@msqr1 should this be removed from the lib? Or maybe the case where the browser decompressed the file should be handled as a special case?
from vosklet.
Basically, for faster load times, I store a gzipped copy of the model in OPFS. OPFS is not fetchable, so I have to manually decompress it before loading. To do this, the first time a model is fetched, we receive a compressed model, tee the stream so that one (still compressed) goes into OPFS, and one (get decompressed) goes to model loading. If the browser decompress beforehand, I have to compress before storage (to save space), which I think is slower than decompressing.
A solution I think for this would be doing this would be letting the browser decompress, and compress again (1st time cost only) to store it, and proceed as normal.
from vosklet.
Basically, for faster load times, I store a gzipped copy of the model in OPFS. OPFS is not fetchable, so I have to manually decompress it before loading. To do this, the first time a model is fetched, we receive a compressed model, tee the stream so that one (still compressed) goes into OPFS, and one (get decompressed) goes to model loading. If the browser decompress beforehand, I have to compress before storage (to save space), which I think is slower than decompressing.
A solution I think for this would be doing this would be letting the browser decompress, and compress again (1st time cost only) to store it, and proceed as normal.
This would be internal within the library, right? I don't have full context since I'm not familiar with the codebase but that sounds reasonable to me
from vosklet.
Yeah, because first time startup can be a tiny but slower due to compression, but it's just once. I'll do that later today.
from vosklet.
@jakespracher, I tried fixing it, by removing manual decompression, can you try it again?
from vosklet.
Related Issues (7)
- Not work with different model HOT 12
- evaluation give worse metrics then server-based VOSK. Way to run it sync for test? HOT 8
- ReferenceError: Can't find variable: SharedArrayBuffer HOT 14
- Import via module: Can't find variable window HOT 2
- Error: "Unable to open tar in WASM memory" using en-model.tgz HOT 5
- "TypeError: cannot convert undefined to object" in VoskletTransferer HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vosklet.