Skip to content

Commit e43fa7f

Browse files
WauplinSBrandeis
authored andcommitted
Fix chatCompletion parameters in e2e test (#1414)
follow-up after #1407 and #1409 cc @coyotte508 Since we use `chatCompletion` and not `summarization` anymore, the payload is not exactly the same. This PR removes `payload.parameters.max_length` and replaces it by `payload.max_tokens`. I've set a low value to avoid long responses (we just want a working example and that's it). Co-authored-by: SBrandeis <[email protected]>
1 parent 3fd6e72 commit e43fa7f

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

e2e/deno/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ if (token) {
1818
const result = await hf.chatCompletion({
1919
model: "meta-llama/Llama-3.2-1B-Instruct",
2020
messages: [{ role: "user", content: "Can you summarize the Eiffel Tower?" }],
21-
parameters: {
22-
max_length: 100,
23-
},
21+
max_tokens: 10,
2422
});
2523

2624
console.log(result);

e2e/svelte/src/routes/+page.svelte

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
const result = await hf.chatCompletion({
1616
model: "meta-llama/Llama-3.2-1B-Instruct",
1717
messages: [{ role: "user", content: "Can you summarize the Eiffel Tower?" }],
18-
parameters: {
19-
max_length: 100,
20-
},
18+
max_tokens: 10,
2119
});
2220
2321
console.log(result);

e2e/ts/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const hf = new InferenceClient(hfToken);
1313
const result = await hf.chatCompletion({
1414
model: "meta-llama/Llama-3.2-1B-Instruct",
1515
messages: [{ role: "user", content: "Can you summarize the Eiffel Tower?" }],
16-
parameters: {
17-
max_length: 100,
18-
},
16+
max_tokens: 10,
1917
});
2018

2119
console.log(result);

0 commit comments

Comments
 (0)