Skip to content

useful error if the requested model isn't found#31

Open
tomryanx wants to merge 1 commit intonicholascelestin:mainfrom
tomryanx:throw-model_not_found
Open

useful error if the requested model isn't found#31
tomryanx wants to merge 1 commit intonicholascelestin:mainfrom
tomryanx:throw-model_not_found

Conversation

@tomryanx
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant