Closed satpalsr closed 11 months ago
const inference = new HfInference(HF_ACCESS_TOKEN);
It would be good to validate the HF Token here. I am following up vercel ai sdk HF example and want to return an error in case of invalid token.
you can use @huggingface/hub
@huggingface/hub
import { whoAmI } from "@huggingface/hub"; const info = await whoAmI({credentials: {accessToken: "hf_XXX"}}); console.log(info);
const inference = new HfInference(HF_ACCESS_TOKEN);
It would be good to validate the HF Token here. I am following up vercel ai sdk HF example and want to return an error in case of invalid token.