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

Creates auto increment ID for models #1109

Merged
merged 2 commits into from
Jan 25, 2024
Merged

Conversation

zachgk
Copy link
Contributor

@zachgk zachgk commented Sep 25, 2023

This adds an auto increment ID to models, their toString, and logging. It allows them to be differentiated if two models share the same name. It is unified with the existing auto increment system in worker threads (which also had it's logging improved).

The IDs have both a prefix and leading zeros for consistent search:
WT-0001 for worker threads
M-0001 for models

@zachgk zachgk requested review from frankfliu and a team as code owners September 25, 2023 18:13
@@ -97,13 +97,18 @@ public final class ModelInfo<I, O> extends WorkerPoolConfig<I, O> {
private transient Map<String, Adapter> adapters;
private transient Engine engine;

private ModelInfo() {
super();
Copy link
Contributor

Choose a reason for hiding this comment

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

super() is not necessary, default constructor will be invoked automatically.

This creates a new auto-increment ID to differentiate models with the same name
and adds the ID to the toString and logging.
This removes the change to the external API for better compatibility. It also
avoids having the ID passed in exceptions, just in logs.
@zachgk zachgk merged commit fe5c70c into deepjavalibrary:master Jan 25, 2024
7 checks passed
@zachgk zachgk deleted the aiId branch January 25, 2024 01:13
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