mirror of
https://github.com/geekwenjie/SmartJavaAI.git
synced 2026-09-15 06:19:08 +00:00
新增翻译模块:支持200多语言翻译
This commit is contained in:
@@ -4,7 +4,7 @@ package cn.smartjavaai.translation.config;
|
||||
* @author lwx
|
||||
* @date 2025/6/05
|
||||
*/
|
||||
public class SearchConfig {
|
||||
public class NllbSearchConfig {
|
||||
|
||||
private int maxSeqLength;
|
||||
private long padTokenId;
|
||||
@@ -15,7 +15,7 @@ public class SearchConfig {
|
||||
private long forcedBosTokenId;
|
||||
private long srcLangId;
|
||||
private float lengthPenalty;
|
||||
public SearchConfig() {
|
||||
public NllbSearchConfig() {
|
||||
this.maxSeqLength = 512;
|
||||
this.eosTokenId = 2;
|
||||
this.bosTokenId = 0;
|
||||
@@ -99,4 +99,4 @@ public class SearchConfig {
|
||||
public void setBosTokenId(long bosTokenId) {
|
||||
this.bosTokenId = bosTokenId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package cn.smartjavaai.translation.config;
|
||||
|
||||
import cn.smartjavaai.common.enums.DeviceEnum;
|
||||
|
||||
import cn.smartjavaai.translation.enums.MachineTranslationModeEnum;
|
||||
import cn.smartjavaai.translation.enums.TranslationModeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -11,11 +11,11 @@ import lombok.Data;
|
||||
* @date 2025/6/05
|
||||
*/
|
||||
@Data
|
||||
public class MachineTranslationModelConfig {
|
||||
public class TranslationModelConfig {
|
||||
/**
|
||||
* 翻译模型
|
||||
*/
|
||||
private MachineTranslationModeEnum modelEnum;
|
||||
private TranslationModeEnum modelEnum;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
@@ -26,14 +26,7 @@ public class MachineTranslationModelConfig {
|
||||
* 翻译模型路径
|
||||
*/
|
||||
private String modelPath;
|
||||
/**
|
||||
* 翻译模型路径
|
||||
*/
|
||||
private String modelName;
|
||||
/**
|
||||
* 翻译模型配置
|
||||
*/
|
||||
private SearchConfig searchConfig;
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user