Comments (3)
Fixed now, I stuck with returning a Promise<void>
since a Promise<bool>
would always resolve to true
if it does resolve - if there's an error, it would have rejected anyway.
from tractjs.
This is indeed a layer of indirection, but in Javascript a constructor must always return the class it is constructing, it can not be asynchronous.
Initially I thought that just waiting for the model load on the first call to predict
would be enough; but I agree that in some cases you will want to know when the model is loaded before predicting, specifically to check whether loading was successful. Thanks for bringing that up!
Making modelId
public is ugly; I could add a function async loaded() -> Promise<void>
that resolves once the model is loaded or errs if there was an error loading the model. Does that sound good to you?
from tractjs.
I like the idea of the loaded
function. My mild opinion would be async isLoaded() -> Promise<boolean>
, but anything that provides the ability to check is great.
from tractjs.
Related Issues (14)
- Should the input facts in the example be [1, 3, 224, 224]? HOT 1
- Don't inline Worker and WASM when building ESM
- Multithreading across batch dimension
- NNEF integration HOT 2
- Loading the plus3.pb from the Tract Repo HOT 3
- Move cypress to devDependencies HOT 4
- CPU vs WASM HOT 2
- Can't resolve 'worker_threads'
- Add format setting to Custom Model Demo
- Loading models outside the project HOT 9
- Unable to catch model loading errors?
- Node.js support
- Unit tests HOT 14
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 tractjs.