Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions test/modelDependent/llama3.1/tokenBias.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,18 @@ describe("llama 3.1", () => {
for (const token of model.iterateAllTokens()) {
const text = model.detokenize([token]);

if (text.toLowerCase().includes("hello"))
customBias.set(token, -1);
if (text.toLowerCase().includes("well"))
customBias.set(token, -0.99);
else if (text.toLowerCase().includes("hi"))
customBias.set(token, "never");
else if (text.toLowerCase().includes("well"))
customBias.set(token, -0.99);
}

const res = await chatSession.prompt('Greet me by saying "hello" to me', {
const res = await chatSession.prompt('Greet me by saying "hi" to me', {
tokenBias: customBias,
maxTokens: 100
});

expect(res.toLowerCase()).to.not.include("hello");
expect(res.toLowerCase()).to.not.include("well");
expect(res.toLowerCase()).to.not.include("hi ");
expect(res.toLowerCase()).to.not.include("hi.");
});
Expand Down
Loading