OfflineMoonshineModelConfig.java
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright 2024 Xiaomi Corporation
package com.k2fsa.sherpa.onnx;
public class OfflineMoonshineModelConfig {
private final String preprocessor;
private final String encoder;
private final String uncachedDecoder;
private final String cachedDecoder;
private OfflineMoonshineModelConfig(Builder builder) {
this.preprocessor = builder.preprocessor;
this.encoder = builder.encoder;
this.uncachedDecoder = builder.uncachedDecoder;
this.cachedDecoder = builder.cachedDecoder;
}
public static Builder builder() {
return new Builder();
}
public String getPreprocessor() {
return preprocessor;
}
public String getEncoder() {
return encoder;
}
public String getUncachedDecoder() {
return uncachedDecoder;
}
public String getCachedDecoder() {
return cachedDecoder;
}
public static class Builder {
private String preprocessor = "";
private String encoder = "";
private String uncachedDecoder = "";
private String cachedDecoder = "";
public OfflineMoonshineModelConfig build() {
return new OfflineMoonshineModelConfig(this);
}
public Builder setPreprocessor(String preprocessor) {
this.preprocessor = preprocessor;
return this;
}
public Builder setEncoder(String encoder) {
this.encoder = encoder;
return this;
}
public Builder setUncachedDecoder(String uncachedDecoder) {
this.uncachedDecoder = uncachedDecoder;
return this;
}
public Builder setCachedDecoder(String cachedDecoder) {
this.cachedDecoder = cachedDecoder;
return this;
}
}
}