11import { PipelineType } from "@huggingface/tasks" ;
2+ import { PROVIDERS_HUB_ORGS } from "@huggingface/inference" ;
23import Handlebars from "handlebars" ;
34import * as fs from "node:fs/promises" ;
45import * 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
5537const 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
7659async function authFetchJson ( url : string ) {
7760 const headers = url . includes ( "huggingface.co" ) ? HEADERS : { } ;
0 commit comments