Skip to content

Commit f77c96c

Browse files
committed
fix: do not count tokens in streaming because it makes streaming too slow
1 parent 273d197 commit f77c96c

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

SpongeEngine.KoboldSharp.Tests/SpongeEngine.KoboldSharp.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Nullable>enable</Nullable>
55
<IsPackable>false</IsPackable>
66
<TargetFrameworks>net8.0;net6.0;net7.0</TargetFrameworks>
7-
<Version>1.85.1</Version>
7+
<Version>1.85.2</Version>
88
</PropertyGroup>
99

1010
<ItemGroup>

SpongeEngine.KoboldSharp/KoboldSharpClient.cs

-3
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,9 @@ public async Task<bool> IsAvailableAsync(CancellationToken cancellationToken = d
8282

8383
await foreach (var token in GenerateStreamAsync(koboldRequest, cancellationToken))
8484
{
85-
var tokenCount = await CountTokensAsync(new CountTokensRequest { Prompt = token }, cancellationToken);
86-
8785
yield return new TextCompletionToken
8886
{
8987
Text = token,
90-
TokenCount = tokenCount.Count
9188
};
9289
}
9390
}

SpongeEngine.KoboldSharp/SpongeEngine.KoboldSharp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- Package Info -->
99
<PackageId>SpongeEngine.KoboldSharp</PackageId>
1010
<Title>KoboldSharp</Title>
11-
<Version>1.85.1</Version>
11+
<Version>1.85.2</Version>
1212
<Authors>Dan Clipca</Authors>
1313
<Company>Sponge Engine</Company>
1414
<Description>C# client for KoboldCpp.</Description>

0 commit comments

Comments
 (0)