Skip to content

Commit

Permalink
'#1823: convert UI language to whisper supported language format
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif committed Apr 13, 2024
1 parent 147cdf1 commit 71e125a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ protected Server startServer0(int device) throws IOException {
int cpus = getNumProcessors();
int threads = Runtime.getRuntime().availableProcessors() / cpus;

pb.command(python, script, model, Integer.toString(device), Integer.toString(threads), transcriptConfig.getLanguages().get(0));
String lang = transcriptConfig.getLanguages().get(0);
if (lang.contains("-")) {
lang = lang.substring(0, lang.indexOf("-"));
}

pb.command(python, script, model, Integer.toString(device), Integer.toString(threads), lang);

Process process = pb.start();

Expand Down

0 comments on commit 71e125a

Please sign in to comment.