update to provide hostport and model on the command line not via env (#465)

This commit is contained in:
Dave Horton
2023-09-13 13:53:00 -04:00
committed by GitHub
parent 6587b1f758
commit 6a8a2aa955
4 changed files with 32 additions and 15 deletions

View File

@@ -230,7 +230,14 @@ class TaskTranscribe extends SttTask {
ep.addCustomEventListener(CobaltTranscriptionEvents.Transcription,
this._onTranscription.bind(this, cs, ep, channel));
/* cobalt doesnt have language, it has model, which is required */
if (!this.data.recognizer.model) {
throw new Error('Cobalt requires a model to be specified');
}
this.language = this.data.recognizer.model;
/* special case: if using hints with cobalt we need to compile them */
this.hostport = opts.COBALT_SERVER_URI;
if (this.vendor === 'cobalt' && opts.COBALT_SPEECH_HINTS) {
try {
const context = await this.compileHintsForCobalt(
@@ -308,7 +315,8 @@ class TaskTranscribe extends SttTask {
interim: this.interim ? true : false,
locale: this.language,
channels: /*this.separateRecognitionPerChannel ? 2 : */ 1,
bugname: this.bugname
bugname: this.bugname,
hostport: this.hostport
});
}