UNPKG

@huggingface/inference

Version:

Typescript client for the Hugging Face Inference Providers and Inference Endpoints

7 lines (4 loc) 271 B
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; const isWebWorker = typeof self === "object" && self.constructor && self.constructor.name === "DedicatedWorkerGlobalScope"; export const isBackend = !isBrowser && !isWebWorker;