@huggingface/tasks 0.21.31 → 0.21.33

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.
@@ -97,6 +97,11 @@ export declare const EVALUATION_FRAMEWORKS: {
97
97
  readonly description: "MDPBench is a benchmark for evaluating multilingual document parsing across digital, photographed, Latin, and non-Latin document subsets.";
98
98
  readonly url: "https://github.com/Yuliang-Liu/MultimodalOCR";
99
99
  };
100
+ readonly "real5-omnidocbench": {
101
+ readonly name: "real5-omnidocbench";
102
+ readonly description: "Real5-OmniDocBench is a benchmark for evaluating document parsing robustness under five real-world acquisition scenarios: scanning, warping, screen-photography, illumination, and skew.";
103
+ readonly url: "https://huggingface.co/datasets/PaddlePaddle/Real5-OmniDocBench";
104
+ };
100
105
  readonly parsebench: {
101
106
  readonly name: "parsebench";
102
107
  readonly description: "ParseBench is a benchmark for evaluating document parsing systems on real-world enterprise documents across tables, charts, content faithfulness, semantic formatting, and visual grounding.";
@@ -1 +1 @@
1
- {"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../../src/eval.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKxB,CAAC"}
1
+ {"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../../src/eval.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKxB,CAAC"}
@@ -100,6 +100,11 @@ exports.EVALUATION_FRAMEWORKS = {
100
100
  description: "MDPBench is a benchmark for evaluating multilingual document parsing across digital, photographed, Latin, and non-Latin document subsets.",
101
101
  url: "https://github.com/Yuliang-Liu/MultimodalOCR",
102
102
  },
103
+ "real5-omnidocbench": {
104
+ name: "real5-omnidocbench",
105
+ description: "Real5-OmniDocBench is a benchmark for evaluating document parsing robustness under five real-world acquisition scenarios: scanning, warping, screen-photography, illumination, and skew.",
106
+ url: "https://huggingface.co/datasets/PaddlePaddle/Real5-OmniDocBench",
107
+ },
103
108
  parsebench: {
104
109
  name: "parsebench",
105
110
  description: "ParseBench is a benchmark for evaluating document parsing systems on real-world enterprise documents across tables, charts, content faithfulness, semantic formatting, and visual grounding.",
@@ -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;IACd,KAAK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AAI;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;IACV,IAAI,KAAK;IACT,IAAI,KAAK;CACT"}
@@ -60,7 +60,21 @@ var GGMLFileQuantizationType;
60
60
  GGMLFileQuantizationType[GGMLFileQuantizationType["Q8_K_XL"] = 1005] = "Q8_K_XL";
61
61
  })(GGMLFileQuantizationType || (exports.GGMLFileQuantizationType = GGMLFileQuantizationType = {}));
62
62
  const ggufQuants = Object.values(GGMLFileQuantizationType).filter((v) => typeof v === "string");
63
- exports.GGUF_QUANT_RE = new RegExp("(?<prefix>UD-)?" + `(?<quant>${ggufQuants.join("|")})` + "(_(?<sizeVariation>[A-Z]+))?");
63
+ /**
64
+ * Names that show up in GGUF *filenames* without being llama_ftype values.
65
+ *
66
+ * llama.cpp's gpt-oss conversion names its output after the tensor type it repacks the experts to
67
+ * (`GGMLQuantizationType.MXFP4`), while `general.file_type` is `MXFP4_MOE` — see
68
+ * https://github.com/ggml-org/llama.cpp/blob/master/conversion/gpt_oss.py. So the canonical releases
69
+ * are `gpt-oss-{20b,120b}-MXFP4.gguf`, which no `GGMLFileQuantizationType` name matches.
70
+ *
71
+ * Appended last so `MXFP4_MOE` still wins the alternation, instead of matching as `MXFP4` with
72
+ * sizeVariation `MOE`.
73
+ */
74
+ const GGUF_QUANT_FILENAME_ALIASES = ["MXFP4"];
75
+ exports.GGUF_QUANT_RE = new RegExp("(?<prefix>UD-)?" +
76
+ `(?<quant>${[...ggufQuants, ...GGUF_QUANT_FILENAME_ALIASES].join("|")})` +
77
+ "(_(?<sizeVariation>[A-Z]+))?");
64
78
  exports.GGUF_QUANT_RE_GLOBAL = new RegExp(exports.GGUF_QUANT_RE, "g");
65
79
  function parseGGUFQuantLabel(fname) {
66
80
  const quantLabel = fname.toUpperCase().match(exports.GGUF_QUANT_RE_GLOBAL)?.at(-1); // if there is multiple quant substrings in a name, we prefer the last one
@@ -384,7 +384,7 @@ const diffusers_default = (model) => [
384
384
  from diffusers import DiffusionPipeline
385
385
 
386
386
  # switch to "mps" for apple devices
387
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
387
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
388
388
 
389
389
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
390
390
  image = pipe(prompt).images[0]`,
@@ -395,7 +395,7 @@ from diffusers import DiffusionPipeline
395
395
  from diffusers.utils import load_image
396
396
 
397
397
  # switch to "mps" for apple devices
398
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
398
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
399
399
 
400
400
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
401
401
  input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
@@ -408,7 +408,7 @@ from diffusers import DiffusionPipeline
408
408
  from diffusers.utils import load_image, export_to_video
409
409
 
410
410
  # switch to "mps" for apple devices
411
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
411
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
412
412
  pipe.to("cuda")
413
413
 
414
414
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -432,7 +432,7 @@ const diffusers_lora = (model) => [
432
432
  from diffusers import DiffusionPipeline
433
433
 
434
434
  # switch to "mps" for apple devices
435
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
435
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
436
436
  pipe.load_lora_weights("${model.id}")
437
437
 
438
438
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
@@ -444,7 +444,7 @@ from diffusers import DiffusionPipeline
444
444
  from diffusers.utils import load_image
445
445
 
446
446
  # switch to "mps" for apple devices
447
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
447
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
448
448
  pipe.load_lora_weights("${model.id}")
449
449
 
450
450
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
@@ -458,7 +458,7 @@ from diffusers import DiffusionPipeline
458
458
  from diffusers.utils import export_to_video
459
459
 
460
460
  # switch to "mps" for apple devices
461
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
461
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
462
462
  pipe.load_lora_weights("${model.id}")
463
463
 
464
464
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -472,7 +472,7 @@ from diffusers import DiffusionPipeline
472
472
  from diffusers.utils import load_image, export_to_video
473
473
 
474
474
  # switch to "mps" for apple devices
475
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
475
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
476
476
  pipe.load_lora_weights("${model.id}")
477
477
 
478
478
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -486,7 +486,7 @@ const diffusers_textual_inversion = (model) => [
486
486
  from diffusers import DiffusionPipeline
487
487
 
488
488
  # switch to "mps" for apple devices
489
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
489
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
490
490
  pipe.load_textual_inversion("${model.id}")`,
491
491
  ];
492
492
  const diffusers_flux_fill = (model) => [
@@ -498,7 +498,7 @@ image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-d
498
498
  mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
499
499
 
500
500
  # switch to "mps" for apple devices
501
- pipe = FluxFillPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
501
+ pipe = FluxFillPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
502
502
  image = pipe(
503
503
  prompt="a white paper cup",
504
504
  image=image,
@@ -518,7 +518,7 @@ from diffusers import AutoPipelineForInpainting
518
518
  from diffusers.utils import load_image
519
519
 
520
520
  # switch to "mps" for apple devices
521
- pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", torch_dtype=torch.float16, variant="fp16", device_map="cuda")
521
+ pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", dtype=torch.float16, variant="fp16", device_map="cuda")
522
522
 
523
523
  img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
524
524
  mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
@@ -97,6 +97,11 @@ export declare const EVALUATION_FRAMEWORKS: {
97
97
  readonly description: "MDPBench is a benchmark for evaluating multilingual document parsing across digital, photographed, Latin, and non-Latin document subsets.";
98
98
  readonly url: "https://github.com/Yuliang-Liu/MultimodalOCR";
99
99
  };
100
+ readonly "real5-omnidocbench": {
101
+ readonly name: "real5-omnidocbench";
102
+ readonly description: "Real5-OmniDocBench is a benchmark for evaluating document parsing robustness under five real-world acquisition scenarios: scanning, warping, screen-photography, illumination, and skew.";
103
+ readonly url: "https://huggingface.co/datasets/PaddlePaddle/Real5-OmniDocBench";
104
+ };
100
105
  readonly parsebench: {
101
106
  readonly name: "parsebench";
102
107
  readonly description: "ParseBench is a benchmark for evaluating document parsing systems on real-world enterprise documents across tables, charts, content faithfulness, semantic formatting, and visual grounding.";
@@ -1 +1 @@
1
- {"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../../src/eval.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKxB,CAAC"}
1
+ {"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../../src/eval.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKxB,CAAC"}
package/dist/esm/eval.js CHANGED
@@ -97,6 +97,11 @@ export const EVALUATION_FRAMEWORKS = {
97
97
  description: "MDPBench is a benchmark for evaluating multilingual document parsing across digital, photographed, Latin, and non-Latin document subsets.",
98
98
  url: "https://github.com/Yuliang-Liu/MultimodalOCR",
99
99
  },
100
+ "real5-omnidocbench": {
101
+ name: "real5-omnidocbench",
102
+ description: "Real5-OmniDocBench is a benchmark for evaluating document parsing robustness under five real-world acquisition scenarios: scanning, warping, screen-photography, illumination, and skew.",
103
+ url: "https://huggingface.co/datasets/PaddlePaddle/Real5-OmniDocBench",
104
+ },
100
105
  parsebench: {
101
106
  name: "parsebench",
102
107
  description: "ParseBench is a benchmark for evaluating document parsing systems on real-world enterprise documents across tables, charts, content faithfulness, semantic formatting, and visual grounding.",
@@ -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;IACd,KAAK,KAAK;IACV,IA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,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;IACV,IAAI,KAAK;IACT,IAAI,KAAK;CACT"}
package/dist/esm/gguf.js CHANGED
@@ -55,7 +55,21 @@ export var GGMLFileQuantizationType;
55
55
  GGMLFileQuantizationType[GGMLFileQuantizationType["Q8_K_XL"] = 1005] = "Q8_K_XL";
56
56
  })(GGMLFileQuantizationType || (GGMLFileQuantizationType = {}));
57
57
  const ggufQuants = Object.values(GGMLFileQuantizationType).filter((v) => typeof v === "string");
58
- export const GGUF_QUANT_RE = new RegExp("(?<prefix>UD-)?" + `(?<quant>${ggufQuants.join("|")})` + "(_(?<sizeVariation>[A-Z]+))?");
58
+ /**
59
+ * Names that show up in GGUF *filenames* without being llama_ftype values.
60
+ *
61
+ * llama.cpp's gpt-oss conversion names its output after the tensor type it repacks the experts to
62
+ * (`GGMLQuantizationType.MXFP4`), while `general.file_type` is `MXFP4_MOE` — see
63
+ * https://github.com/ggml-org/llama.cpp/blob/master/conversion/gpt_oss.py. So the canonical releases
64
+ * are `gpt-oss-{20b,120b}-MXFP4.gguf`, which no `GGMLFileQuantizationType` name matches.
65
+ *
66
+ * Appended last so `MXFP4_MOE` still wins the alternation, instead of matching as `MXFP4` with
67
+ * sizeVariation `MOE`.
68
+ */
69
+ const GGUF_QUANT_FILENAME_ALIASES = ["MXFP4"];
70
+ export const GGUF_QUANT_RE = new RegExp("(?<prefix>UD-)?" +
71
+ `(?<quant>${[...ggufQuants, ...GGUF_QUANT_FILENAME_ALIASES].join("|")})` +
72
+ "(_(?<sizeVariation>[A-Z]+))?");
59
73
  export const GGUF_QUANT_RE_GLOBAL = new RegExp(GGUF_QUANT_RE, "g");
60
74
  export function parseGGUFQuantLabel(fname) {
61
75
  const quantLabel = fname.toUpperCase().match(GGUF_QUANT_RE_GLOBAL)?.at(-1); // if there is multiple quant substrings in a name, we prefer the last one
@@ -359,7 +359,7 @@ const diffusers_default = (model) => [
359
359
  from diffusers import DiffusionPipeline
360
360
 
361
361
  # switch to "mps" for apple devices
362
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
362
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
363
363
 
364
364
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
365
365
  image = pipe(prompt).images[0]`,
@@ -370,7 +370,7 @@ from diffusers import DiffusionPipeline
370
370
  from diffusers.utils import load_image
371
371
 
372
372
  # switch to "mps" for apple devices
373
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
373
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
374
374
 
375
375
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
376
376
  input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
@@ -383,7 +383,7 @@ from diffusers import DiffusionPipeline
383
383
  from diffusers.utils import load_image, export_to_video
384
384
 
385
385
  # switch to "mps" for apple devices
386
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
386
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
387
387
  pipe.to("cuda")
388
388
 
389
389
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -407,7 +407,7 @@ const diffusers_lora = (model) => [
407
407
  from diffusers import DiffusionPipeline
408
408
 
409
409
  # switch to "mps" for apple devices
410
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
410
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
411
411
  pipe.load_lora_weights("${model.id}")
412
412
 
413
413
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
@@ -419,7 +419,7 @@ from diffusers import DiffusionPipeline
419
419
  from diffusers.utils import load_image
420
420
 
421
421
  # switch to "mps" for apple devices
422
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
422
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
423
423
  pipe.load_lora_weights("${model.id}")
424
424
 
425
425
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
@@ -433,7 +433,7 @@ from diffusers import DiffusionPipeline
433
433
  from diffusers.utils import export_to_video
434
434
 
435
435
  # switch to "mps" for apple devices
436
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
436
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
437
437
  pipe.load_lora_weights("${model.id}")
438
438
 
439
439
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -447,7 +447,7 @@ from diffusers import DiffusionPipeline
447
447
  from diffusers.utils import load_image, export_to_video
448
448
 
449
449
  # switch to "mps" for apple devices
450
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
450
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
451
451
  pipe.load_lora_weights("${model.id}")
452
452
 
453
453
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -461,7 +461,7 @@ const diffusers_textual_inversion = (model) => [
461
461
  from diffusers import DiffusionPipeline
462
462
 
463
463
  # switch to "mps" for apple devices
464
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
464
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
465
465
  pipe.load_textual_inversion("${model.id}")`,
466
466
  ];
467
467
  const diffusers_flux_fill = (model) => [
@@ -473,7 +473,7 @@ image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-d
473
473
  mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
474
474
 
475
475
  # switch to "mps" for apple devices
476
- pipe = FluxFillPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
476
+ pipe = FluxFillPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
477
477
  image = pipe(
478
478
  prompt="a white paper cup",
479
479
  image=image,
@@ -493,7 +493,7 @@ from diffusers import AutoPipelineForInpainting
493
493
  from diffusers.utils import load_image
494
494
 
495
495
  # switch to "mps" for apple devices
496
- pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", torch_dtype=torch.float16, variant="fp16", device_map="cuda")
496
+ pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", dtype=torch.float16, variant="fp16", device_map="cuda")
497
497
 
498
498
  img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
499
499
  mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huggingface/tasks",
3
- "version": "0.21.31",
3
+ "version": "0.21.33",
4
4
  "description": "List of ML tasks for huggingface.co/tasks",
5
5
  "keywords": [
6
6
  "hub",
package/src/eval.ts CHANGED
@@ -107,6 +107,12 @@ export const EVALUATION_FRAMEWORKS = {
107
107
  "MDPBench is a benchmark for evaluating multilingual document parsing across digital, photographed, Latin, and non-Latin document subsets.",
108
108
  url: "https://github.com/Yuliang-Liu/MultimodalOCR",
109
109
  },
110
+ "real5-omnidocbench": {
111
+ name: "real5-omnidocbench",
112
+ description:
113
+ "Real5-OmniDocBench is a benchmark for evaluating document parsing robustness under five real-world acquisition scenarios: scanning, warping, screen-photography, illumination, and skew.",
114
+ url: "https://huggingface.co/datasets/PaddlePaddle/Real5-OmniDocBench",
115
+ },
110
116
  parsebench: {
111
117
  name: "parsebench",
112
118
  description:
package/src/gguf.ts CHANGED
@@ -56,8 +56,22 @@ export enum GGMLFileQuantizationType {
56
56
  }
57
57
 
58
58
  const ggufQuants = Object.values(GGMLFileQuantizationType).filter((v): v is string => typeof v === "string");
59
+ /**
60
+ * Names that show up in GGUF *filenames* without being llama_ftype values.
61
+ *
62
+ * llama.cpp's gpt-oss conversion names its output after the tensor type it repacks the experts to
63
+ * (`GGMLQuantizationType.MXFP4`), while `general.file_type` is `MXFP4_MOE` — see
64
+ * https://github.com/ggml-org/llama.cpp/blob/master/conversion/gpt_oss.py. So the canonical releases
65
+ * are `gpt-oss-{20b,120b}-MXFP4.gguf`, which no `GGMLFileQuantizationType` name matches.
66
+ *
67
+ * Appended last so `MXFP4_MOE` still wins the alternation, instead of matching as `MXFP4` with
68
+ * sizeVariation `MOE`.
69
+ */
70
+ const GGUF_QUANT_FILENAME_ALIASES = ["MXFP4"];
59
71
  export const GGUF_QUANT_RE = new RegExp(
60
- "(?<prefix>UD-)?" + `(?<quant>${ggufQuants.join("|")})` + "(_(?<sizeVariation>[A-Z]+))?",
72
+ "(?<prefix>UD-)?" +
73
+ `(?<quant>${[...ggufQuants, ...GGUF_QUANT_FILENAME_ALIASES].join("|")})` +
74
+ "(_(?<sizeVariation>[A-Z]+))?",
61
75
  );
62
76
  export const GGUF_QUANT_RE_GLOBAL = new RegExp(GGUF_QUANT_RE, "g");
63
77
 
@@ -405,7 +405,7 @@ const diffusers_default = (model: ModelData) => [
405
405
  from diffusers import DiffusionPipeline
406
406
 
407
407
  # switch to "mps" for apple devices
408
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
408
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
409
409
 
410
410
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
411
411
  image = pipe(prompt).images[0]`,
@@ -417,7 +417,7 @@ from diffusers import DiffusionPipeline
417
417
  from diffusers.utils import load_image
418
418
 
419
419
  # switch to "mps" for apple devices
420
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
420
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
421
421
 
422
422
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
423
423
  input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
@@ -431,7 +431,7 @@ from diffusers import DiffusionPipeline
431
431
  from diffusers.utils import load_image, export_to_video
432
432
 
433
433
  # switch to "mps" for apple devices
434
- pipe = DiffusionPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
434
+ pipe = DiffusionPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
435
435
  pipe.to("cuda")
436
436
 
437
437
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -457,7 +457,7 @@ const diffusers_lora = (model: ModelData) => [
457
457
  from diffusers import DiffusionPipeline
458
458
 
459
459
  # switch to "mps" for apple devices
460
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
460
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
461
461
  pipe.load_lora_weights("${model.id}")
462
462
 
463
463
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersDefaultPrompt}"
@@ -470,7 +470,7 @@ from diffusers import DiffusionPipeline
470
470
  from diffusers.utils import load_image
471
471
 
472
472
  # switch to "mps" for apple devices
473
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
473
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
474
474
  pipe.load_lora_weights("${model.id}")
475
475
 
476
476
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersImg2ImgDefaultPrompt}"
@@ -485,7 +485,7 @@ from diffusers import DiffusionPipeline
485
485
  from diffusers.utils import export_to_video
486
486
 
487
487
  # switch to "mps" for apple devices
488
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
488
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
489
489
  pipe.load_lora_weights("${model.id}")
490
490
 
491
491
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -500,7 +500,7 @@ from diffusers import DiffusionPipeline
500
500
  from diffusers.utils import load_image, export_to_video
501
501
 
502
502
  # switch to "mps" for apple devices
503
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
503
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
504
504
  pipe.load_lora_weights("${model.id}")
505
505
 
506
506
  prompt = "${get_prompt_from_diffusers_model(model) ?? diffusersVideoDefaultPrompt}"
@@ -515,7 +515,7 @@ const diffusers_textual_inversion = (model: ModelData) => [
515
515
  from diffusers import DiffusionPipeline
516
516
 
517
517
  # switch to "mps" for apple devices
518
- pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", torch_dtype=torch.bfloat16, device_map="cuda")
518
+ pipe = DiffusionPipeline.from_pretrained("${get_base_diffusers_model(model)}", dtype=torch.bfloat16, device_map="cuda")
519
519
  pipe.load_textual_inversion("${model.id}")`,
520
520
  ];
521
521
 
@@ -528,7 +528,7 @@ image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-d
528
528
  mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
529
529
 
530
530
  # switch to "mps" for apple devices
531
- pipe = FluxFillPipeline.from_pretrained("${model.id}", torch_dtype=torch.bfloat16, device_map="cuda")
531
+ pipe = FluxFillPipeline.from_pretrained("${model.id}", dtype=torch.bfloat16, device_map="cuda")
532
532
  image = pipe(
533
533
  prompt="a white paper cup",
534
534
  image=image,
@@ -549,7 +549,7 @@ from diffusers import AutoPipelineForInpainting
549
549
  from diffusers.utils import load_image
550
550
 
551
551
  # switch to "mps" for apple devices
552
- pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", torch_dtype=torch.float16, variant="fp16", device_map="cuda")
552
+ pipe = AutoPipelineForInpainting.from_pretrained("${model.id}", dtype=torch.float16, variant="fp16", device_map="cuda")
553
553
 
554
554
  img_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"
555
555
  mask_url = "https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"