scrimba
AI Engineering
Open-source AI Models
Intro To HuggingFace.js Inference 🤗
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Intro To HuggingFace.js Inference 🤗
AboutCommentsNotes
Intro To HuggingFace.js Inference 🤗
Expand for more info
index.js
run
preview
console
import { HfInference } from '@huggingface/inference'

// Create your Hugging Face Token: https://huggingface.co/settings/tokens
// Set your Hugging Face Token: https://scrimba.com/dashboard#env
// Learn more: https://scrimba.com/links/env-variables
const hf = new HfInference(process.env.HF_TOKEN)

// Hugging Face Inference API docs: https://huggingface.co/docs/huggingface.js/inference/README
Console
/index.html
-8:01