File tree 1 file changed +5
-4
lines changed
packages/inference/src/providers
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { BaseConversationalTask , BaseTextGenerationTask } from "./providerHelper" ;
2
- import type { ChatCompletionOutput , TextGenerationOutputFinishReason } from "@huggingface/tasks" ;
2
+ import type { ChatCompletionOutput , TextGenerationOutputFinishReason , TextGenerationOutput } from "@huggingface/tasks" ;
3
3
import { InferenceOutputError } from "../lib/InferenceOutputError" ;
4
+ import type { BodyParams } from "../types" ;
4
5
5
6
interface FeatherlessAITextCompletionOutput extends Omit < ChatCompletionOutput , "choices" > {
6
7
choices : Array < {
@@ -27,9 +28,9 @@ export class FeatherlessAITextGenerationTask extends BaseTextGenerationTask {
27
28
28
29
override preparePayload ( params : BodyParams ) : Record < string , unknown > {
29
30
return {
30
- model : params . model ,
31
31
...params . args ,
32
- ...params . args . parameters ,
32
+ ...( params . args . parameters as Record < string , unknown > ) ,
33
+ model : params . model ,
33
34
prompt : params . args . inputs ,
34
35
} ;
35
36
}
@@ -46,6 +47,6 @@ export class FeatherlessAITextGenerationTask extends BaseTextGenerationTask {
46
47
generated_text : completion . text ,
47
48
} ;
48
49
}
49
- throw new InferenceOutputError ( "Expected Together text generation response format" ) ;
50
+ throw new InferenceOutputError ( "Expected Featherless AI text generation response format" ) ;
50
51
}
51
52
}
You can’t perform that action at this time.
0 commit comments