Skip to content

Commit

Permalink
[NeoML] Update ISubwordEncoderWithCache (#1123)
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill Golikov <kirill.golikov@abbyy.com>
  • Loading branch information
favorart authored Sep 20, 2024
1 parent c0c1e57 commit 31c4f13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NeoML/src/TraditionalML/SubwordEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ bool ISubwordEncoderWithCache::CCache::Request( const CString& word,
void ISubwordEncoderWithCache::CCache::Add( const CString& word,
const CArray<int>& tokenIds, const CArray<int>& tokenLengths )
{
// If cache is disabled
if( cachePeriod == NotFound ) {
return;
}

NeoAssert( !wordCache.Has( word ) );
NeoAssert( tokenIds.Size() == tokenLengths.Size() );

Expand Down

0 comments on commit 31c4f13

Please sign in to comment.