webgpu-cluster / src /tasks /types.ts
apssouza22's picture
Deploy: refresh Space build (landing + docs)
9210bde verified
Raw
History Blame Contribute Delete
872 Bytes
import type {ClusterTaskKind} from '../../shared/completeTask';
import type {ObjectDetector} from '../detection/ObjectDetector';
import type {VideoFrameDescriber} from '../videodescription/VideoFrameDescriber';
export type {
ClusterTaskKind,
CompleteTaskBody,
CompleteTaskStatus,
DescribeTaskResult,
TaskErrorResult,
} from '../../shared/completeTask';
export interface HostTaskMessage {
id: string;
kind: ClusterTaskKind;
image_base64: string;
mime_type: string;
threshold?: number;
instruction?: string;
max_new_tokens?: number;
}
export interface ClusterTaskHostContext {
apiBase: string;
getSelectedModelId: () => string;
setStatus: (message: string) => void;
}
export interface ClusterTaskHandlerOptions extends ClusterTaskHostContext {
getDetector: () => ObjectDetector | null;
getDescriber: () => VideoFrameDescriber | null;
}