Skip to content

Commit

Permalink
Bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongkaifu committed Sep 1, 2023
1 parent 4159ef9 commit 716bef2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions Seq2SeqSharp/Corpus/MonoCorpus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,13 @@ public IEnumerator<T> GetEnumerator()
{
var tgtLine = tgtLines[i];

if ((100 * batchIdx / m_batchNumInTotal) > currentBatchPercent)
if (m_batchNumInTotal > 0)
{
Logger.WriteLine($"Processing batch '{batchIdx}/{m_batchNumInTotal}'."); // The '{i}th' record in this batch is: Target = '{tgtLine}'");
currentBatchPercent++;
if ((100 * batchIdx / m_batchNumInTotal) > currentBatchPercent)
{
Logger.WriteLine($"Processing batch '{batchIdx}/{m_batchNumInTotal}'."); // The '{i}th' record in this batch is: Target = '{tgtLine}'");
currentBatchPercent++;
}
}

SntPair sntPair = new SntPair(tgtLine, tgtLine);
Expand Down
9 changes: 6 additions & 3 deletions Seq2SeqSharp/Corpus/ParallelCorpus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,13 @@ public IEnumerator<T> GetEnumerator()
var srcLine = srcLines[i];
var tgtLine = tgtLines[i];

if ((100 * batchIdx / m_batchNumInTotal) > currentBatchPercent)
if (m_batchNumInTotal > 0)
{
Logger.WriteLine($"Processing batch '{batchIdx}/{m_batchNumInTotal}'."); // The '{i}th' record in this batch is: Source = '{srcLine}' Target = '{tgtLine}'");
currentBatchPercent++;
if ((100 * batchIdx / m_batchNumInTotal) > currentBatchPercent)
{
Logger.WriteLine($"Processing batch '{batchIdx}/{m_batchNumInTotal}'."); // The '{i}th' record in this batch is: Source = '{srcLine}' Target = '{tgtLine}'");
currentBatchPercent++;
}
}

SntPair sntPair = new SntPair(srcLine, tgtLine);
Expand Down

0 comments on commit 716bef2

Please sign in to comment.