Skip to content

Commit

Permalink
chore: repackage and move model specs
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-s committed Nov 18, 2024
1 parent 86457c3 commit 4d50e40
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 119 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

import it.smartcommunitylabdhub.commons.annotations.common.SpecType;
import it.smartcommunitylabdhub.commons.models.entities.EntityName;

@SpecType(kind = "model", entity = EntityName.MODEL)
public class ModelSpec extends it.smartcommunitylabdhub.commons.models.model.ModelBaseSpec {
}
public class ModelSpec extends it.smartcommunitylabdhub.commons.models.model.ModelBaseSpec {}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package it.smartcommunitylabdhub.commons.annotations.common;

import it.smartcommunitylabdhub.commons.models.entities.EntityName;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.stereotype.Indexed;

import it.smartcommunitylabdhub.commons.models.entities.EntityName;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Indexed
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package it.smartcommunitylabdhub.commons.models.model;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Map;
package it.smartcommunitylabdhub.runtime.huggingface.specs;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.v3.oas.annotations.media.Schema;
import it.smartcommunitylabdhub.commons.annotations.common.SpecType;
import it.smartcommunitylabdhub.commons.models.entities.EntityName;
import it.smartcommunitylabdhub.commons.models.model.ModelSpec;
import java.io.Serializable;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@SpecType(kind = "huggingface", entity = EntityName.MODEL)
public class HuggingFaceModelSpec extends ModelSpec {

//Huggingface model id
Expand All @@ -21,7 +22,10 @@ public class HuggingFaceModelSpec extends ModelSpec {

//Huggingface model revision
@JsonProperty("model_revision")
@Schema(title = "fields.huggingface.modelrevision.title", description = "fields.huggingface.modelrevision.description")
@Schema(
title = "fields.huggingface.modelrevision.title",
description = "fields.huggingface.modelrevision.description"
)
private String modelRevision;

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package it.smartcommunitylabdhub.runtime.mlflow.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Dataset {

@Schema(title = "fields.mlflow.inputdatasetname.title", description = "fields.mlflow.inputdatasetname.description")
private String name;

@Schema(
title = "fields.mlflow.inputdatasetdigest.title",
description = "fields.mlflow.inputdatasetdigest.description"
)
private String digest;

@Schema(
title = "fields.mlflow.inputdatasetprofile.title",
description = "fields.mlflow.inputdatasetprofile.description"
)
private String profile;

@Schema(
title = "fields.mlflow.inputdatasetschema.title",
description = "fields.mlflow.inputdatasetschema.description"
)
private String schema;

@Schema(
title = "fields.mlflow.inputdatasetsource.title",
description = "fields.mlflow.inputdatasetsource.description"
)
private String source;

@JsonProperty("source_type")
@Schema(
title = "fields.mlflow.inputdatasetsourcetype.title",
description = "fields.mlflow.inputdatasetsourcetype.description"
)
private String sourceType;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package it.smartcommunitylabdhub.commons.models.model.mlflow;
package it.smartcommunitylabdhub.runtime.mlflow.models;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
Expand All @@ -10,8 +10,10 @@ public class Signature {

@Schema(title = "fields.mlflow.signatureinputs.title", description = "fields.mlflow.signatureinputs.description")
private String inputs;

@Schema(title = "fields.mlflow.signatureoutputs.title", description = "fields.mlflow.signatureoutputs.description")
private String outputs;

@Schema(title = "fields.mlflow.signatureparams.title", description = "fields.mlflow.signatureparams.description")
private String params;
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package it.smartcommunitylabdhub.commons.models.model;


import lombok.Getter;
import lombok.Setter;
package it.smartcommunitylabdhub.runtime.mlflow.specs;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import it.smartcommunitylabdhub.commons.annotations.common.SpecType;
import it.smartcommunitylabdhub.commons.models.entities.EntityName;
import it.smartcommunitylabdhub.commons.models.model.ModelSpec;
import it.smartcommunitylabdhub.runtime.mlflow.models.Dataset;
import it.smartcommunitylabdhub.runtime.mlflow.models.Signature;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.v3.oas.annotations.media.Schema;
import it.smartcommunitylabdhub.commons.models.model.mlflow.Dataset;
import it.smartcommunitylabdhub.commons.models.model.mlflow.Signature;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@SpecType(kind = "mlflow", entity = EntityName.MODEL)
public class MlflowModelSpec extends ModelSpec {

@Schema(title = "fields.mlflow.flavor.title", description = "fields.mlflow.flavor.description")
private String flavor;

@JsonProperty("model_config")
@Schema(title = "fields.mlflow.modelconfig.title", description = "fields.mlflow.modelconfig.description")
private Map<String, String> modelConfig;
Expand All @@ -42,4 +42,4 @@ public void configure(Map<String, Serializable> data) {
this.inputDatasets = spec.getInputDatasets();
this.modelConfig = spec.getModelConfig();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package it.smartcommunitylabdhub.core.models.specs.model;

package it.smartcommunitylabdhub.runtime.sklearn.specs;

import it.smartcommunitylabdhub.commons.annotations.common.SpecType;
import it.smartcommunitylabdhub.commons.models.entities.EntityName;
import it.smartcommunitylabdhub.commons.models.model.ModelSpec;

@SpecType(kind = "sklearn", entity = EntityName.MODEL)
public class SKLearnModelSpec extends it.smartcommunitylabdhub.commons.models.model.SKLearnModelSpec {
}
public class SKLearnModelSpec extends ModelSpec {}

0 comments on commit 4d50e40

Please sign in to comment.