Skip to content

Commit

Permalink
temporarily ignore TokenUsage
Browse files Browse the repository at this point in the history
  • Loading branch information
dclipca committed Jan 31, 2025
1 parent 3f96330 commit 777fd4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions SpongeEngine.KoboldSharp/KoboldSharpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ public async Task<bool> IsAvailableAsync(CancellationToken cancellationToken = d
var response = await GenerateAsync(koboldRequest, cancellationToken);

// Get token counts using KoboldCpp's token counting API
var promptTokens = await CountTokensAsync(new CountTokensRequest { Prompt = request.Prompt }, cancellationToken);
var responseTokens = await CountTokensAsync(new CountTokensRequest { Prompt = response.Results[0].Text }, cancellationToken);
// var promptTokens = await CountTokensAsync(new CountTokensRequest { Prompt = request.Prompt }, cancellationToken);
// var responseTokens = await CountTokensAsync(new CountTokensRequest { Prompt = response.Results[0].Text }, cancellationToken);

return new TextCompletionResult
{
Text = response.Results[0].Text,
ModelId = request.ModelId,
GenerationTime = DateTime.UtcNow - startTime,
TokenUsage = new TextCompletionTokenUsage
{
PromptTokens = promptTokens.Count,
CompletionTokens = responseTokens.Count,
TotalTokens = promptTokens.Count + responseTokens.Count
}
// TokenUsage = new TextCompletionTokenUsage
// {
// PromptTokens = promptTokens.Count,
// CompletionTokens = responseTokens.Count,
// TotalTokens = promptTokens.Count + responseTokens.Count
// }
};
}
#endregion
Expand Down
2 changes: 1 addition & 1 deletion SpongeEngine.KoboldSharp/SpongeEngine.KoboldSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Package Info -->
<PackageId>SpongeEngine.KoboldSharp</PackageId>
<Title>KoboldSharp</Title>
<Version>1.82.4.3</Version>
<Version>1.82.4.4</Version>
<Authors>Dan Clipca</Authors>
<Company>Sponge Engine</Company>
<Description>C# client for KoboldCpp.</Description>
Expand Down

0 comments on commit 777fd4a

Please sign in to comment.