The THONKening

This commit is contained in:
Cohee
2025-01-23 02:52:52 +02:00
parent 6fef696268
commit afae8d02be
10 changed files with 130 additions and 49 deletions

View File

@ -986,6 +986,7 @@ export async function generateTextGenWithStreaming(generate_data, signal) {
let logprobs = null;
const swipes = [];
const toolCalls = [];
const state = {};
while (true) {
const { done, value } = await reader.read();
if (done) return;
@ -1004,7 +1005,7 @@ export async function generateTextGenWithStreaming(generate_data, signal) {
logprobs = parseTextgenLogprobs(newText, data.choices?.[0]?.logprobs || data?.completion_probabilities);
}
yield { text, swipes, logprobs, toolCalls };
yield { text, swipes, logprobs, toolCalls, state };
}
};
}