Files
SmartJavaAI/smartjavaai-translate/src/main/java/cn/smartjavaai/translation/config/SearchConfig.java
刘文霄 4cb7354410 nllp机器翻译支持202种语言互相翻译
(cherry picked from commit cb0cfff2863cf1c29132de76716c676be24bcad2)
2025-06-06 11:04:51 +08:00

102 lines
2.4 KiB
Java

package cn.smartjavaai.translation.config;
/**
* 配置信息
* @author lwx
* @date 2025/6/05
*/
public class SearchConfig {
private int maxSeqLength;
private long padTokenId;
private long eosTokenId;
private long bosTokenId;
private long decoderStartTokenId;
private float encoderRepetitionPenalty;
private long forcedBosTokenId;
private long srcLangId;
private float lengthPenalty;
public SearchConfig() {
this.maxSeqLength = 512;
this.eosTokenId = 2;
this.bosTokenId = 0;
this.padTokenId = 1;
this.decoderStartTokenId = 2;
this.encoderRepetitionPenalty = 1.0f;
this.srcLangId = 0;
this.forcedBosTokenId = 0;
this.lengthPenalty = 1.0f;
}
public long getSrcLangId() {
return srcLangId;
}
public void setSrcLangId(long srcLangId) {
this.srcLangId = srcLangId;
}
public void setEosTokenId(long eosTokenId) {
this.eosTokenId = eosTokenId;
}
public int getMaxSeqLength() {
return maxSeqLength;
}
public void setMaxSeqLength(int maxSeqLength) {
this.maxSeqLength = maxSeqLength;
}
public long getPadTokenId() {
return padTokenId;
}
public void setPadTokenId(long padTokenId) {
this.padTokenId = padTokenId;
}
public long getEosTokenId() {
return eosTokenId;
}
public long getDecoderStartTokenId() {
return decoderStartTokenId;
}
public void setDecoderStartTokenId(long decoderStartTokenId) {
this.decoderStartTokenId = decoderStartTokenId;
}
public float getEncoderRepetitionPenalty() {
return encoderRepetitionPenalty;
}
public void setEncoderRepetitionPenalty(float encoderRepetitionPenalty) {
this.encoderRepetitionPenalty = encoderRepetitionPenalty;
}
public long getForcedBosTokenId() {
return forcedBosTokenId;
}
public void setForcedBosTokenId(long forcedBosTokenId) {
this.forcedBosTokenId = forcedBosTokenId;
}
public float getLengthPenalty() {
return lengthPenalty;
}
public void setLengthPenalty(float lengthPenalty) {
this.lengthPenalty = lengthPenalty;
}
public long getBosTokenId() {
return bosTokenId;
}
public void setBosTokenId(long bosTokenId) {
this.bosTokenId = bosTokenId;
}
}