Skip to content

Commit

Permalink
Revert "Put "TrainOnAll" and "PretranslateAll" back in"
Browse files Browse the repository at this point in the history
This reverts commit 70a8282.
  • Loading branch information
johnml1135 committed Oct 11, 2024
1 parent 7b79fbc commit 261dde1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
3 changes: 3 additions & 0 deletions src/Echo/src/EchoTranslationEngine/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

WebApplication app = builder.Build();

// Configure the HTTP request pipeline.
app.UseHttpsRedirection();

app.MapGrpcService<TranslationEngineServiceV1>();
app.MapGrpcService<HealthServiceV1>();

Expand Down
2 changes: 2 additions & 0 deletions src/Machine/src/Serval.Machine.EngineServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

var app = builder.Build();

app.UseHttpsRedirection();

app.MapServalTranslationEngineService();
app.MapHangfireDashboard();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ private static Models.MonolingualCorpus Map(Translation.V1.MonolingualCorpus sou
var pretranslateTextIds = source.PretranslateTextIds.ToHashSet();
FilterChoice pretranslateFilter = GetFilterChoice(pretranslateChapters, pretranslateTextIds);

var corpus = new Models.MonolingualCorpus
return new Models.MonolingualCorpus
{
Id = source.Id,
Language = source.Language,
Expand All @@ -305,17 +305,6 @@ private static Models.MonolingualCorpus Map(Translation.V1.MonolingualCorpus sou
PretranslateChapters = pretranslateFilter == FilterChoice.Chapters ? pretranslateChapters : null,
PretranslateTextIds = pretranslateFilter == FilterChoice.TextIds ? pretranslateTextIds : null
};
if (source.PretranslateAll)
{
corpus.PretranslateChapters = null;
corpus.PretranslateTextIds = null;
}
if (source.TrainOnAll)
{
corpus.TrainOnChapters = null;
corpus.TrainOnTextIds = null;
}
return corpus;
}

private static Models.CorpusFile Map(Translation.V1.CorpusFile source)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ message ParallelCorpus {
message MonolingualCorpus {
string id = 1;
string language = 2;
bool train_on_all = 3;
bool pretranslate_all = 4;
map<string, ScriptureChapters> train_on_chapters = 5;
map<string, ScriptureChapters> pretranslate_chapters = 6;
repeated string train_on_text_ids = 7;
Expand Down
14 changes: 2 additions & 12 deletions src/Serval/src/Serval.Translation/Services/EngineService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -601,12 +601,7 @@ private V1.ParallelCorpus Map(Corpus source, TrainingCorpus? trainingCorpus, Pre
V1.MonolingualCorpus targetCorpus =
new() { Language = source.TargetLanguage, Files = { source.TargetFiles.Select(Map) } };

if (trainingCorpus == null)
{
sourceCorpus.TrainOnAll = true;
targetCorpus.TrainOnAll = true;
}
else
if (trainingCorpus != null)
{
if (trainingCorpus.TextIds is not null && trainingCorpus.ScriptureRange is not null)
{
Expand Down Expand Up @@ -641,12 +636,7 @@ private V1.ParallelCorpus Map(Corpus source, TrainingCorpus? trainingCorpus, Pre
targetCorpus.TrainOnChapters.Add(chapters);
}
}
if (pretranslateCorpus == null)
{
sourceCorpus.PretranslateAll = true;
targetCorpus.PretranslateAll = true;
}
else
if (pretranslateCorpus != null)
{
if (pretranslateCorpus.TextIds is not null && pretranslateCorpus.ScriptureRange is not null)
{
Expand Down

0 comments on commit 261dde1

Please sign in to comment.