You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Microsoft.SemanticKernel.Connectors.Onnx private async IAsyncEnumerable RunInferenceAsync(ChatHistory chatHistory, PromptExecutionSettings? executionSettings, [EnumeratorCancellation] CancellationToken cancellationToken) the Chinese is not garbled
github-actionsbot
changed the title
Bug:Microsoft.SemanticKernel.Connectors.Onnx private async IAsyncEnumerable<string> RunInferenceAsyncthe Chinese is not garbled
.Net: Bug:Microsoft.SemanticKernel.Connectors.Onnx private async IAsyncEnumerable<string> RunInferenceAsyncthe Chinese is not garbled
Jan 16, 2025
Describe the bug
Microsoft.SemanticKernel.Connectors.Onnx private async IAsyncEnumerable RunInferenceAsync(ChatHistory chatHistory, PromptExecutionSettings? executionSettings, [EnumeratorCancellation] CancellationToken cancellationToken) the Chinese is not garbled
generator.ComputeLogits();
generator.GenerateNextToken();
var outputTokens = generator.GetSequence(0);
var newToken = outputTokens.Slice(outputTokens.Length - 1, 1);
string output = this.GetTokenizer().Decode(newToken);
if (removeNextTokenStartingWithSpace && output[0] == ' ')
{
removeNextTokenStartingWithSpace = false;
output = output.TrimStart();
}
/** After the modification, the Chinese is not garbled
generator.ComputeLogits();
generator.GenerateNextToken();
var outputTokens = generator.GetSequence(0);
var seq = outputTokens[^1];
var _tokenizer = GetTokenizer();
using var tokenizerStream = _tokenizer.CreateStream();
string output = tokenizerStream.Decode(seq);
return output; */
Platform
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: