Skip to content

Commit 14ba50f

Browse files
committed
fix Reranking if document contains null
1 parent 87059e8 commit 14ba50f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LLama/LLamaReranker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public async Task<IReadOnlyList<float>> GetRelevanceScores(string input, IReadOn
7272

7373
for(var idx = 0; idx < documents.Count; idx++)
7474
{
75-
var docTokens = Context.Tokenize(documents[idx]);
75+
var docTokens = Context.Tokenize(documents[idx] ?? "");
7676
LLamaToken[] tokens = [.. inputTokens, .. docTokens];
7777

7878
if (batch.TokenCount + tokens.Length > Context.ContextSize)

0 commit comments

Comments
 (0)