replicate-js icon indicating copy to clipboard operation
replicate-js copied to clipboard

useful error if the requested model isn't found

Open tomryanx opened this issue 2 years ago • 0 comments

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

tomryanx avatar Feb 19 '23 23:02 tomryanx