Skip to content

Commit

Permalink
'#1823: load new transcription parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif committed Apr 12, 2024
1 parent a22017a commit 8663142
Showing 1 changed file with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public class AudioTranscriptConfig extends AbstractTaskPropertiesConfig {
private static final String MAX_REQUESTS_KEY = "maxConcurrentRequests";
private static final String MIN_WORD_SCORE = "minWordScore";
public static final String HUGGING_FACE_MODEL = "huggingFaceModel";
public static final String WHISPER_MODEL = "whisperModel";
public static final String WAV2VEC2_SERVICE = "wav2vec2Service";
public static final String REMOTE_SERVICE = "remoteServiceAddress";
private static final String GOOGLE_MODEL = "googleModel";
private static final String LANG_AUTO_VAL = "auto";
private static final String SKIP_KNOWN_FILES = "skipKnownFiles";
Expand All @@ -43,7 +45,8 @@ public class AudioTranscriptConfig extends AbstractTaskPropertiesConfig {
private int maxConcurrentRequests;
private float minWordScore = 0.7f;
private String huggingFaceModel;
private String wav2vec2Service;
private String whisperModel;
private String remoteService;
private String googleModel;
private boolean skipKnownFiles = true;

Expand Down Expand Up @@ -109,8 +112,12 @@ public String getHuggingFaceModel() {
return huggingFaceModel;
}

public String getWav2vec2Service() {
return wav2vec2Service;
public String getWhisperModel() {
return whisperModel;
}

public String getRemoteService() {
return remoteService;
}

public String getGoogleModel() {
Expand Down Expand Up @@ -144,9 +151,16 @@ public void processProperties(UTF8Properties properties) {
if (huggingFaceModel != null) {
huggingFaceModel = huggingFaceModel.trim();
}
wav2vec2Service = properties.getProperty(WAV2VEC2_SERVICE);
if (wav2vec2Service != null) {
wav2vec2Service = wav2vec2Service.trim();
whisperModel = properties.getProperty(WHISPER_MODEL);
if (whisperModel != null) {
whisperModel = whisperModel.strip();
}
remoteService = properties.getProperty(REMOTE_SERVICE);
if (remoteService == null) {
remoteService = properties.getProperty(WAV2VEC2_SERVICE);
}
if (remoteService != null) {
remoteService = remoteService.trim();
}
googleModel = properties.getProperty(GOOGLE_MODEL);
if (googleModel != null) {
Expand Down

0 comments on commit 8663142

Please sign in to comment.