@huggingface/inference
Version:
Typescript client for the Hugging Face Inference Providers and Inference Endpoints
56 lines • 2.63 kB
TypeScript
/**
* See the registered mapping of HF model ID => Fal model ID here:
*
* https://huggingface.co/api/partners/fal-ai/models
*
* This is a publicly available mapping.
*
* If you want to try to run inference for a new model locally before it's registered on huggingface.co,
* you can add it to the dictionary "HARDCODED_MODEL_ID_MAPPING" in consts.ts, for dev purposes.
*
* - If you work at Fal and want to update this mapping, please use the model mapping API we provide on huggingface.co
* - If you're a community member and want to add a new supported HF model to Fal, please open an issue on the present repo
* and we will tag Fal team members.
*
* Thanks!
*/
import type { AutomaticSpeechRecognitionOutput } from "@huggingface/tasks";
import type { BodyParams, HeaderParams, UrlParams } from "../types";
import { type AutomaticSpeechRecognitionTaskHelper, TaskProviderHelper, type TextToImageTaskHelper, type TextToVideoTaskHelper } from "./providerHelper";
export interface FalAiQueueOutput {
request_id: string;
status: string;
response_url: string;
}
interface FalAITextToImageOutput {
images: Array<{
url: string;
}>;
}
export declare const FAL_AI_SUPPORTED_BLOB_TYPES: string[];
declare abstract class FalAITask extends TaskProviderHelper {
constructor(url?: string);
preparePayload(params: BodyParams): Record<string, unknown>;
makeRoute(params: UrlParams): string;
prepareHeaders(params: HeaderParams, binary: boolean): Record<string, string>;
}
export declare class FalAITextToImageTask extends FalAITask implements TextToImageTaskHelper {
preparePayload(params: BodyParams): Record<string, unknown>;
getResponse(response: FalAITextToImageOutput, outputType?: "url" | "blob"): Promise<string | Blob>;
}
export declare class FalAITextToVideoTask extends FalAITask implements TextToVideoTaskHelper {
constructor();
makeRoute(params: UrlParams): string;
preparePayload(params: BodyParams): Record<string, unknown>;
getResponse(response: FalAiQueueOutput, url?: string, headers?: Record<string, string>): Promise<Blob>;
}
export declare class FalAIAutomaticSpeechRecognitionTask extends FalAITask implements AutomaticSpeechRecognitionTaskHelper {
prepareHeaders(params: HeaderParams, binary: boolean): Record<string, string>;
getResponse(response: unknown): Promise<AutomaticSpeechRecognitionOutput>;
}
export declare class FalAITextToSpeechTask extends FalAITask {
preparePayload(params: BodyParams): Record<string, unknown>;
getResponse(response: unknown): Promise<Blob>;
}
export {};
//# sourceMappingURL=fal-ai.d.ts.map