Introduction to AI model with Huggingface.js

Siddharth Murugan
4 min readOct 18, 2024
Hugging face with JavaScript to make AI models

You may be hearing this word AI(Artificial Intelligence) constantly in recent times. But ever had an experience with it in your local machine through JavaScript? Come lets get the AI model working in our local machine with the help of Huggingface.js

Pre-requisites:

  • Have node installed in your machine
  • npm i @huggingface/inference
    npm install node-fetch
  • Create an account in Hugging Face

What is Hugging face?

We can term Hugging Face as the Github of machine learning as it let the developers to upload, find and download pre-trained AI models to do different tasks like image to text, text to image, text to text, etc.

Machine Learning

To understand machine learning let us take an example of writing a program to make the machine understand the hand gesture for the game rock, paper, scissors and predict what hand gesture we are making.

Rock paper scissors image

In traditional way of programming, you may need to give the rules and data to the computers to predict the answers. Writing the rules…

--

--

Siddharth Murugan

Programmer who loves to do things creatively. #automationTester by profession #javascript #nodejs #reactjs