Skip to content

An unofficial reverse engineered NodeJS package of Huggingface AI.

License

Notifications You must be signed in to change notification settings

erucix/Huggingface-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Huggingface-API

Extremely lightweight and flexible ;)


huggingface javascript library logo

😊 How To Use?

const hug = require("./hug")
const { env } = require("process")

env.TOKEN = "MY_TOKEN_HERE"    // From cookies
env.HFCHAT = "MY_HFCHAT_HERE" // From cookies

hug("Hello there")
    .then(data => console.log(data))
> Hello! How can I assist you today?

Get your hf-chat and token value from cookies and your'e good to go.

🤔 How to use executables?

First of all set the environment variables as below:

Windows:

  • Downlaod hug_win.exe file from the release page.
  • Get the token and hf-chat from cookies panel and use them as follows.
set TOKEN=YOUR_TOKEN_HERE
set HFCHAT=YOUR_HFCHAT_HERE

Linux and MacOS:

  • Downlaod hug_linux or hug_mac file from the release page.
  • Get the token and hf-chat from cookies panel and use them as follows.
export TOKEN="YOUR_TOKEN_HERE"
export HFCHAT="YOUR_HFCHAT_HERE"

Note: Unofficial and reverse engineered Huggingface API. This software cannot be used for any unlawful activities and commercial purpose.