@@ -68,21 +68,21 @@ export async function makeRequestOptions(
68
68
? "hf-token"
69
69
: "provider-key"
70
70
: includeCredentials === "include"
71
- ? "credentials-include"
72
- : "none" ;
71
+ ? "credentials-include"
72
+ : "none" ;
73
73
74
74
const url = endpointUrl
75
75
? chatCompletion
76
76
? endpointUrl + `/v1/chat/completions`
77
77
: endpointUrl
78
78
: makeUrl ( {
79
- authMethod,
80
- chatCompletion : chatCompletion ?? false ,
81
- forceTask,
82
- model,
83
- provider : provider ?? "hf-inference" ,
84
- taskHint,
85
- } ) ;
79
+ authMethod,
80
+ chatCompletion : chatCompletion ?? false ,
81
+ forceTask,
82
+ model,
83
+ provider : provider ?? "hf-inference" ,
84
+ taskHint,
85
+ } ) ;
86
86
87
87
const headers : Record < string , string > = { } ;
88
88
if ( accessToken ) {
@@ -131,11 +131,11 @@ export async function makeRequestOptions(
131
131
body : binary
132
132
? args . data
133
133
: JSON . stringify ( {
134
- ...otherArgs ,
135
- ...( chatCompletion || provider === "together" || provider === "nebius" || provider === "hyperbolic"
136
- ? { model }
137
- : undefined ) ,
138
- } ) ,
134
+ ...otherArgs ,
135
+ ...( chatCompletion || provider === "together" || provider === "nebius" || provider === "hyperbolic"
136
+ ? { model }
137
+ : undefined ) ,
138
+ } ) ,
139
139
...( credentials ? { credentials } : undefined ) ,
140
140
signal : options ?. signal ,
141
141
} ;
@@ -230,9 +230,6 @@ function makeUrl(params: {
230
230
? HF_HUB_INFERENCE_PROXY_TEMPLATE . replace ( "{{PROVIDER}}" , params . provider )
231
231
: HYPERBOLIC_API_BASE_URL ;
232
232
233
- if ( params . taskHint === "text-generation" ) {
234
- return `${ baseUrl } /v1/chat/completions` ;
235
- }
236
233
if ( params . taskHint === "text-to-image" ) {
237
234
return `${ baseUrl } /v1/images/generations` ;
238
235
}
0 commit comments