-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Label, setLogLevel } from "aici" | ||
|
||
const colors = [ | ||
// "red", | ||
// "green", | ||
"blue", | ||
// "violet", | ||
// "white", | ||
// "black", | ||
] | ||
|
||
function gencolors(k) { | ||
let s = [] | ||
|
||
for (let i = 0; i < k; ++i) { | ||
s.push(colors[Math.floor(Math.random() * colors.length)]) | ||
} | ||
|
||
return s.join(", ") | ||
} | ||
|
||
async function countYellow() { | ||
setLogLevel(10) | ||
const q = `Does the color yellow appear in the following list of colors?` | ||
await $`<|user|>\n${q}\n` | ||
const l = new Label() | ||
for (let i = 0; i < 100; ++i) { | ||
const hasYellow = Math.random() < 0.5 | ||
const A = (10 + Math.random() * 100) | 0 | ||
const B = (10 + Math.random() * 130) | 0 | ||
const text = gencolors(A) + (hasYellow ? ", yellow, " : ", blue, ") + gencolors(B) | ||
await l.fixedAfter(`${text}<|end|>\n<|assistant|>`) | ||
const r = await gen({ maxTokens: 10, regex: /(Yes|No)/ }) | ||
console.log(q) | ||
console.log(text) | ||
console.log(hasYellow ? "Yes" : "No", r) | ||
assert(r === "Yes" || r === "No") | ||
assert(r === (hasYellow ? "Yes" : "No")) | ||
await $`\n` | ||
} | ||
} | ||
|
||
start(countYellow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { Label, getTokens, setLogLevel } from "aici" | ||
|
||
function randomInt(min, max) { | ||
return Math.floor(Math.random() * (max - min + 1) + min) | ||
} | ||
|
||
async function countYellow() { | ||
setLogLevel(0) | ||
const q = `Tell me the value of x42?` | ||
await $`<|user|>\n${q}\n` | ||
const l = new Label() | ||
let numok = 0 | ||
for (let i = 0; i < 20; ++i) { | ||
let text = "" | ||
let x42 = randomInt(10, 99) | ||
for (let i = 10; i < 300; ++i) { | ||
text += `The value of x${i} is ${i == 42 ? x42 : randomInt(10, 99)}.\n` | ||
} | ||
await l.fixedAfter(`${text}\nTell me x42.<|end|>\n<|assistant|>The value of x42 is `) | ||
const r = await gen({ maxTokens: 10, regex: /\d\d/ }) | ||
// console.log(q) | ||
// console.log(text) | ||
console.log(getTokens().length, x42, r, r === x42.toString()) | ||
if (r === x42.toString()) { | ||
numok++ | ||
} | ||
// assert(r === x42.toString()) | ||
await $`\n` | ||
} | ||
console.log("numok", numok) | ||
} | ||
|
||
start(countYellow) |
Submodule vllm
updated
4 files
+2 −2 | vllm/attention/ops/prefix_prefill.py | |
+15 −1 | vllm/core/block/block_table.py | |
+6 −5 | vllm/core/block_manager_v2.py | |
+2 −2 | vllm/worker/model_runner.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters