Run this model with HF Jobs

Run Agnes-AI/Agnes-Video-H3-MoE 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/Agnes-AI/Agnes-Video-H3-MoE. 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/Agnes-AI/Agnes-Video-H3-MoE 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.
Agnes-AI's picture
Release E8T1 shared MoE model and reference inference code
2594d73 verified
Raw History Blame Contribute Delete
2.47 kB
"""Confirm the handoff files and that Python imports the bundled DiffSynth snapshot.
Does not load the FL2VA weights and does not use a GPU.
"""
from __future__ import annotations
import hashlib
import json
import sys
from pathlib import Path
DEPLOY = Path(__file__).resolve().parent
PACKAGE = DEPLOY.parent
def sha256(path: Path) -> str:
digest = hashlib.sha256()
with path.open("rb") as handle:
for chunk in iter(lambda: handle.read(1024 * 1024), b""):
digest.update(chunk)
return digest.hexdigest()
def check_sums(root: Path, sums_file: Path) -> list[str]:
errors = []
for line in sums_file.read_text().splitlines():
line = line.strip()
if not line:
continue
digest, rel = line.split(None, 1)
path = root / rel
if not path.is_file():
errors.append(f"missing {path}")
continue
got = sha256(path)
if got != digest:
errors.append(f"hash mismatch {rel}: {got}")
return errors
def main() -> int:
errors = []
manifest = json.loads((PACKAGE / "manifest.json").read_text())
for name, spec in manifest["weights"].items():
path = PACKAGE / name
if not path.is_file():
errors.append(f"missing {path}")
continue
if path.stat().st_size != spec["bytes"]:
errors.append(f"size mismatch {name}: {path.stat().st_size}")
got = sha256(path)
if got != spec["sha256"]:
errors.append(f"hash mismatch {name}: {got}")
fl2va = PACKAGE / "FL2VA"
for rel in (
"transformer",
"text_encoder",
"video_vae/source/model.safetensors",
"audio_vae/model.safetensors",
"processor",
):
if not (fl2va / rel).exists():
errors.append(f"missing FL2VA/{rel}")
errors.extend(check_sums(DEPLOY, DEPLOY / "SHA256SUMS"))
sys.path.insert(0, str(DEPLOY / "code"))
sys.path.insert(0, str(DEPLOY))
from load import assert_snapshot_dit
dit_file = assert_snapshot_dit()
from shared_moe import SharedE8T1MLP
if SharedE8T1MLP is None:
errors.append("snapshot modules did not import")
if errors:
print("\n".join(errors))
return 1
print(f"weights ok: {', '.join(manifest['weights'])}")
print(f"code ok: {dit_file}")
print("import ok: SharedE8T1MLP")
return 0
if __name__ == "__main__":
raise SystemExit(main())