Run this model with HF Jobs
Run FastVideo/FastH3-NVFP4-VAE-Decoder on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/FastVideo/FastH3-NVFP4-VAE-Decoder. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/FastVideo/FastH3-NVFP4-VAE-Decoder on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Add safetensors -> FastVideo loader converter
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051# SPDX-License-Identifier: Apache-2.0"""Convert a FastH3 NVFP4 decoder ``decoder.safetensors`` into the ``.pt`` file FastVideo loads.
FastVideo's ``FASTVIDEO_H3_VAE_NVFP4_DECODER`` loader reads a``fastvideo_h3_decoder_nvfp4_deploy_v1`` torch checkpoint. This script rebuildsthat checkpoint from the safetensors release without changing any tensor.
python convert_to_fastvideo_pt.py quality-36L/decoder.safetensors quality-36L.pt"""from __future__ import annotations
import argparseimport json
import torchfrom safetensors import safe_openfrom safetensors.torch import load_file
DEPLOY_FORMAT = "fastvideo_h3_decoder_nvfp4_deploy_v1"GROUPS = ("decoder", "post_quant_conv")
def safetensors_to_checkpoint(path: str) -> dict: with safe_open(path, framework="pt") as handle: header = handle.metadata() or {} if header.get("format") != DEPLOY_FORMAT: raise ValueError(f"{path} is not a {DEPLOY_FORMAT} file (format: {header.get('format')!r})") tensors = load_file(path) checkpoint: dict = {"format": DEPLOY_FORMAT, "metadata": json.loads(header["nvfp4_metadata"])} for group in GROUPS: prefix = f"{group}." checkpoint[group] = {key[len(prefix):]: value for key, value in tensors.items() if key.startswith(prefix)} unknown = [key for key in tensors if not key.startswith(tuple(f"{g}." for g in GROUPS))] if unknown: raise ValueError(f"unexpected tensors in {path}: {unknown[:5]}") return checkpoint
def main() -> None: parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument("safetensors", help="quality-36L/decoder.safetensors or fast-8L/decoder.safetensors") parser.add_argument("output", help="destination .pt for FASTVIDEO_H3_VAE_NVFP4_DECODER") args = parser.parse_args() checkpoint = safetensors_to_checkpoint(args.safetensors) torch.save(checkpoint, args.output) print(f"wrote {args.output}: {len(checkpoint['decoder'])} decoder tensors, " f"{checkpoint['metadata'].get('student_layers')} blocks")
if __name__ == "__main__": main()convert_to_fastvideo_pt.pyAdded+51