From 2d25a42123937827dd8576e92cb633c2f55a26ea Mon Sep 17 00:00:00 2001 From: Enkidu93 Date: Thu, 14 Sep 2023 17:05:15 -0400 Subject: [PATCH] Pass buildOptions to SMT --ECL --- .../Services/SmtTransferEngineBuildJob.cs | 4 +++- .../Services/SmtTransferEngineService.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SIL.Machine.AspNetCore/Services/SmtTransferEngineBuildJob.cs b/src/SIL.Machine.AspNetCore/Services/SmtTransferEngineBuildJob.cs index 5edc3ac57..7e145d687 100644 --- a/src/SIL.Machine.AspNetCore/Services/SmtTransferEngineBuildJob.cs +++ b/src/SIL.Machine.AspNetCore/Services/SmtTransferEngineBuildJob.cs @@ -38,18 +38,20 @@ ILogger logger public async Task RunAsync( string engineId, string buildId, + string buildOptions, IReadOnlyList corpora, CancellationToken cancellationToken ) { IDistributedReaderWriterLock rwLock = await _lockFactory.CreateAsync(engineId, cancellationToken); - var tokenizer = new LatinWordTokenizer(); var detokenizer = new LatinWordDetokenizer(); ITrainer? smtModelTrainer = null; ITrainer? truecaseTrainer = null; try { + JsonObject? buildOptionsObject = JsonSerializer.Deserialize(buildOptions); //Use/fields TBD + var stopwatch = new Stopwatch(); TranslationEngine? engine; await using (await rwLock.WriterLockAsync(cancellationToken: cancellationToken)) diff --git a/src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs b/src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs index 06d1bf858..ccee66307 100644 --- a/src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs +++ b/src/SIL.Machine.AspNetCore/Services/SmtTransferEngineService.cs @@ -170,6 +170,6 @@ IReadOnlyList corpora ) { // Token "None" is used here because hangfire injects the proper cancellation token - return r => r.RunAsync(engineId, buildId, corpora, CancellationToken.None); //Not passing build options to SMT yet; is there a need? + return r => r.RunAsync(engineId, buildId, buildOptions, corpora, CancellationToken.None); } }