Skip to content

Is it possible to loadModels in NodeJS Environment from a URL ? #126

Answered by vladmandic
SM-47 asked this question in Q&A
Discussion options

You must be logged in to vote

sure you can, but...

  • you're trying to load from a GitHub URL which is NOT a generic web server - you cannot download models like that
    (if you try to download that model yourself using browser, you'll see you don't get binaries, you get a web page result)
    try loading from a CDN using URL https://cdn.jsdelivr.net/npm/@vladmandic/[email protected]/model/
  • depending on version of nodejs, it may or may not have a built-in http fetch function
    • nodejs v14.x does not have fetch soi you need to provide fetch function - see section on monkey-patch how to do that
    • nodejs v16.x has fetch built-in but its disabled by default. you can either follow same procedure or enable it
    • nodejs v18.x has fetch built-i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vladmandic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants