@huggingface/tasks 0.20.2 → 0.20.4
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/commonjs/gguf.d.ts +3 -1
- package/dist/commonjs/gguf.d.ts.map +1 -1
- package/dist/commonjs/gguf.js +3 -0
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +3 -1
- package/dist/commonjs/kernel-libraries.d.ts +36 -0
- package/dist/commonjs/kernel-libraries.d.ts.map +1 -0
- package/dist/commonjs/kernel-libraries.js +18 -0
- package/dist/commonjs/local-apps.d.ts +8 -0
- package/dist/commonjs/local-apps.d.ts.map +1 -1
- package/dist/commonjs/local-apps.js +47 -0
- package/dist/commonjs/local-apps.spec.js +51 -0
- package/dist/esm/gguf.d.ts +3 -1
- package/dist/esm/gguf.d.ts.map +1 -1
- package/dist/esm/gguf.js +3 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/kernel-libraries.d.ts +36 -0
- package/dist/esm/kernel-libraries.d.ts.map +1 -0
- package/dist/esm/kernel-libraries.js +15 -0
- package/dist/esm/local-apps.d.ts +8 -0
- package/dist/esm/local-apps.d.ts.map +1 -1
- package/dist/esm/local-apps.js +47 -0
- package/dist/esm/local-apps.spec.js +51 -0
- package/package.json +1 -1
- package/src/gguf.ts +3 -0
- package/src/index.ts +3 -0
- package/src/kernel-libraries.ts +43 -0
- package/src/local-apps.spec.ts +69 -0
- package/src/local-apps.ts +53 -0
package/dist/commonjs/gguf.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare enum GGMLFileQuantizationType {
|
|
|
38
38
|
TQ1_0 = 36,
|
|
39
39
|
TQ2_0 = 37,
|
|
40
40
|
MXFP4_MOE = 38,
|
|
41
|
+
NVFP4 = 39,
|
|
41
42
|
Q2_K_XL = 1000,
|
|
42
43
|
Q3_K_XL = 1001,
|
|
43
44
|
Q4_K_XL = 1002,
|
|
@@ -82,6 +83,7 @@ export declare enum GGMLQuantizationType {
|
|
|
82
83
|
BF16 = 30,
|
|
83
84
|
TQ1_0 = 34,
|
|
84
85
|
TQ2_0 = 35,
|
|
85
|
-
MXFP4 = 39
|
|
86
|
+
MXFP4 = 39,
|
|
87
|
+
NVFP4 = 40
|
|
86
88
|
}
|
|
87
89
|
//# sourceMappingURL=gguf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gguf.d.ts","sourceRoot":"","sources":["../../src/gguf.ts"],"names":[],"mappings":"AAGA,oBAAY,wBAAwB;IACnC,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;IACR,IAAI,IAAI;IACR,aAAa,IAAI;IACjB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,KAAK;IACT,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,IAAI,KAAK;IACT,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,KAAK,KAAK;IACV,KAAK,KAAK;IACV,SAAS,KAAK;
|
|
1
|
+
{"version":3,"file":"gguf.d.ts","sourceRoot":"","sources":["../../src/gguf.ts"],"names":[],"mappings":"AAGA,oBAAY,wBAAwB;IACnC,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;IAC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,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,EAAE,KAAK;IACP,GAAG,KAAK;IACR,GAAG,KAAK;IACR,GAAG,KAAK;IACR,GAAG,KAAK;IACR,KAAK,KAAK;IACV,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;CACV"}
|
package/dist/commonjs/gguf.js
CHANGED
|
@@ -47,6 +47,7 @@ var GGMLFileQuantizationType;
|
|
|
47
47
|
GGMLFileQuantizationType[GGMLFileQuantizationType["TQ1_0"] = 36] = "TQ1_0";
|
|
48
48
|
GGMLFileQuantizationType[GGMLFileQuantizationType["TQ2_0"] = 37] = "TQ2_0";
|
|
49
49
|
GGMLFileQuantizationType[GGMLFileQuantizationType["MXFP4_MOE"] = 38] = "MXFP4_MOE";
|
|
50
|
+
GGMLFileQuantizationType[GGMLFileQuantizationType["NVFP4"] = 39] = "NVFP4";
|
|
50
51
|
// custom quants used by unsloth
|
|
51
52
|
// they are not officially a scheme enum value in GGUF, but only here for naming
|
|
52
53
|
GGMLFileQuantizationType[GGMLFileQuantizationType["Q2_K_XL"] = 1000] = "Q2_K_XL";
|
|
@@ -96,6 +97,7 @@ exports.GGUF_QUANT_ORDER = [
|
|
|
96
97
|
GGMLFileQuantizationType.Q4_2,
|
|
97
98
|
GGMLFileQuantizationType.Q4_3,
|
|
98
99
|
GGMLFileQuantizationType.MXFP4_MOE,
|
|
100
|
+
GGMLFileQuantizationType.NVFP4,
|
|
99
101
|
// 3-bit quantizations
|
|
100
102
|
GGMLFileQuantizationType.Q3_K_XL,
|
|
101
103
|
GGMLFileQuantizationType.Q3_K_L,
|
|
@@ -187,4 +189,5 @@ var GGMLQuantizationType;
|
|
|
187
189
|
GGMLQuantizationType[GGMLQuantizationType["TQ1_0"] = 34] = "TQ1_0";
|
|
188
190
|
GGMLQuantizationType[GGMLQuantizationType["TQ2_0"] = 35] = "TQ2_0";
|
|
189
191
|
GGMLQuantizationType[GGMLQuantizationType["MXFP4"] = 39] = "MXFP4";
|
|
192
|
+
GGMLQuantizationType[GGMLQuantizationType["NVFP4"] = 40] = "NVFP4";
|
|
190
193
|
})(GGMLQuantizationType || (exports.GGMLQuantizationType = GGMLQuantizationType = {}));
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export { LOCAL_APPS } from "./local-apps.js";
|
|
|
19
19
|
export type { LocalApp, LocalAppKey, LocalAppSnippet } from "./local-apps.js";
|
|
20
20
|
export { DATASET_LIBRARIES_UI_ELEMENTS } from "./dataset-libraries.js";
|
|
21
21
|
export type { DatasetLibraryUiElement, DatasetLibraryKey } from "./dataset-libraries.js";
|
|
22
|
+
export { KERNEL_LIBRARIES_UI_ELEMENTS } from "./kernel-libraries.js";
|
|
23
|
+
export type { KernelLibraryKey, KernelLibraryUiElement } from "./kernel-libraries.js";
|
|
22
24
|
export * from "./inference-providers.js";
|
|
23
25
|
export { EVALUATION_FRAMEWORKS } from "./eval.js";
|
|
24
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvF,cAAc,kBAAkB,CAAC;AACjC,OAAO,EACN,aAAa,EACb,cAAc,EACd,KAAK,UAAU,EACf,KAAK,YAAY,E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B,EAC9B,sBAAsB,EACtB,8BAA8B,EAC9B,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,cAAc,WAAW,CAAC;AAE1B,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC3D,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,YAAY,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEtF,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.EVALUATION_FRAMEWORKS = exports.DATASET_LIBRARIES_UI_ELEMENTS = exports.LOCAL_APPS = exports.DEFAULT_MEMORY_OPTIONS = exports.SKUS = exports.getModelInputSnippet = exports.stringifyMessages = exports.stringifyGenerationConfig = exports.inferenceSnippetLanguages = exports.SPECIAL_TOKENS_ATTRIBUTES = exports.MODEL_LIBRARIES_UI_ELEMENTS = exports.ALL_MODEL_LIBRARY_KEYS = exports.ALL_DISPLAY_MODEL_LIBRARY_KEYS = exports.PIPELINE_TYPES_SET = exports.SUBTASK_TYPES = exports.MODALITY_LABELS = exports.MODALITIES = exports.PIPELINE_TYPES = exports.PIPELINE_DATA = exports.MAPPING_DEFAULT_WIDGET = exports.LIBRARY_TASK_MAPPING = void 0;
|
|
17
|
+
exports.EVALUATION_FRAMEWORKS = exports.KERNEL_LIBRARIES_UI_ELEMENTS = exports.DATASET_LIBRARIES_UI_ELEMENTS = exports.LOCAL_APPS = exports.DEFAULT_MEMORY_OPTIONS = exports.SKUS = exports.getModelInputSnippet = exports.stringifyMessages = exports.stringifyGenerationConfig = exports.inferenceSnippetLanguages = exports.SPECIAL_TOKENS_ATTRIBUTES = exports.MODEL_LIBRARIES_UI_ELEMENTS = exports.ALL_MODEL_LIBRARY_KEYS = exports.ALL_DISPLAY_MODEL_LIBRARY_KEYS = exports.PIPELINE_TYPES_SET = exports.SUBTASK_TYPES = exports.MODALITY_LABELS = exports.MODALITIES = exports.PIPELINE_TYPES = exports.PIPELINE_DATA = exports.MAPPING_DEFAULT_WIDGET = exports.LIBRARY_TASK_MAPPING = void 0;
|
|
18
18
|
var library_to_tasks_js_1 = require("./library-to-tasks.js");
|
|
19
19
|
Object.defineProperty(exports, "LIBRARY_TASK_MAPPING", { enumerable: true, get: function () { return library_to_tasks_js_1.LIBRARY_TASK_MAPPING; } });
|
|
20
20
|
var default_widget_inputs_js_1 = require("./default-widget-inputs.js");
|
|
@@ -46,6 +46,8 @@ var local_apps_js_1 = require("./local-apps.js");
|
|
|
46
46
|
Object.defineProperty(exports, "LOCAL_APPS", { enumerable: true, get: function () { return local_apps_js_1.LOCAL_APPS; } });
|
|
47
47
|
var dataset_libraries_js_1 = require("./dataset-libraries.js");
|
|
48
48
|
Object.defineProperty(exports, "DATASET_LIBRARIES_UI_ELEMENTS", { enumerable: true, get: function () { return dataset_libraries_js_1.DATASET_LIBRARIES_UI_ELEMENTS; } });
|
|
49
|
+
var kernel_libraries_js_1 = require("./kernel-libraries.js");
|
|
50
|
+
Object.defineProperty(exports, "KERNEL_LIBRARIES_UI_ELEMENTS", { enumerable: true, get: function () { return kernel_libraries_js_1.KERNEL_LIBRARIES_UI_ELEMENTS; } });
|
|
49
51
|
__exportStar(require("./inference-providers.js"), exports);
|
|
50
52
|
var eval_js_1 = require("./eval.js");
|
|
51
53
|
Object.defineProperty(exports, "EVALUATION_FRAMEWORKS", { enumerable: true, get: function () { return eval_js_1.EVALUATION_FRAMEWORKS; } });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elements configurable by a kernel library.
|
|
3
|
+
*/
|
|
4
|
+
export interface KernelLibraryUiElement {
|
|
5
|
+
/**
|
|
6
|
+
* Pretty name of the library.
|
|
7
|
+
*/
|
|
8
|
+
prettyLabel: string;
|
|
9
|
+
/**
|
|
10
|
+
* Repo name of the library's (usually on GitHub) code repo
|
|
11
|
+
*/
|
|
12
|
+
repoName: string;
|
|
13
|
+
/**
|
|
14
|
+
* URL to library's (usually on GitHub) code repo
|
|
15
|
+
*/
|
|
16
|
+
repoUrl: string;
|
|
17
|
+
/**
|
|
18
|
+
* URL to library's docs
|
|
19
|
+
*/
|
|
20
|
+
docsUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Code snippet(s) displayed
|
|
23
|
+
*/
|
|
24
|
+
snippets?: (kernelId: string, version?: number) => string[];
|
|
25
|
+
}
|
|
26
|
+
export declare const KERNEL_LIBRARIES_UI_ELEMENTS: {
|
|
27
|
+
kernels: {
|
|
28
|
+
prettyLabel: string;
|
|
29
|
+
repoName: string;
|
|
30
|
+
repoUrl: string;
|
|
31
|
+
docsUrl: string;
|
|
32
|
+
snippets: (kernelId: string, version?: number) => string[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type KernelLibraryKey = keyof typeof KERNEL_LIBRARIES_UI_ELEMENTS;
|
|
36
|
+
//# sourceMappingURL=kernel-libraries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-libraries.d.ts","sourceRoot":"","sources":["../../src/kernel-libraries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;CAC5D;AAED,eAAO,MAAM,4BAA4B;;;;;;6BAMlB,MAAM,YAAY,MAAM;;CAQG,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KERNEL_LIBRARIES_UI_ELEMENTS = void 0;
|
|
4
|
+
exports.KERNEL_LIBRARIES_UI_ELEMENTS = {
|
|
5
|
+
kernels: {
|
|
6
|
+
prettyLabel: "Kernels",
|
|
7
|
+
repoName: "Kernels",
|
|
8
|
+
repoUrl: "https://github.com/huggingface/kernels",
|
|
9
|
+
docsUrl: "https://huggingface.co/docs/kernels",
|
|
10
|
+
snippets: (kernelId, version) => [
|
|
11
|
+
`# !pip install kernels
|
|
12
|
+
|
|
13
|
+
from kernels import get_kernel
|
|
14
|
+
|
|
15
|
+
kernel = get_kernel("${kernelId}"${version !== undefined ? `, version=${version}` : ""})`,
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -56,6 +56,7 @@ declare function isTgiModel(model: ModelData): boolean;
|
|
|
56
56
|
declare function isLlamaCppGgufModel(model: ModelData): boolean;
|
|
57
57
|
declare function isVllmModel(model: ModelData): boolean;
|
|
58
58
|
declare function isDockerModelRunnerModel(model: ModelData): boolean;
|
|
59
|
+
declare function isUnslothModel(model: ModelData): boolean;
|
|
59
60
|
/**
|
|
60
61
|
* Add your new local app here.
|
|
61
62
|
*
|
|
@@ -198,6 +199,13 @@ export declare const LOCAL_APPS: {
|
|
|
198
199
|
displayOnModelPage: typeof isLlamaCppGgufModel;
|
|
199
200
|
snippet: (model: ModelData, filepath?: string) => string;
|
|
200
201
|
};
|
|
202
|
+
unsloth: {
|
|
203
|
+
prettyLabel: string;
|
|
204
|
+
docsUrl: string;
|
|
205
|
+
mainTask: "text-generation";
|
|
206
|
+
displayOnModelPage: typeof isUnslothModel;
|
|
207
|
+
snippet: (model: ModelData) => LocalAppSnippet[];
|
|
208
|
+
};
|
|
201
209
|
"docker-model-runner": {
|
|
202
210
|
prettyLabel: string;
|
|
203
211
|
docsUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG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AAE;;;;;;;yBAoF9B,SAAS,KAAG,eAAe,EAAE;;;;;;;yBA7B/B,SAAS,KAAG,eAAe,EAAE;;;;;;;;;;;;;;yBApIzB,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9CjD,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAIpC,SAAS,KAAG,eAAe,EAAE;;;;;;;yBAmRnB,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAM9C,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;yBA3CtD,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;CA0RtC,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
|
@@ -43,6 +43,9 @@ function isAmdRyzenModel(model) {
|
|
|
43
43
|
function isMlxModel(model) {
|
|
44
44
|
return model.tags.includes("mlx");
|
|
45
45
|
}
|
|
46
|
+
function isUnslothModel(model) {
|
|
47
|
+
return model.tags.includes("unsloth") || isLlamaCppGgufModel(model);
|
|
48
|
+
}
|
|
46
49
|
function getQuantTag(filepath) {
|
|
47
50
|
const defaultTag = ":{{QUANT_TAG}}";
|
|
48
51
|
if (!filepath) {
|
|
@@ -115,6 +118,43 @@ const snippetNodeLlamaCppCli = (model, filepath) => {
|
|
|
115
118
|
const snippetOllama = (model, filepath) => {
|
|
116
119
|
return `ollama run hf.co/${model.id}${getQuantTag(filepath)}`;
|
|
117
120
|
};
|
|
121
|
+
const snippetUnsloth = (model) => {
|
|
122
|
+
const isGguf = isLlamaCppGgufModel(model);
|
|
123
|
+
const studio_instructions = {
|
|
124
|
+
title: "Open model in Unsloth Studio",
|
|
125
|
+
setup: ["pip install unsloth", "unsloth studio setup"].join("\n"),
|
|
126
|
+
content: [
|
|
127
|
+
"# Run unsloth studio",
|
|
128
|
+
"unsloth studio -H 0.0.0.0 -p 8000",
|
|
129
|
+
"# Then open http://localhost:8000/chat in your browser",
|
|
130
|
+
"# Search for " + model.id + " to start chatting",
|
|
131
|
+
].join("\n"),
|
|
132
|
+
};
|
|
133
|
+
const hf_spaces_instructions = {
|
|
134
|
+
title: "Using HuggingFace Spaces for Unsloth",
|
|
135
|
+
setup: "# No setup required",
|
|
136
|
+
content: "# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for " +
|
|
137
|
+
model.id +
|
|
138
|
+
" to start chatting",
|
|
139
|
+
};
|
|
140
|
+
const fastmodel_instructions = {
|
|
141
|
+
title: "Load model with FastModel",
|
|
142
|
+
setup: "pip install unsloth",
|
|
143
|
+
content: [
|
|
144
|
+
"from unsloth import FastModel",
|
|
145
|
+
"model, tokenizer = FastModel.from_pretrained(",
|
|
146
|
+
' model_name="' + model.id + '",',
|
|
147
|
+
" max_seq_length=2048,",
|
|
148
|
+
")",
|
|
149
|
+
].join("\n"),
|
|
150
|
+
};
|
|
151
|
+
if (isGguf) {
|
|
152
|
+
return [studio_instructions, hf_spaces_instructions];
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
return [studio_instructions, hf_spaces_instructions, fastmodel_instructions];
|
|
156
|
+
}
|
|
157
|
+
};
|
|
118
158
|
const snippetLocalAI = (model, filepath) => {
|
|
119
159
|
const command = (binary) => ["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n");
|
|
120
160
|
return [
|
|
@@ -539,6 +579,13 @@ exports.LOCAL_APPS = {
|
|
|
539
579
|
displayOnModelPage: isLlamaCppGgufModel,
|
|
540
580
|
snippet: snippetOllama,
|
|
541
581
|
},
|
|
582
|
+
unsloth: {
|
|
583
|
+
prettyLabel: "Unsloth",
|
|
584
|
+
docsUrl: "https://unsloth.ai/docs",
|
|
585
|
+
mainTask: "text-generation",
|
|
586
|
+
displayOnModelPage: isUnslothModel,
|
|
587
|
+
snippet: snippetUnsloth,
|
|
588
|
+
},
|
|
542
589
|
"docker-model-runner": {
|
|
543
590
|
prettyLabel: "Docker Model Runner",
|
|
544
591
|
docsUrl: "https://docs.docker.com/ai/model-runner/",
|
|
@@ -137,4 +137,55 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
|
137
137
|
const snippet = snippetFunc(model);
|
|
138
138
|
(0, vitest_1.expect)(snippet).toEqual(`docker model run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
|
|
139
139
|
});
|
|
140
|
+
(0, vitest_1.it)("unsloth tagged model", async () => {
|
|
141
|
+
const { displayOnModelPage, snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS.unsloth;
|
|
142
|
+
const model = {
|
|
143
|
+
id: "some-user/my-unsloth-finetune",
|
|
144
|
+
tags: ["unsloth", "conversational"],
|
|
145
|
+
inference: "",
|
|
146
|
+
};
|
|
147
|
+
(0, vitest_1.expect)(displayOnModelPage(model)).toBe(true);
|
|
148
|
+
const snippet = snippetFunc(model);
|
|
149
|
+
(0, vitest_1.expect)(snippet[0].setup).toBe("pip install unsloth\nunsloth studio setup");
|
|
150
|
+
(0, vitest_1.expect)(snippet[0].content).toBe("# Run unsloth studio\nunsloth studio -H 0.0.0.0 -p 8000\n# Then open http://localhost:8000/chat in your browser\n# Search for some-user/my-unsloth-finetune to start chatting");
|
|
151
|
+
(0, vitest_1.expect)(snippet[1].setup).toBe("# No setup required");
|
|
152
|
+
(0, vitest_1.expect)(snippet[1].content).toBe("# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for some-user/my-unsloth-finetune to start chatting");
|
|
153
|
+
(0, vitest_1.expect)(snippet[2].setup).toBe("pip install unsloth");
|
|
154
|
+
(0, vitest_1.expect)(snippet[2].content).toBe('from unsloth import FastModel\nmodel, tokenizer = FastModel.from_pretrained(\n model_name="some-user/my-unsloth-finetune",\n max_seq_length=2048,\n)');
|
|
155
|
+
});
|
|
156
|
+
(0, vitest_1.it)("unsloth namespace gguf model", async () => {
|
|
157
|
+
const { displayOnModelPage, snippet: snippetFunc } = local_apps_js_1.LOCAL_APPS.unsloth;
|
|
158
|
+
const model = {
|
|
159
|
+
id: "unsloth/Llama-3.2-3B-Instruct-GGUF",
|
|
160
|
+
tags: ["conversational"],
|
|
161
|
+
gguf: { total: 1, context_length: 4096 },
|
|
162
|
+
inference: "",
|
|
163
|
+
};
|
|
164
|
+
(0, vitest_1.expect)(displayOnModelPage(model)).toBe(true);
|
|
165
|
+
const snippet = snippetFunc(model);
|
|
166
|
+
(0, vitest_1.expect)(snippet[0].setup).toBe("pip install unsloth\nunsloth studio setup");
|
|
167
|
+
(0, vitest_1.expect)(snippet[0].content).toBe("# Run unsloth studio\nunsloth studio -H 0.0.0.0 -p 8000\n# Then open http://localhost:8000/chat in your browser\n# Search for unsloth/Llama-3.2-3B-Instruct-GGUF to start chatting");
|
|
168
|
+
(0, vitest_1.expect)(snippet[1].setup).toBe("# No setup required");
|
|
169
|
+
(0, vitest_1.expect)(snippet[1].content).toBe("# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for unsloth/Llama-3.2-3B-Instruct-GGUF to start chatting");
|
|
170
|
+
(0, vitest_1.expect)(snippet).toHaveLength(2); // GGUF models only get 2 snippets
|
|
171
|
+
});
|
|
172
|
+
(0, vitest_1.it)("non unsloth namespace gguf model", async () => {
|
|
173
|
+
const { displayOnModelPage } = local_apps_js_1.LOCAL_APPS.unsloth;
|
|
174
|
+
const model = {
|
|
175
|
+
id: "dummy/Llama-3.2-3B-Instruct-GGUF",
|
|
176
|
+
tags: ["conversational"],
|
|
177
|
+
gguf: { total: 1, context_length: 4096 },
|
|
178
|
+
inference: "",
|
|
179
|
+
};
|
|
180
|
+
(0, vitest_1.expect)(displayOnModelPage(model)).toBe(true);
|
|
181
|
+
});
|
|
182
|
+
(0, vitest_1.it)("unsloth not shown for unrelated model", async () => {
|
|
183
|
+
const { displayOnModelPage } = local_apps_js_1.LOCAL_APPS.unsloth;
|
|
184
|
+
const model = {
|
|
185
|
+
id: "meta-llama/Llama-3.2-3B-Instruct",
|
|
186
|
+
tags: ["conversational"],
|
|
187
|
+
inference: "",
|
|
188
|
+
};
|
|
189
|
+
(0, vitest_1.expect)(displayOnModelPage(model)).toBe(false);
|
|
190
|
+
});
|
|
140
191
|
});
|
package/dist/esm/gguf.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare enum GGMLFileQuantizationType {
|
|
|
38
38
|
TQ1_0 = 36,
|
|
39
39
|
TQ2_0 = 37,
|
|
40
40
|
MXFP4_MOE = 38,
|
|
41
|
+
NVFP4 = 39,
|
|
41
42
|
Q2_K_XL = 1000,
|
|
42
43
|
Q3_K_XL = 1001,
|
|
43
44
|
Q4_K_XL = 1002,
|
|
@@ -82,6 +83,7 @@ export declare enum GGMLQuantizationType {
|
|
|
82
83
|
BF16 = 30,
|
|
83
84
|
TQ1_0 = 34,
|
|
84
85
|
TQ2_0 = 35,
|
|
85
|
-
MXFP4 = 39
|
|
86
|
+
MXFP4 = 39,
|
|
87
|
+
NVFP4 = 40
|
|
86
88
|
}
|
|
87
89
|
//# sourceMappingURL=gguf.d.ts.map
|
package/dist/esm/gguf.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gguf.d.ts","sourceRoot":"","sources":["../../src/gguf.ts"],"names":[],"mappings":"AAGA,oBAAY,wBAAwB;IACnC,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;IACR,IAAI,IAAI;IACR,aAAa,IAAI;IACjB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,KAAK;IACT,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,IAAI,KAAK;IACT,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,KAAK,KAAK;IACV,KAAK,KAAK;IACV,SAAS,KAAK;
|
|
1
|
+
{"version":3,"file":"gguf.d.ts","sourceRoot":"","sources":["../../src/gguf.ts"],"names":[],"mappings":"AAGA,oBAAY,wBAAwB;IACnC,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;IACR,IAAI,IAAI;IACR,aAAa,IAAI;IACjB,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,KAAK;IACT,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,IAAI,KAAK;IACT,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,QAAQ,KAAK;IACb,KAAK,KAAK;IACV,KAAK,KAAK;IACV,SAAS,KAAK;IACd,KAAK,KAAK;IAIV,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;IACd,OAAO,OAAO;CACd;AAGD,eAAO,MAAM,aAAa,QAEzB,CAAC;AACF,eAAO,MAAM,oBAAoB,QAAiC,CAAC;AAEnE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGrE;AAKD,eAAO,MAAM,gBAAgB,EAAE,wBAAwB,EA2DtD,CAAC;AAIF,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,wBAAwB,EAC/B,eAAe,EAAE,wBAAwB,EAAE,GACzC,wBAAwB,GAAG,SAAS,CAmCtC;AAGD,oBAAY,oBAAoB;IAC/B,GAAG,IAAI;IACP,GAAG,IAAI;IACP,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,IAAI;IACR,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,IAAI,KAAK;IACT,OAAO,KAAK;IACZ,MAAM,KAAK;IACX,OAAO,KAAK;IACZ,KAAK,KAAK;IACV,MAAM,KAAK;IACX,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,EAAE,KAAK;IACP,GAAG,KAAK;IACR,GAAG,KAAK;IACR,GAAG,KAAK;IACR,GAAG,KAAK;IACR,KAAK,KAAK;IACV,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;CACV"}
|
package/dist/esm/gguf.js
CHANGED
|
@@ -42,6 +42,7 @@ export var GGMLFileQuantizationType;
|
|
|
42
42
|
GGMLFileQuantizationType[GGMLFileQuantizationType["TQ1_0"] = 36] = "TQ1_0";
|
|
43
43
|
GGMLFileQuantizationType[GGMLFileQuantizationType["TQ2_0"] = 37] = "TQ2_0";
|
|
44
44
|
GGMLFileQuantizationType[GGMLFileQuantizationType["MXFP4_MOE"] = 38] = "MXFP4_MOE";
|
|
45
|
+
GGMLFileQuantizationType[GGMLFileQuantizationType["NVFP4"] = 39] = "NVFP4";
|
|
45
46
|
// custom quants used by unsloth
|
|
46
47
|
// they are not officially a scheme enum value in GGUF, but only here for naming
|
|
47
48
|
GGMLFileQuantizationType[GGMLFileQuantizationType["Q2_K_XL"] = 1000] = "Q2_K_XL";
|
|
@@ -91,6 +92,7 @@ export const GGUF_QUANT_ORDER = [
|
|
|
91
92
|
GGMLFileQuantizationType.Q4_2,
|
|
92
93
|
GGMLFileQuantizationType.Q4_3,
|
|
93
94
|
GGMLFileQuantizationType.MXFP4_MOE,
|
|
95
|
+
GGMLFileQuantizationType.NVFP4,
|
|
94
96
|
// 3-bit quantizations
|
|
95
97
|
GGMLFileQuantizationType.Q3_K_XL,
|
|
96
98
|
GGMLFileQuantizationType.Q3_K_L,
|
|
@@ -182,4 +184,5 @@ export var GGMLQuantizationType;
|
|
|
182
184
|
GGMLQuantizationType[GGMLQuantizationType["TQ1_0"] = 34] = "TQ1_0";
|
|
183
185
|
GGMLQuantizationType[GGMLQuantizationType["TQ2_0"] = 35] = "TQ2_0";
|
|
184
186
|
GGMLQuantizationType[GGMLQuantizationType["MXFP4"] = 39] = "MXFP4";
|
|
187
|
+
GGMLQuantizationType[GGMLQuantizationType["NVFP4"] = 40] = "NVFP4";
|
|
185
188
|
})(GGMLQuantizationType || (GGMLQuantizationType = {}));
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ export { LOCAL_APPS } from "./local-apps.js";
|
|
|
19
19
|
export type { LocalApp, LocalAppKey, LocalAppSnippet } from "./local-apps.js";
|
|
20
20
|
export { DATASET_LIBRARIES_UI_ELEMENTS } from "./dataset-libraries.js";
|
|
21
21
|
export type { DatasetLibraryUiElement, DatasetLibraryKey } from "./dataset-libraries.js";
|
|
22
|
+
export { KERNEL_LIBRARIES_UI_ELEMENTS } from "./kernel-libraries.js";
|
|
23
|
+
export type { KernelLibraryKey, KernelLibraryUiElement } from "./kernel-libraries.js";
|
|
22
24
|
export * from "./inference-providers.js";
|
|
23
25
|
export { EVALUATION_FRAMEWORKS } from "./eval.js";
|
|
24
26
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACvF,cAAc,kBAAkB,CAAC;AACjC,OAAO,EACN,aAAa,EACb,cAAc,EACd,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,UAAU,EACV,eAAe,EACf,aAAa,EACb,kBAAkB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,8BAA8B,EAC9B,sBAAsB,EACtB,2BAA2B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC9E,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzF,YAAY,EACX,aAAa,EACb,sBAAsB,EACtB,gCAAgC,EAChC,8BAA8B,EAC9B,kCAAkC,EAClC,uBAAuB,EACvB,sBAAsB,EACtB,oCAAoC,EACpC,gCAAgC,EAChC,2BAA2B,EAC3B,gCAAgC,EAChC,8BAA8B,EAC9B,sBAAsB,EACtB,8BAA8B,EAC9B,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,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AAwB,CAAC;AACvE,YAAY,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEtF,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -9,5 +9,6 @@ export { inferenceSnippetLanguages, stringifyGenerationConfig, stringifyMessages
|
|
|
9
9
|
export { SKUS, DEFAULT_MEMORY_OPTIONS } from "./hardware.js";
|
|
10
10
|
export { LOCAL_APPS } from "./local-apps.js";
|
|
11
11
|
export { DATASET_LIBRARIES_UI_ELEMENTS } from "./dataset-libraries.js";
|
|
12
|
+
export { KERNEL_LIBRARIES_UI_ELEMENTS } from "./kernel-libraries.js";
|
|
12
13
|
export * from "./inference-providers.js";
|
|
13
14
|
export { EVALUATION_FRAMEWORKS } from "./eval.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elements configurable by a kernel library.
|
|
3
|
+
*/
|
|
4
|
+
export interface KernelLibraryUiElement {
|
|
5
|
+
/**
|
|
6
|
+
* Pretty name of the library.
|
|
7
|
+
*/
|
|
8
|
+
prettyLabel: string;
|
|
9
|
+
/**
|
|
10
|
+
* Repo name of the library's (usually on GitHub) code repo
|
|
11
|
+
*/
|
|
12
|
+
repoName: string;
|
|
13
|
+
/**
|
|
14
|
+
* URL to library's (usually on GitHub) code repo
|
|
15
|
+
*/
|
|
16
|
+
repoUrl: string;
|
|
17
|
+
/**
|
|
18
|
+
* URL to library's docs
|
|
19
|
+
*/
|
|
20
|
+
docsUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Code snippet(s) displayed
|
|
23
|
+
*/
|
|
24
|
+
snippets?: (kernelId: string, version?: number) => string[];
|
|
25
|
+
}
|
|
26
|
+
export declare const KERNEL_LIBRARIES_UI_ELEMENTS: {
|
|
27
|
+
kernels: {
|
|
28
|
+
prettyLabel: string;
|
|
29
|
+
repoName: string;
|
|
30
|
+
repoUrl: string;
|
|
31
|
+
docsUrl: string;
|
|
32
|
+
snippets: (kernelId: string, version?: number) => string[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type KernelLibraryKey = keyof typeof KERNEL_LIBRARIES_UI_ELEMENTS;
|
|
36
|
+
//# sourceMappingURL=kernel-libraries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kernel-libraries.d.ts","sourceRoot":"","sources":["../../src/kernel-libraries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;CAC5D;AAED,eAAO,MAAM,4BAA4B;;;;;;6BAMlB,MAAM,YAAY,MAAM;;CAQG,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const KERNEL_LIBRARIES_UI_ELEMENTS = {
|
|
2
|
+
kernels: {
|
|
3
|
+
prettyLabel: "Kernels",
|
|
4
|
+
repoName: "Kernels",
|
|
5
|
+
repoUrl: "https://github.com/huggingface/kernels",
|
|
6
|
+
docsUrl: "https://huggingface.co/docs/kernels",
|
|
7
|
+
snippets: (kernelId, version) => [
|
|
8
|
+
`# !pip install kernels
|
|
9
|
+
|
|
10
|
+
from kernels import get_kernel
|
|
11
|
+
|
|
12
|
+
kernel = get_kernel("${kernelId}"${version !== undefined ? `, version=${version}` : ""})`,
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
};
|
package/dist/esm/local-apps.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare function isTgiModel(model: ModelData): boolean;
|
|
|
56
56
|
declare function isLlamaCppGgufModel(model: ModelData): boolean;
|
|
57
57
|
declare function isVllmModel(model: ModelData): boolean;
|
|
58
58
|
declare function isDockerModelRunnerModel(model: ModelData): boolean;
|
|
59
|
+
declare function isUnslothModel(model: ModelData): boolean;
|
|
59
60
|
/**
|
|
60
61
|
* Add your new local app here.
|
|
61
62
|
*
|
|
@@ -198,6 +199,13 @@ export declare const LOCAL_APPS: {
|
|
|
198
199
|
displayOnModelPage: typeof isLlamaCppGgufModel;
|
|
199
200
|
snippet: (model: ModelData, filepath?: string) => string;
|
|
200
201
|
};
|
|
202
|
+
unsloth: {
|
|
203
|
+
prettyLabel: string;
|
|
204
|
+
docsUrl: string;
|
|
205
|
+
mainTask: "text-generation";
|
|
206
|
+
displayOnModelPage: typeof isUnslothModel;
|
|
207
|
+
snippet: (model: ModelData) => LocalAppSnippet[];
|
|
208
|
+
};
|
|
201
209
|
"docker-model-runner": {
|
|
202
210
|
prettyLabel: string;
|
|
203
211
|
docsUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-apps.d.ts","sourceRoot":"","sources":["../../src/local-apps.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AA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B/B,SAAS,KAAG,eAAe,EAAE;;;;;;;;;;;;;;yBApIzB,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9CjD,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAIpC,SAAS,KAAG,eAAe,EAAE;;;;;;;yBAmRnB,SAAS,aAAa,MAAM,KAAG,MAAM;;;;;;;yBAM9C,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;;;;;;yBA3CtD,SAAS,aAAa,MAAM,KAAG,eAAe,EAAE;;CA0RtC,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC"}
|
package/dist/esm/local-apps.js
CHANGED
|
@@ -40,6 +40,9 @@ function isAmdRyzenModel(model) {
|
|
|
40
40
|
function isMlxModel(model) {
|
|
41
41
|
return model.tags.includes("mlx");
|
|
42
42
|
}
|
|
43
|
+
function isUnslothModel(model) {
|
|
44
|
+
return model.tags.includes("unsloth") || isLlamaCppGgufModel(model);
|
|
45
|
+
}
|
|
43
46
|
function getQuantTag(filepath) {
|
|
44
47
|
const defaultTag = ":{{QUANT_TAG}}";
|
|
45
48
|
if (!filepath) {
|
|
@@ -112,6 +115,43 @@ const snippetNodeLlamaCppCli = (model, filepath) => {
|
|
|
112
115
|
const snippetOllama = (model, filepath) => {
|
|
113
116
|
return `ollama run hf.co/${model.id}${getQuantTag(filepath)}`;
|
|
114
117
|
};
|
|
118
|
+
const snippetUnsloth = (model) => {
|
|
119
|
+
const isGguf = isLlamaCppGgufModel(model);
|
|
120
|
+
const studio_instructions = {
|
|
121
|
+
title: "Open model in Unsloth Studio",
|
|
122
|
+
setup: ["pip install unsloth", "unsloth studio setup"].join("\n"),
|
|
123
|
+
content: [
|
|
124
|
+
"# Run unsloth studio",
|
|
125
|
+
"unsloth studio -H 0.0.0.0 -p 8000",
|
|
126
|
+
"# Then open http://localhost:8000/chat in your browser",
|
|
127
|
+
"# Search for " + model.id + " to start chatting",
|
|
128
|
+
].join("\n"),
|
|
129
|
+
};
|
|
130
|
+
const hf_spaces_instructions = {
|
|
131
|
+
title: "Using HuggingFace Spaces for Unsloth",
|
|
132
|
+
setup: "# No setup required",
|
|
133
|
+
content: "# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for " +
|
|
134
|
+
model.id +
|
|
135
|
+
" to start chatting",
|
|
136
|
+
};
|
|
137
|
+
const fastmodel_instructions = {
|
|
138
|
+
title: "Load model with FastModel",
|
|
139
|
+
setup: "pip install unsloth",
|
|
140
|
+
content: [
|
|
141
|
+
"from unsloth import FastModel",
|
|
142
|
+
"model, tokenizer = FastModel.from_pretrained(",
|
|
143
|
+
' model_name="' + model.id + '",',
|
|
144
|
+
" max_seq_length=2048,",
|
|
145
|
+
")",
|
|
146
|
+
].join("\n"),
|
|
147
|
+
};
|
|
148
|
+
if (isGguf) {
|
|
149
|
+
return [studio_instructions, hf_spaces_instructions];
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
return [studio_instructions, hf_spaces_instructions, fastmodel_instructions];
|
|
153
|
+
}
|
|
154
|
+
};
|
|
115
155
|
const snippetLocalAI = (model, filepath) => {
|
|
116
156
|
const command = (binary) => ["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n");
|
|
117
157
|
return [
|
|
@@ -536,6 +576,13 @@ export const LOCAL_APPS = {
|
|
|
536
576
|
displayOnModelPage: isLlamaCppGgufModel,
|
|
537
577
|
snippet: snippetOllama,
|
|
538
578
|
},
|
|
579
|
+
unsloth: {
|
|
580
|
+
prettyLabel: "Unsloth",
|
|
581
|
+
docsUrl: "https://unsloth.ai/docs",
|
|
582
|
+
mainTask: "text-generation",
|
|
583
|
+
displayOnModelPage: isUnslothModel,
|
|
584
|
+
snippet: snippetUnsloth,
|
|
585
|
+
},
|
|
539
586
|
"docker-model-runner": {
|
|
540
587
|
prettyLabel: "Docker Model Runner",
|
|
541
588
|
docsUrl: "https://docs.docker.com/ai/model-runner/",
|
|
@@ -135,4 +135,55 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
|
135
135
|
const snippet = snippetFunc(model);
|
|
136
136
|
expect(snippet).toEqual(`docker model run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
|
|
137
137
|
});
|
|
138
|
+
it("unsloth tagged model", async () => {
|
|
139
|
+
const { displayOnModelPage, snippet: snippetFunc } = LOCAL_APPS.unsloth;
|
|
140
|
+
const model = {
|
|
141
|
+
id: "some-user/my-unsloth-finetune",
|
|
142
|
+
tags: ["unsloth", "conversational"],
|
|
143
|
+
inference: "",
|
|
144
|
+
};
|
|
145
|
+
expect(displayOnModelPage(model)).toBe(true);
|
|
146
|
+
const snippet = snippetFunc(model);
|
|
147
|
+
expect(snippet[0].setup).toBe("pip install unsloth\nunsloth studio setup");
|
|
148
|
+
expect(snippet[0].content).toBe("# Run unsloth studio\nunsloth studio -H 0.0.0.0 -p 8000\n# Then open http://localhost:8000/chat in your browser\n# Search for some-user/my-unsloth-finetune to start chatting");
|
|
149
|
+
expect(snippet[1].setup).toBe("# No setup required");
|
|
150
|
+
expect(snippet[1].content).toBe("# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for some-user/my-unsloth-finetune to start chatting");
|
|
151
|
+
expect(snippet[2].setup).toBe("pip install unsloth");
|
|
152
|
+
expect(snippet[2].content).toBe('from unsloth import FastModel\nmodel, tokenizer = FastModel.from_pretrained(\n model_name="some-user/my-unsloth-finetune",\n max_seq_length=2048,\n)');
|
|
153
|
+
});
|
|
154
|
+
it("unsloth namespace gguf model", async () => {
|
|
155
|
+
const { displayOnModelPage, snippet: snippetFunc } = LOCAL_APPS.unsloth;
|
|
156
|
+
const model = {
|
|
157
|
+
id: "unsloth/Llama-3.2-3B-Instruct-GGUF",
|
|
158
|
+
tags: ["conversational"],
|
|
159
|
+
gguf: { total: 1, context_length: 4096 },
|
|
160
|
+
inference: "",
|
|
161
|
+
};
|
|
162
|
+
expect(displayOnModelPage(model)).toBe(true);
|
|
163
|
+
const snippet = snippetFunc(model);
|
|
164
|
+
expect(snippet[0].setup).toBe("pip install unsloth\nunsloth studio setup");
|
|
165
|
+
expect(snippet[0].content).toBe("# Run unsloth studio\nunsloth studio -H 0.0.0.0 -p 8000\n# Then open http://localhost:8000/chat in your browser\n# Search for unsloth/Llama-3.2-3B-Instruct-GGUF to start chatting");
|
|
166
|
+
expect(snippet[1].setup).toBe("# No setup required");
|
|
167
|
+
expect(snippet[1].content).toBe("# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for unsloth/Llama-3.2-3B-Instruct-GGUF to start chatting");
|
|
168
|
+
expect(snippet).toHaveLength(2); // GGUF models only get 2 snippets
|
|
169
|
+
});
|
|
170
|
+
it("non unsloth namespace gguf model", async () => {
|
|
171
|
+
const { displayOnModelPage } = LOCAL_APPS.unsloth;
|
|
172
|
+
const model = {
|
|
173
|
+
id: "dummy/Llama-3.2-3B-Instruct-GGUF",
|
|
174
|
+
tags: ["conversational"],
|
|
175
|
+
gguf: { total: 1, context_length: 4096 },
|
|
176
|
+
inference: "",
|
|
177
|
+
};
|
|
178
|
+
expect(displayOnModelPage(model)).toBe(true);
|
|
179
|
+
});
|
|
180
|
+
it("unsloth not shown for unrelated model", async () => {
|
|
181
|
+
const { displayOnModelPage } = LOCAL_APPS.unsloth;
|
|
182
|
+
const model = {
|
|
183
|
+
id: "meta-llama/Llama-3.2-3B-Instruct",
|
|
184
|
+
tags: ["conversational"],
|
|
185
|
+
inference: "",
|
|
186
|
+
};
|
|
187
|
+
expect(displayOnModelPage(model)).toBe(false);
|
|
188
|
+
});
|
|
138
189
|
});
|
package/package.json
CHANGED
package/src/gguf.ts
CHANGED
|
@@ -41,6 +41,7 @@ export enum GGMLFileQuantizationType {
|
|
|
41
41
|
TQ1_0 = 36,
|
|
42
42
|
TQ2_0 = 37,
|
|
43
43
|
MXFP4_MOE = 38,
|
|
44
|
+
NVFP4 = 39,
|
|
44
45
|
|
|
45
46
|
// custom quants used by unsloth
|
|
46
47
|
// they are not officially a scheme enum value in GGUF, but only here for naming
|
|
@@ -99,6 +100,7 @@ export const GGUF_QUANT_ORDER: GGMLFileQuantizationType[] = [
|
|
|
99
100
|
GGMLFileQuantizationType.Q4_2,
|
|
100
101
|
GGMLFileQuantizationType.Q4_3,
|
|
101
102
|
GGMLFileQuantizationType.MXFP4_MOE,
|
|
103
|
+
GGMLFileQuantizationType.NVFP4,
|
|
102
104
|
|
|
103
105
|
// 3-bit quantizations
|
|
104
106
|
GGMLFileQuantizationType.Q3_K_XL,
|
|
@@ -202,4 +204,5 @@ export enum GGMLQuantizationType {
|
|
|
202
204
|
TQ1_0 = 34,
|
|
203
205
|
TQ2_0 = 35,
|
|
204
206
|
MXFP4 = 39,
|
|
207
|
+
NVFP4 = 40,
|
|
205
208
|
}
|
package/src/index.ts
CHANGED
|
@@ -67,6 +67,9 @@ export type { LocalApp, LocalAppKey, LocalAppSnippet } from "./local-apps.js";
|
|
|
67
67
|
export { DATASET_LIBRARIES_UI_ELEMENTS } from "./dataset-libraries.js";
|
|
68
68
|
export type { DatasetLibraryUiElement, DatasetLibraryKey } from "./dataset-libraries.js";
|
|
69
69
|
|
|
70
|
+
export { KERNEL_LIBRARIES_UI_ELEMENTS } from "./kernel-libraries.js";
|
|
71
|
+
export type { KernelLibraryKey, KernelLibraryUiElement } from "./kernel-libraries.js";
|
|
72
|
+
|
|
70
73
|
export * from "./inference-providers.js";
|
|
71
74
|
|
|
72
75
|
export { EVALUATION_FRAMEWORKS } from "./eval.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elements configurable by a kernel library.
|
|
3
|
+
*/
|
|
4
|
+
export interface KernelLibraryUiElement {
|
|
5
|
+
/**
|
|
6
|
+
* Pretty name of the library.
|
|
7
|
+
*/
|
|
8
|
+
prettyLabel: string;
|
|
9
|
+
/**
|
|
10
|
+
* Repo name of the library's (usually on GitHub) code repo
|
|
11
|
+
*/
|
|
12
|
+
repoName: string;
|
|
13
|
+
/**
|
|
14
|
+
* URL to library's (usually on GitHub) code repo
|
|
15
|
+
*/
|
|
16
|
+
repoUrl: string;
|
|
17
|
+
/**
|
|
18
|
+
* URL to library's docs
|
|
19
|
+
*/
|
|
20
|
+
docsUrl?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Code snippet(s) displayed
|
|
23
|
+
*/
|
|
24
|
+
snippets?: (kernelId: string, version?: number) => string[];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const KERNEL_LIBRARIES_UI_ELEMENTS = {
|
|
28
|
+
kernels: {
|
|
29
|
+
prettyLabel: "Kernels",
|
|
30
|
+
repoName: "Kernels",
|
|
31
|
+
repoUrl: "https://github.com/huggingface/kernels",
|
|
32
|
+
docsUrl: "https://huggingface.co/docs/kernels",
|
|
33
|
+
snippets: (kernelId: string, version?: number) => [
|
|
34
|
+
`# !pip install kernels
|
|
35
|
+
|
|
36
|
+
from kernels import get_kernel
|
|
37
|
+
|
|
38
|
+
kernel = get_kernel("${kernelId}"${version !== undefined ? `, version=${version}` : ""})`,
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
} satisfies Record<string, KernelLibraryUiElement>;
|
|
42
|
+
|
|
43
|
+
export type KernelLibraryKey = keyof typeof KERNEL_LIBRARIES_UI_ELEMENTS;
|
package/src/local-apps.spec.ts
CHANGED
|
@@ -150,4 +150,73 @@ curl -X POST "http://localhost:8000/v1/chat/completions" \\
|
|
|
150
150
|
|
|
151
151
|
expect(snippet).toEqual(`docker model run hf.co/bartowski/Llama-3.2-3B-Instruct-GGUF:{{QUANT_TAG}}`);
|
|
152
152
|
});
|
|
153
|
+
|
|
154
|
+
it("unsloth tagged model", async () => {
|
|
155
|
+
const { displayOnModelPage, snippet: snippetFunc } = LOCAL_APPS.unsloth;
|
|
156
|
+
const model: ModelData = {
|
|
157
|
+
id: "some-user/my-unsloth-finetune",
|
|
158
|
+
tags: ["unsloth", "conversational"],
|
|
159
|
+
inference: "",
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
expect(displayOnModelPage(model)).toBe(true);
|
|
163
|
+
const snippet = snippetFunc(model);
|
|
164
|
+
expect(snippet[0].setup).toBe("pip install unsloth\nunsloth studio setup");
|
|
165
|
+
expect(snippet[0].content).toBe(
|
|
166
|
+
"# Run unsloth studio\nunsloth studio -H 0.0.0.0 -p 8000\n# Then open http://localhost:8000/chat in your browser\n# Search for some-user/my-unsloth-finetune to start chatting",
|
|
167
|
+
);
|
|
168
|
+
expect(snippet[1].setup).toBe("# No setup required");
|
|
169
|
+
expect(snippet[1].content).toBe(
|
|
170
|
+
"# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for some-user/my-unsloth-finetune to start chatting",
|
|
171
|
+
);
|
|
172
|
+
expect(snippet[2].setup).toBe("pip install unsloth");
|
|
173
|
+
expect(snippet[2].content).toBe(
|
|
174
|
+
'from unsloth import FastModel\nmodel, tokenizer = FastModel.from_pretrained(\n model_name="some-user/my-unsloth-finetune",\n max_seq_length=2048,\n)',
|
|
175
|
+
);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
it("unsloth namespace gguf model", async () => {
|
|
179
|
+
const { displayOnModelPage, snippet: snippetFunc } = LOCAL_APPS.unsloth;
|
|
180
|
+
const model: ModelData = {
|
|
181
|
+
id: "unsloth/Llama-3.2-3B-Instruct-GGUF",
|
|
182
|
+
tags: ["conversational"],
|
|
183
|
+
gguf: { total: 1, context_length: 4096 },
|
|
184
|
+
inference: "",
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
expect(displayOnModelPage(model)).toBe(true);
|
|
188
|
+
const snippet = snippetFunc(model);
|
|
189
|
+
expect(snippet[0].setup).toBe("pip install unsloth\nunsloth studio setup");
|
|
190
|
+
expect(snippet[0].content).toBe(
|
|
191
|
+
"# Run unsloth studio\nunsloth studio -H 0.0.0.0 -p 8000\n# Then open http://localhost:8000/chat in your browser\n# Search for unsloth/Llama-3.2-3B-Instruct-GGUF to start chatting",
|
|
192
|
+
);
|
|
193
|
+
expect(snippet[1].setup).toBe("# No setup required");
|
|
194
|
+
expect(snippet[1].content).toBe(
|
|
195
|
+
"# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for unsloth/Llama-3.2-3B-Instruct-GGUF to start chatting",
|
|
196
|
+
);
|
|
197
|
+
expect(snippet).toHaveLength(2); // GGUF models only get 2 snippets
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it("non unsloth namespace gguf model", async () => {
|
|
201
|
+
const { displayOnModelPage } = LOCAL_APPS.unsloth;
|
|
202
|
+
const model: ModelData = {
|
|
203
|
+
id: "dummy/Llama-3.2-3B-Instruct-GGUF",
|
|
204
|
+
tags: ["conversational"],
|
|
205
|
+
gguf: { total: 1, context_length: 4096 },
|
|
206
|
+
inference: "",
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
expect(displayOnModelPage(model)).toBe(true);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it("unsloth not shown for unrelated model", async () => {
|
|
213
|
+
const { displayOnModelPage } = LOCAL_APPS.unsloth;
|
|
214
|
+
const model: ModelData = {
|
|
215
|
+
id: "meta-llama/Llama-3.2-3B-Instruct",
|
|
216
|
+
tags: ["conversational"],
|
|
217
|
+
inference: "",
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
expect(displayOnModelPage(model)).toBe(false);
|
|
221
|
+
});
|
|
153
222
|
});
|
package/src/local-apps.ts
CHANGED
|
@@ -115,6 +115,10 @@ function isMlxModel(model: ModelData) {
|
|
|
115
115
|
return model.tags.includes("mlx");
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
function isUnslothModel(model: ModelData) {
|
|
119
|
+
return model.tags.includes("unsloth") || isLlamaCppGgufModel(model);
|
|
120
|
+
}
|
|
121
|
+
|
|
118
122
|
function getQuantTag(filepath?: string): string {
|
|
119
123
|
const defaultTag = ":{{QUANT_TAG}}";
|
|
120
124
|
|
|
@@ -193,6 +197,48 @@ const snippetOllama = (model: ModelData, filepath?: string): string => {
|
|
|
193
197
|
return `ollama run hf.co/${model.id}${getQuantTag(filepath)}`;
|
|
194
198
|
};
|
|
195
199
|
|
|
200
|
+
const snippetUnsloth = (model: ModelData): LocalAppSnippet[] => {
|
|
201
|
+
const isGguf = isLlamaCppGgufModel(model);
|
|
202
|
+
|
|
203
|
+
const studio_instructions: LocalAppSnippet = {
|
|
204
|
+
title: "Open model in Unsloth Studio",
|
|
205
|
+
setup: ["pip install unsloth", "unsloth studio setup"].join("\n"),
|
|
206
|
+
content: [
|
|
207
|
+
"# Run unsloth studio",
|
|
208
|
+
"unsloth studio -H 0.0.0.0 -p 8000",
|
|
209
|
+
"# Then open http://localhost:8000/chat in your browser",
|
|
210
|
+
"# Search for " + model.id + " to start chatting",
|
|
211
|
+
].join("\n"),
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const hf_spaces_instructions: LocalAppSnippet = {
|
|
215
|
+
title: "Using HuggingFace Spaces for Unsloth",
|
|
216
|
+
setup: "# No setup required",
|
|
217
|
+
content:
|
|
218
|
+
"# Open https://huggingface.co/spaces/unsloth/studio in your browser\n# Search for " +
|
|
219
|
+
model.id +
|
|
220
|
+
" to start chatting",
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const fastmodel_instructions: LocalAppSnippet = {
|
|
224
|
+
title: "Load model with FastModel",
|
|
225
|
+
setup: "pip install unsloth",
|
|
226
|
+
content: [
|
|
227
|
+
"from unsloth import FastModel",
|
|
228
|
+
"model, tokenizer = FastModel.from_pretrained(",
|
|
229
|
+
' model_name="' + model.id + '",',
|
|
230
|
+
" max_seq_length=2048,",
|
|
231
|
+
")",
|
|
232
|
+
].join("\n"),
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
if (isGguf) {
|
|
236
|
+
return [studio_instructions, hf_spaces_instructions];
|
|
237
|
+
} else {
|
|
238
|
+
return [studio_instructions, hf_spaces_instructions, fastmodel_instructions];
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
196
242
|
const snippetLocalAI = (model: ModelData, filepath?: string): LocalAppSnippet[] => {
|
|
197
243
|
const command = (binary: string) =>
|
|
198
244
|
["# Load and run the model:", `${binary} huggingface://${model.id}/${filepath ?? "{{GGUF_FILE}}"}`].join("\n");
|
|
@@ -643,6 +689,13 @@ export const LOCAL_APPS = {
|
|
|
643
689
|
displayOnModelPage: isLlamaCppGgufModel,
|
|
644
690
|
snippet: snippetOllama,
|
|
645
691
|
},
|
|
692
|
+
unsloth: {
|
|
693
|
+
prettyLabel: "Unsloth",
|
|
694
|
+
docsUrl: "https://unsloth.ai/docs",
|
|
695
|
+
mainTask: "text-generation",
|
|
696
|
+
displayOnModelPage: isUnslothModel,
|
|
697
|
+
snippet: snippetUnsloth,
|
|
698
|
+
},
|
|
646
699
|
"docker-model-runner": {
|
|
647
700
|
prettyLabel: "Docker Model Runner",
|
|
648
701
|
docsUrl: "https://docs.docker.com/ai/model-runner/",
|