svelte-chatbot-test / src /lib /hfClient.ts
ferrywuai's picture
Support user-provided HF token instead of env variable
e26ea41
import { InferenceClient } from "@huggingface/inference";
import { derived } from "svelte/store";
import { token } from "../stores/token";
export const hfClient = derived(token, ($token) => {
return $token.trim() ? new InferenceClient($token.trim()) : null;
});