Skip to content

Commit

Permalink
Fix Java CI
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed May 23, 2024
1 parent 5df535f commit 858a954
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class OfflineModelConfig {
private final String provider;

private final String modelType;
private final String modelingUnit;
private final String bpeVocab;

private OfflineModelConfig(Builder builder) {
this.transducer = builder.transducer;
Expand All @@ -24,6 +26,8 @@ private OfflineModelConfig(Builder builder) {
this.debug = builder.debug;
this.provider = builder.provider;
this.modelType = builder.modelType;
this.modelingUnit = builder.modelingUnit;
this.bpeVocab = builder.bpeVocab;
}

public static Builder builder() {
Expand Down Expand Up @@ -62,6 +66,13 @@ public String getModelType() {
return modelType;
}

public String getModelingUnit() {
return modelingUnit;
}

public String getBpeVocab() {
return bpeVocab;
}

public static class Builder {
private OfflineParaformerModelConfig paraformer = OfflineParaformerModelConfig.builder().build();
Expand All @@ -73,6 +84,8 @@ public static class Builder {
private boolean debug = true;
private String provider = "cpu";
private String modelType = "";
private String modelingUnit = "cjkchar";
private String bpeVocab = "";

public OfflineModelConfig build() {
return new OfflineModelConfig(this);
Expand Down Expand Up @@ -122,5 +135,13 @@ public Builder setModelType(String modelType) {
this.modelType = modelType;
return this;
}

public void setModelingUnit(String modelingUnit) {
this.modelingUnit = modelingUnit;
}

public void setBpeVocab(String bpeVocab) {
this.bpeVocab = bpeVocab;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class OnlineModelConfig {
private final boolean debug;
private final String provider;
private final String modelType;
private final String modelingUnit;
private final String bpeVocab;

private OnlineModelConfig(Builder builder) {
this.transducer = builder.transducer;
Expand All @@ -24,6 +26,8 @@ private OnlineModelConfig(Builder builder) {
this.debug = builder.debug;
this.provider = builder.provider;
this.modelType = builder.modelType;
this.modelingUnit = builder.modelingUnit;
this.bpeVocab = builder.bpeVocab;
}

public static Builder builder() {
Expand Down Expand Up @@ -66,6 +70,14 @@ public String getModelType() {
return modelType;
}

public String getModelingUnit() {
return modelingUnit;
}

public String getBpeVocab() {
return bpeVocab;
}

public static class Builder {
private OnlineParaformerModelConfig paraformer = OnlineParaformerModelConfig.builder().build();
private OnlineTransducerModelConfig transducer = OnlineTransducerModelConfig.builder().build();
Expand All @@ -76,6 +88,8 @@ public static class Builder {
private boolean debug = true;
private String provider = "cpu";
private String modelType = "";
private String modelingUnit = "cjkchar";
private String bpeVocab = "";

public OnlineModelConfig build() {
return new OnlineModelConfig(this);
Expand Down Expand Up @@ -125,5 +139,13 @@ public Builder setModelType(String modelType) {
this.modelType = modelType;
return this;
}

public void setModelingUnit(String modelingUnit) {
this.modelingUnit = modelingUnit;
}

public void setBpeVocab(String bpeVocab) {
this.bpeVocab = bpeVocab;
}
}
}

0 comments on commit 858a954

Please sign in to comment.