Skip to content

Commit 57cbf36

Browse files
import PROVIDERS_HUB_ORGS from huggingface/inference (#1999)
1 parent 3448a3d commit 57cbf36

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

scripts/inference-providers/scripts/generate.ts

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { PipelineType } from "@huggingface/tasks";
2+
import { PROVIDERS_HUB_ORGS } from "@huggingface/inference";
23
import Handlebars from "handlebars";
34
import * as fs from "node:fs/promises";
45
import * as path from "node:path/posix";
@@ -32,25 +33,6 @@ const HEADERS: Record<string, string> = process.env.HF_TOKEN
3233
? { Authorization: `Bearer ${process.env.HF_TOKEN}` }
3334
: {};
3435

35-
const PROVIDERS_HUB_ORGS: Record<string, string> = {
36-
cerebras: "cerebras",
37-
cohere: "CohereLabs",
38-
"fal-ai": "fal",
39-
"featherless-ai": "featherless-ai",
40-
"fireworks-ai": "fireworks-ai",
41-
groq: "groq",
42-
"hf-inference": "hf-inference",
43-
hyperbolic: "Hyperbolic",
44-
nebius: "nebius",
45-
novita: "novita",
46-
nscale: "nscale",
47-
publicai: "publicai",
48-
replicate: "replicate",
49-
sambanova: "sambanovasystems",
50-
scaleway: "scaleway",
51-
together: "togethercomputer",
52-
"zai-org": "zai-org"
53-
};
5436

5537
const PROVIDERS_URLS: Record<string, string> = {
5638
cerebras: "https://www.cerebras.ai/",
@@ -71,7 +53,8 @@ const PROVIDERS_URLS: Record<string, string> = {
7153
together: "https://together.xyz/",
7254
"zai-org": "https://z.ai/"
7355
};
74-
const INFERENCE_PROVIDERS = Object.keys(PROVIDERS_HUB_ORGS);
56+
//filter PROVIDERS_HUB_ORGS to only include providers that are in PROVIDERS_URLS
57+
const INFERENCE_PROVIDERS = Object.keys(PROVIDERS_HUB_ORGS).filter(provider => PROVIDERS_URLS[provider]);
7558

7659
async function authFetchJson(url: string) {
7760
const headers = url.includes("huggingface.co") ? HEADERS : {};

0 commit comments

Comments
 (0)