Skip to content

Commit

Permalink
Reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Nov 4, 2024
1 parent 5d57c9f commit 6069efc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ public async Task<IReadOnlyList<ClearMLTask>> GetTasksForQueueAsync(
JsonObject? result = await CallAsync("queues", "get_by_id", body, cancellationToken);
var tasks = (JsonArray?)result?["data"]?["queue"]?["entries"];
IEnumerable<string> taskIds = tasks?.Select(t => (string)t?["task"]!) ?? new List<string>();
var tasksById = await GetTasksByIdAsync(taskIds, cancellationToken);
return tasksById;
return await GetTasksByIdAsync(taskIds, cancellationToken);
}

private async Task<IDictionary<string, string>> PopulateQueueNamesToIdsAsync(
Expand Down
28 changes: 24 additions & 4 deletions src/Serval/test/Serval.E2ETests/ServalApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,18 @@ public async Task NmtQueueMultiple()
const int NUM_WORKERS = 8;
string[] engineIds = new string[NUM_ENGINES];
string[] books = ["MAT.txt", "1JN.txt", "2JN.txt"];
var train_corpus = await _helperClient.MakeParallelTextCorpus(books, "es", "en", false);
var pretranslate_corpus = await _helperClient.MakeParallelTextCorpus(["3JN.txt"], "es", "en", true);
TranslationParallelCorpusConfig train_corpus = await _helperClient.MakeParallelTextCorpus(
books,
"es",
"en",
false
);
TranslationParallelCorpusConfig pretranslate_corpus = await _helperClient.MakeParallelTextCorpus(
["3JN.txt"],
"es",
"en",
true
);
for (int i = 0; i < NUM_ENGINES; i++)
{
_helperClient.InitTranslationBuildConfig();
Expand Down Expand Up @@ -215,8 +225,18 @@ public async Task NmtLargeBatchAndDownload()
TranslationEngine engine = await _helperClient.TranslationEnginesClient.GetAsync(engineId);
Assert.That(engine.IsModelPersisted, Is.True);
string[] books = ["bible_LARGEFILE.txt"];
var train_corpus = await _helperClient.MakeParallelTextCorpus(books, "es", "en", false);
var pretranslate_corpus = await _helperClient.MakeParallelTextCorpus(["3JN.txt"], "es", "en", true);
TranslationParallelCorpusConfig train_corpus = await _helperClient.MakeParallelTextCorpus(
books,
"es",
"en",
false
);
TranslationParallelCorpusConfig pretranslate_corpus = await _helperClient.MakeParallelTextCorpus(
["3JN.txt"],
"es",
"en",
true
);
await _helperClient.AddParallelTextCorpusToEngineAsync(engineId, train_corpus, false);
string cId = await _helperClient.AddParallelTextCorpusToEngineAsync(engineId, pretranslate_corpus, true);
await _helperClient.BuildEngineAsync(engineId);
Expand Down

0 comments on commit 6069efc

Please sign in to comment.