replicate-js
replicate-js copied to clipboard
useful error if the requested model isn't found
Description
When model is not found (or undefined) this is the error:
file:///<path/to>/node_modules/replicate-js/replicate.js:77
const mostRecentVersion = modelVersions[0];
This PR changes that to eg
file:///<path/to>/node_modules/replicate-js/replicate.js:70
throw new Error(`Model "${this.path}" not found`)
^
Error: Model "<username>/undefined" not found
Related Issue(s)
Addresses #22
How to test
Call predict()
with a non-existent model
Release Notes
NONE
Documentation
not required