Skip to content

Commit

Permalink
Renamed exception
Browse files Browse the repository at this point in the history
  • Loading branch information
martindevans committed Sep 4, 2024
1 parent f59b60a commit 846d2dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions LLama/Exceptions/RuntimeError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public LLamaDecodeError(DecodeResult returnCode)
/// <summary>
/// `llama_get_logits_ith` returned null, indicating that the index was invalid
/// </summary>
public class NoLogitsException
public class GetLogitsInvalidIndexException
: RuntimeError
{
/// <summary>
Expand All @@ -70,7 +70,7 @@ public class NoLogitsException
public int Index { get; }

/// <inheritdoc />
public NoLogitsException(int index)
public GetLogitsInvalidIndexException(int index)
: base($"llama_get_logits_ith({index}) returned null")
{
Index = index;
Expand Down
2 changes: 1 addition & 1 deletion LLama/Native/SafeLLamaContextHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ public Span<float> GetLogitsIth(int i)
{
var logits = llama_get_logits_ith(this, i);
if (logits == null)
throw new NoLogitsException(i);
throw new GetLogitsInvalidIndexException(i);

return new Span<float>(logits, model.VocabCount);
}
Expand Down

0 comments on commit 846d2dc

Please sign in to comment.