Skip to content

Commit 69f7430

Browse files
committed
update README
1 parent 0cabcf4 commit 69f7430

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Hugging Face Model Mappings
2+
3+
This repo contains a [mapping](src/models.ts) of Replicate models to Hugging Face models, for use with the [Inference Providers](https://huggingface.co/blog/inference-providers) feature on Hugging Face.
4+
5+
It also includes tooling to keep those mappings up to date using Hugging Face's API.
6+
7+
![screenshot](https://github.com/user-attachments/assets/5c742c5c-b8dd-4830-9a83-e05f5c9402c8)
8+
9+
## Adding a new model
10+
11+
To add a new model mapping, edit the `src/models.ts` file and add the new model to the `inferenceModels` array, like so:
12+
13+
```typescript
14+
{
15+
hfModel: "black-forest-labs/FLUX.1-schnell", // Hugging Face model name
16+
providerModel: "black-forest-labs/flux-schnell", // Replicate model name
17+
task: "text-to-image", // Task name
18+
}
19+
```
20+
21+
To see allowable values for `task`, refer to [huggingface.co/tasks](https://huggingface.co/tasks).
22+
23+
## Updating model mappings
24+
25+
To fetch Replicate model statuses and post updates to the Hugging Face model mappings API:
26+
27+
1. Make sure your user is a member of the [replicate organization](https://huggingface.co/organizations/replicate) on Hugging Face.
28+
1. Create a [Hugging Face token](https://huggingface.co/settings/tokens/new?tokenType=fineGrained). It doesn't need to have any specific permissions.
29+
1. Set the `HF_TOKEN` environment variable.
30+
```bash
31+
export HF_TOKEN=<your-huggingface-token>
32+
```
33+
1. Run this command:
34+
```bash
35+
npm install
36+
npm start
37+
```

0 commit comments

Comments
 (0)