Skip to content
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

List input and output classes in ModelZoo lookup #624

Merged
merged 3 commits into from
Feb 10, 2021

Conversation

zachgk
Copy link
Contributor

@zachgk zachgk commented Feb 8, 2021

This will list the input and output classes when trying to find a model in the
model zoo. It works either when no classes are specified or invalid classes are
specified. This will help users who don't know what the possible classes are to
resolve the question without looking at the code.

This will list the input and output classes when trying to find a model in the
model zoo. It works either when no classes are specified or invalid classes are
specified. This will help users who don't know what the possible classes are to
resolve the question without looking at the code.

Change-Id: Ideecb0c0b56699a7023d50f2cf3da54010197112
@zachgk zachgk requested a review from a team February 8, 2021 22:07
Change-Id: I64d4616f355aaaf13897aa44651867d8487c6ff9
@@ -199,12 +200,24 @@ public String toString() {
@SuppressWarnings("unchecked")
private <I, O> TranslatorFactory<I, O> getTranslatorFactory(Criteria<I, O> criteria) {
if (criteria.getInputClass() == null) {
throw new IllegalArgumentException("The criteria must set an input class");
throw new IllegalArgumentException(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new IllegalArgumentException(
throw new IllegalArgumentException(getErrorMessage("The criteria must set an input class.\n");

@@ -199,12 +200,24 @@ public String toString() {
@SuppressWarnings("unchecked")
private <I, O> TranslatorFactory<I, O> getTranslatorFactory(Criteria<I, O> criteria) {
if (criteria.getInputClass() == null) {
throw new IllegalArgumentException("The criteria must set an input class");
throw new IllegalArgumentException(
"The criteria must set an input class.\n" + printTranslatorFactories());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"The criteria must set an input class.\n" + printTranslatorFactories());

Change-Id: I95719122be62952a6b9793571d345656eb7a99bd
@zachgk zachgk merged commit 0beb220 into deepjavalibrary:master Feb 10, 2021
@zachgk zachgk deleted the critIO branch February 10, 2021 04:20
Lokiiiiii pushed a commit to Lokiiiiii/djl that referenced this pull request Oct 10, 2023
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.

3 participants