Giter VIP home page Giter VIP logo

Comments (3)

bminixhofer avatar bminixhofer commented on September 17, 2024 1

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.

bminixhofer avatar bminixhofer commented on September 17, 2024

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.

danielbank avatar danielbank commented on September 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.