Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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