1.0.1 • Published 5 months ago

hfdl v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

🤗 HFDL

A super simple script that can run using npx (or equivalent) in order to download certain files from HuggingFace 🤗

This can be handy when building a Node.js app with transformers.js and Dockerizing that app, for example.

Usage

Create a huggingface.yaml file with the following content:

[MODELNAME]:
  files:
    - [<FILE1>]
    - ...
[ANOTHERMODELNAME]:
  files:
    - [FILE1]
    - [FILE2]
    - ...
...

then run npx hfdl and wait for your files to be downloaded in the cache directory. That's it!

Your Dockerfile could look something like this:

FROM node:lts-alpine
WORKDIR /app
COPY huggingface.yaml ./
RUN npx hfdl
COPY package*.json ./
RUN npm ci
COPY . ./
CMD ['npm', 'run', 'start']

Configuration

NameDescriptionDefault value
HF_YAMLThe location of your yaml filehuggingface.yaml
HF_CACHE_DIRThe location to store the downloaded filescache
HF_CONCURRENCY_LIMITHow many concurrent downloads can take place6
HF_TOKENThe accesstoken to use when accessing private models
1.0.1

5 months ago

1.0.0

5 months ago