@@ -34,7 +34,7 @@ import type {
3434 ZeroShotImageClassificationOutput ,
3535} from "@huggingface/tasks" ;
3636import { HF_ROUTER_URL } from "../config.js" ;
37- import { InferenceClientProviderOutputError } from "../error .js" ;
37+ import { InferenceClientProviderOutputError } from "../errors .js" ;
3838import type { TabularClassificationOutput } from "../tasks/tabular/tabularClassification.js" ;
3939import type { BodyParams , RequestArgs , UrlParams } from "../types.js" ;
4040import { toArray } from "../utils/toArray.js" ;
@@ -224,8 +224,7 @@ export class HFInferenceAudioClassificationTask extends HFInferenceTask implemen
224224
225225export class HFInferenceAutomaticSpeechRecognitionTask
226226 extends HFInferenceTask
227- implements AutomaticSpeechRecognitionTaskHelper
228- {
227+ implements AutomaticSpeechRecognitionTaskHelper {
229228 override async getResponse ( response : AutomaticSpeechRecognitionOutput ) : Promise < AutomaticSpeechRecognitionOutput > {
230229 return response ;
231230 }
@@ -234,9 +233,9 @@ export class HFInferenceAutomaticSpeechRecognitionTask
234233 return "data" in args
235234 ? args
236235 : {
237- ...omit ( args , "inputs" ) ,
238- data : args . inputs ,
239- } ;
236+ ...omit ( args , "inputs" ) ,
237+ data : args . inputs ,
238+ } ;
240239 }
241240}
242241
@@ -271,8 +270,7 @@ export class HFInferenceAudioToAudioTask extends HFInferenceTask implements Audi
271270
272271export class HFInferenceDocumentQuestionAnsweringTask
273272 extends HFInferenceTask
274- implements DocumentQuestionAnsweringTaskHelper
275- {
273+ implements DocumentQuestionAnsweringTaskHelper {
276274 override async getResponse (
277275 response : DocumentQuestionAnsweringOutput
278276 ) : Promise < DocumentQuestionAnsweringOutput [ number ] > {
@@ -408,8 +406,7 @@ export class HFInferenceObjectDetectionTask extends HFInferenceTask implements O
408406
409407export class HFInferenceZeroShotImageClassificationTask
410408 extends HFInferenceTask
411- implements ZeroShotImageClassificationTaskHelper
412- {
409+ implements ZeroShotImageClassificationTaskHelper {
413410 override async getResponse ( response : ZeroShotImageClassificationOutput ) : Promise < ZeroShotImageClassificationOutput > {
414411 if ( Array . isArray ( response ) && response . every ( ( x ) => typeof x . label === "string" && typeof x . score === "number" ) ) {
415412 return response ;
@@ -439,20 +436,20 @@ export class HFInferenceQuestionAnsweringTask extends HFInferenceTask implements
439436 if (
440437 Array . isArray ( response )
441438 ? response . every (
442- ( elem ) =>
443- typeof elem === "object" &&
444- ! ! elem &&
445- typeof elem . answer === "string" &&
446- typeof elem . end === "number" &&
447- typeof elem . score === "number" &&
448- typeof elem . start === "number"
449- )
439+ ( elem ) =>
440+ typeof elem === "object" &&
441+ ! ! elem &&
442+ typeof elem . answer === "string" &&
443+ typeof elem . end === "number" &&
444+ typeof elem . score === "number" &&
445+ typeof elem . start === "number"
446+ )
450447 : typeof response === "object" &&
451- ! ! response &&
452- typeof response . answer === "string" &&
453- typeof response . end === "number" &&
454- typeof response . score === "number" &&
455- typeof response . start === "number"
448+ ! ! response &&
449+ typeof response . answer === "string" &&
450+ typeof response . end === "number" &&
451+ typeof response . score === "number" &&
452+ typeof response . start === "number"
456453 ) {
457454 return Array . isArray ( response ) ? response [ 0 ] : response ;
458455 }
@@ -609,8 +606,7 @@ export class HFInferenceTabularClassificationTask extends HFInferenceTask implem
609606
610607export class HFInferenceVisualQuestionAnsweringTask
611608 extends HFInferenceTask
612- implements VisualQuestionAnsweringTaskHelper
613- {
609+ implements VisualQuestionAnsweringTaskHelper {
614610 override async getResponse ( response : VisualQuestionAnsweringOutput ) : Promise < VisualQuestionAnsweringOutput [ number ] > {
615611 if (
616612 Array . isArray ( response ) &&
0 commit comments