Content-Length: 295626 | pFad | http://github.com/huggingface/huggingface.js/commit/2413423d3bf2852e31de3aa75f27b6af6b76139b

2D Featherless provider: max_tokens (#1474) · huggingface/huggingface.js@2413423 · GitHub
Skip to content

Commit 2413423

Browse files
pohneanSBrandeis
andauthored
Featherless provider: max_tokens (#1474)
This PR fixes the parameters that are passed into the featherless api, in particular the max_token. --------- Co-authored-by: Simon Brandeis <33657802+SBrandeis@users.noreply.github.com> Co-authored-by: SBrandeis <simon@huggingface.co>
1 parent f181045 commit 2413423

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/inference/src/providers/featherless-ai.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type {
77
import { InferenceOutputError } from "../lib/InferenceOutputError.js";
88
import type { BodyParams } from "../types.js";
99
import { BaseConversationalTask, BaseTextGenerationTask } from "./providerHelper.js";
10+
import { omit } from "../utils/omit.js";
1011

1112
interface FeatherlessAITextCompletionOutput extends Omit<ChatCompletionOutput, "choices"> {
1213
choices: Array<{
@@ -33,9 +34,14 @@ export class FeatherlessAITextGenerationTask extends BaseTextGenerationTask {
3334

3435
override preparePayload(params: BodyParams<TextGenerationInput>): Record<string, unknown> {
3536
return {
36-
...params.args,
37-
...params.args.parameters,
3837
model: params.model,
38+
...omit(params.args, ["inputs", "parameters"]),
39+
...(params.args.parameters
40+
? {
41+
max_tokens: params.args.parameters.max_new_tokens,
42+
...omit(params.args.parameters, "max_new_tokens"),
43+
}
44+
: undefined),
3945
prompt: params.args.inputs,
4046
};
4147
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/huggingface/huggingface.js/commit/2413423d3bf2852e31de3aa75f27b6af6b76139b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy