mirror of
https://github.com/geekwenjie/SmartJavaAI.git
synced 2026-09-15 06:19:08 +00:00
临时提交
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
package cn.smartjavaai.translation.config;
|
||||
/**
|
||||
* 配置信息
|
||||
* @author lwx
|
||||
* @date 2025/6/05
|
||||
*/
|
||||
public class NllbSearchConfig {
|
||||
|
||||
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 NllbSearchConfig() {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.smartjavaai.translation.config;
|
||||
/**
|
||||
* 配置信息
|
||||
*
|
||||
* @author Calvin
|
||||
* @mail 179209347@qq.com
|
||||
* @website www.aias.top
|
||||
*/
|
||||
public class OpusSearchConfig {
|
||||
private int maxSeqLength;
|
||||
private long padTokenId;
|
||||
private long eosTokenId;
|
||||
private int beam;
|
||||
private boolean suffixPadding;
|
||||
|
||||
public OpusSearchConfig() {
|
||||
this.eosTokenId = 0;
|
||||
this.padTokenId = 65000;
|
||||
this.maxSeqLength = 512;
|
||||
this.beam = 6;
|
||||
}
|
||||
|
||||
|
||||
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 int getBeam() {
|
||||
return beam;
|
||||
}
|
||||
|
||||
public void setBeam(int beam) {
|
||||
this.beam = beam;
|
||||
}
|
||||
|
||||
public boolean isSuffixPadding() {
|
||||
return suffixPadding;
|
||||
}
|
||||
|
||||
public void setSuffixPadding(boolean suffixPadding) {
|
||||
this.suffixPadding = suffixPadding;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.smartjavaai.translation.config;
|
||||
|
||||
import cn.smartjavaai.common.config.ModelConfig;
|
||||
import cn.smartjavaai.common.enums.DeviceEnum;
|
||||
|
||||
import cn.smartjavaai.translation.enums.TranslationModeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 机器翻译模型配置
|
||||
* @author lwx
|
||||
* @date 2025/6/05
|
||||
*/
|
||||
@Data
|
||||
public class TranslationModelConfig extends ModelConfig {
|
||||
/**
|
||||
* 翻译模型
|
||||
*/
|
||||
private TranslationModeEnum modelEnum;
|
||||
|
||||
/**
|
||||
* 翻译模型路径
|
||||
*/
|
||||
private String modelPath;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user