@huggingface/tasks 0.10.4 → 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5738,11 +5738,20 @@ function isGgufModel(model) {
5738
5738
  return model.tags.includes("gguf");
5739
5739
  }
5740
5740
  var snippetLlamacpp = (model) => {
5741
- return `./main \\
5741
+ return [
5742
+ `
5743
+ ## Install and build llama.cpp with curl support
5744
+ git clone https://github.com/ggerganov/llama.cpp.git
5745
+ cd llama.cpp
5746
+ LLAMA_CURL=1 make
5747
+ `,
5748
+ `## Load and run the model
5749
+ ./main \\
5742
5750
  --hf-repo "${model.id}" \\
5743
5751
  -m file.gguf \\
5744
- -p "I believe the meaning of life is " \\
5745
- -n 128`;
5752
+ -p "I believe the meaning of life is" \\
5753
+ -n 128`
5754
+ ];
5746
5755
  };
5747
5756
  var LOCAL_APPS = {
5748
5757
  "llama.cpp": {
@@ -5767,10 +5776,9 @@ var LOCAL_APPS = {
5767
5776
  deeplink: (model) => new URL(`jan://models/huggingface/${model.id}`)
5768
5777
  },
5769
5778
  backyard: {
5770
- prettyLabel: "Backyard",
5779
+ prettyLabel: "Backyard AI",
5771
5780
  docsUrl: "https://backyard.ai",
5772
5781
  mainTask: "text-generation",
5773
- macOSOnly: true,
5774
5782
  displayOnModelPage: isGgufModel,
5775
5783
  deeplink: (model) => new URL(`https://backyard.ai/hf/model/${model.id}`)
5776
5784
  },
@@ -5779,12 +5787,14 @@ var LOCAL_APPS = {
5779
5787
  docsUrl: "https://drawthings.ai",
5780
5788
  mainTask: "text-to-image",
5781
5789
  macOSOnly: true,
5782
- comingSoon: true,
5783
- /**
5784
- * random function, will need to refine the actual conditions:
5785
- */
5786
- displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
5787
- deeplink: (model) => new URL(`drawthings://open_from_hf?model=${model.id}`)
5790
+ displayOnModelPage: (model) => model.library_name === "diffusers" && (model.pipeline_tag === "text-to-image" || model.tags.includes("lora")),
5791
+ deeplink: (model) => {
5792
+ if (model.tags.includes("lora")) {
5793
+ return new URL(`https://drawthings.ai/import/diffusers/pipeline.load_lora_weights?repo_id=${model.id}`);
5794
+ } else {
5795
+ return new URL(`https://drawthings.ai/import/diffusers/pipeline.from_pretrained?repo_id=${model.id}`);
5796
+ }
5797
+ }
5788
5798
  },
5789
5799
  diffusionbee: {
5790
5800
  prettyLabel: "DiffusionBee",
package/dist/index.js CHANGED
@@ -5700,11 +5700,20 @@ function isGgufModel(model) {
5700
5700
  return model.tags.includes("gguf");
5701
5701
  }
5702
5702
  var snippetLlamacpp = (model) => {
5703
- return `./main \\
5703
+ return [
5704
+ `
5705
+ ## Install and build llama.cpp with curl support
5706
+ git clone https://github.com/ggerganov/llama.cpp.git
5707
+ cd llama.cpp
5708
+ LLAMA_CURL=1 make
5709
+ `,
5710
+ `## Load and run the model
5711
+ ./main \\
5704
5712
  --hf-repo "${model.id}" \\
5705
5713
  -m file.gguf \\
5706
- -p "I believe the meaning of life is " \\
5707
- -n 128`;
5714
+ -p "I believe the meaning of life is" \\
5715
+ -n 128`
5716
+ ];
5708
5717
  };
5709
5718
  var LOCAL_APPS = {
5710
5719
  "llama.cpp": {
@@ -5729,10 +5738,9 @@ var LOCAL_APPS = {
5729
5738
  deeplink: (model) => new URL(`jan://models/huggingface/${model.id}`)
5730
5739
  },
5731
5740
  backyard: {
5732
- prettyLabel: "Backyard",
5741
+ prettyLabel: "Backyard AI",
5733
5742
  docsUrl: "https://backyard.ai",
5734
5743
  mainTask: "text-generation",
5735
- macOSOnly: true,
5736
5744
  displayOnModelPage: isGgufModel,
5737
5745
  deeplink: (model) => new URL(`https://backyard.ai/hf/model/${model.id}`)
5738
5746
  },
@@ -5741,12 +5749,14 @@ var LOCAL_APPS = {
5741
5749
  docsUrl: "https://drawthings.ai",
5742
5750
  mainTask: "text-to-image",
5743
5751
  macOSOnly: true,
5744
- comingSoon: true,
5745
- /**
5746
- * random function, will need to refine the actual conditions:
5747
- */
5748
- displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
5749
- deeplink: (model) => new URL(`drawthings://open_from_hf?model=${model.id}`)
5752
+ displayOnModelPage: (model) => model.library_name === "diffusers" && (model.pipeline_tag === "text-to-image" || model.tags.includes("lora")),
5753
+ deeplink: (model) => {
5754
+ if (model.tags.includes("lora")) {
5755
+ return new URL(`https://drawthings.ai/import/diffusers/pipeline.load_lora_weights?repo_id=${model.id}`);
5756
+ } else {
5757
+ return new URL(`https://drawthings.ai/import/diffusers/pipeline.from_pretrained?repo_id=${model.id}`);
5758
+ }
5759
+ }
5750
5760
  },
5751
5761
  diffusionbee: {
5752
5762
  prettyLabel: "DiffusionBee",
@@ -34,7 +34,7 @@ export type LocalApp = {
34
34
  /**
35
35
  * And if not (mostly llama.cpp), snippet to copy/paste in your terminal
36
36
  */
37
- snippet: (model: ModelData) => string;
37
+ snippet: (model: ModelData) => string | string[];
38
38
  });
39
39
  declare function isGgufModel(model: ModelData): boolean;
40
40
  /**
@@ -54,7 +54,7 @@ export declare const LOCAL_APPS: {
54
54
  docsUrl: string;
55
55
  mainTask: "text-generation";
56
56
  displayOnModelPage: typeof isGgufModel;
57
- snippet: (model: ModelData) => string;
57
+ snippet: (model: ModelData) => string[];
58
58
  };
59
59
  lmstudio: {
60
60
  prettyLabel: string;
@@ -74,7 +74,6 @@ export declare const LOCAL_APPS: {
74
74
  prettyLabel: string;
75
75
  docsUrl: string;
76
76
  mainTask: "text-generation";
77
- macOSOnly: true;
78
77
  displayOnModelPage: typeof isGgufModel;
79
78
  deeplink: (model: ModelData) => URL;
80
79
  };
@@ -83,10 +82,6 @@ export declare const LOCAL_APPS: {
83
82
  docsUrl: string;
84
83
  mainTask: "text-to-image";
85
84
  macOSOnly: true;
86
- comingSoon: true;
87
- /**
88
- * random function, will need to refine the actual conditions:
89
- */
90
85
  displayOnModelPage: (model: ModelData) => boolean;
91
86
  deeplink: (model: ModelData) => URL;
92
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;CAClD,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC;CACnC,GACD;IACA;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC;CACrC,CACH,CAAC;AAEF,iBAAS,WAAW,CAAC,KAAK,EAAE,SAAS,WAEpC;AAUD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU;;;;;;yBAnBS,SAAS,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuDhD;;WAEG;;;;;;;;;;;;;CAa+B,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;CAClD,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,GAAG,CAAC;CACnC,GACD;IACA;;OAEG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,GAAG,MAAM,EAAE,CAAC;CAChD,CACH,CAAC;AAEF,iBAAS,WAAW,CAAC,KAAK,EAAE,SAAS,WAEpC;AAmBD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU;;;;;;yBA5BS,SAAS,KAAG,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFhB,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@huggingface/tasks",
3
3
  "packageManager": "pnpm@8.10.5",
4
- "version": "0.10.4",
4
+ "version": "0.10.6",
5
5
  "description": "List of ML tasks for huggingface.co/tasks",
6
6
  "repository": "https://github.com/huggingface/huggingface.js.git",
7
7
  "publishConfig": {
package/src/local-apps.ts CHANGED
@@ -38,7 +38,7 @@ export type LocalApp = {
38
38
  /**
39
39
  * And if not (mostly llama.cpp), snippet to copy/paste in your terminal
40
40
  */
41
- snippet: (model: ModelData) => string;
41
+ snippet: (model: ModelData) => string | string[];
42
42
  }
43
43
  );
44
44
 
@@ -46,12 +46,21 @@ function isGgufModel(model: ModelData) {
46
46
  return model.tags.includes("gguf");
47
47
  }
48
48
 
49
- const snippetLlamacpp = (model: ModelData): string => {
50
- return `./main \\
49
+ const snippetLlamacpp = (model: ModelData): string[] => {
50
+ return [
51
+ `
52
+ ## Install and build llama.cpp with curl support
53
+ git clone https://github.com/ggerganov/llama.cpp.git
54
+ cd llama.cpp
55
+ LLAMA_CURL=1 make
56
+ `,
57
+ `## Load and run the model
58
+ ./main \\
51
59
  --hf-repo "${model.id}" \\
52
60
  -m file.gguf \\
53
- -p "I believe the meaning of life is " \\
54
- -n 128`;
61
+ -p "I believe the meaning of life is" \\
62
+ -n 128`,
63
+ ];
55
64
  };
56
65
 
57
66
  /**
@@ -88,10 +97,9 @@ export const LOCAL_APPS = {
88
97
  deeplink: (model) => new URL(`jan://models/huggingface/${model.id}`),
89
98
  },
90
99
  backyard: {
91
- prettyLabel: "Backyard",
100
+ prettyLabel: "Backyard AI",
92
101
  docsUrl: "https://backyard.ai",
93
102
  mainTask: "text-generation",
94
- macOSOnly: true,
95
103
  displayOnModelPage: isGgufModel,
96
104
  deeplink: (model) => new URL(`https://backyard.ai/hf/model/${model.id}`),
97
105
  },
@@ -100,12 +108,15 @@ export const LOCAL_APPS = {
100
108
  docsUrl: "https://drawthings.ai",
101
109
  mainTask: "text-to-image",
102
110
  macOSOnly: true,
103
- comingSoon: true,
104
- /**
105
- * random function, will need to refine the actual conditions:
106
- */
107
- displayOnModelPage: (model) => model.library_name === "diffusers" && model.pipeline_tag === "text-to-image",
108
- deeplink: (model) => new URL(`drawthings://open_from_hf?model=${model.id}`),
111
+ displayOnModelPage: (model) =>
112
+ model.library_name === "diffusers" && (model.pipeline_tag === "text-to-image" || model.tags.includes("lora")),
113
+ deeplink: (model) => {
114
+ if (model.tags.includes("lora")) {
115
+ return new URL(`https://drawthings.ai/import/diffusers/pipeline.load_lora_weights?repo_id=${model.id}`);
116
+ } else {
117
+ return new URL(`https://drawthings.ai/import/diffusers/pipeline.from_pretrained?repo_id=${model.id}`);
118
+ }
119
+ },
109
120
  },
110
121
  diffusionbee: {
111
122
  prettyLabel: "DiffusionBee",