mirror of
https://github.com/theroyallab/YALS.git
synced 2026-04-20 14:29:47 +00:00
Tree: Format
Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
@@ -339,7 +339,7 @@ export class ReadbackBuffer {
|
||||
const success = await lib.symbols.ReadbackNext(
|
||||
this.bufferPtr,
|
||||
Deno.UnsafePointer.of(outCharPtr),
|
||||
Deno.UnsafePointer.of(outTokenPtr)
|
||||
Deno.UnsafePointer.of(outTokenPtr),
|
||||
);
|
||||
|
||||
if (!success) return null;
|
||||
@@ -351,13 +351,13 @@ export class ReadbackBuffer {
|
||||
// Convert to owned
|
||||
const ownedCharPtr = Deno.UnsafePointer.create(charPtr);
|
||||
if (ownedCharPtr) {
|
||||
char = new Deno.UnsafePointerView(ownedCharPtr).getCString()
|
||||
char = new Deno.UnsafePointerView(ownedCharPtr).getCString();
|
||||
}
|
||||
|
||||
return {
|
||||
kind: "data",
|
||||
text: char,
|
||||
token: outTokenPtr[0]
|
||||
token: outTokenPtr[0],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ for (let i = 0; i < 4; i++) {
|
||||
console.log("NEXT");
|
||||
console.log();
|
||||
|
||||
for await (const chunk of model!.generateGen(prompt, samplerRequest, abort.signal)) {
|
||||
for await (
|
||||
const chunk of model!.generateGen(prompt, samplerRequest, abort.signal)
|
||||
) {
|
||||
if (chunk.kind === "data") {
|
||||
await Deno.stdout.write(encoder.encode(chunk.text));
|
||||
await Deno.stdout.write(encoder.encode(chunk.token));
|
||||
|
||||
Reference in New Issue
Block a user