Run this model with HF Jobs

Run IFM/K2-Horizon-0.9B 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 and TRL to fine-tune https://huggingface.co/IFM/K2-Horizon-0.9B. 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/IFM/K2-Horizon-0.9B 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.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/IFM/K2-Horizon-0.9B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/IFM/K2-Horizon-0.9B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

[superseded by #8 - opened as a discussion by mistake] Fix output_hidden_states / attentions returning None

#7
by Avicennasis - opened

Follow-up to #6 (full write-up, evidence and repro there).

  • Commit 1: K2HorizonModel.forward declares the hidden_states / attentions entries in _can_record_outputs, but never had the @capture_outputs decorator that reads the output_* flags and installs the capture hooks — so output_hidden_states=True returned None. Adds the import + decorator, mirroring stock Qwen3MoeModel.forward.
  • Commit 2: the attentions entry names K2HorizonAttention, but these checkpoints instantiate K2HorizonMoVAAttention, so output_attentions=True returned an empty tuple. Lists both classes (weights are produced under eager attention, as with stock models).

Verified on K2-Horizon-0.9B, transformers 5.17.0: as shipped → hidden_states=None; with this branch → 29 states for 28 layers ([0] == embeddings, [-1] == last_hidden_state), flag-off → None, greedy generation unchanged; attentions → 28 tensors with eager attention. The modeling file is byte-identical across all 12 full-model K2-Horizon repos, so the fix applies family-wide (tested here on the 0.9B).

Avicennasis changed discussion title from Fix `output_hidden_states` / `attentions` returning None (missing `@capture_outputs`) to [superseded by #8 - opened as a discussion by mistake] Fix output_hidden_states / attentions returning None

Opened this by mistake - the API flag I used created a plain discussion instead of a PR, and it cannot be converted after the fact. The real pull request with both commits is #8; background and evidence in #6.

aaryamonvikram changed discussion status to closed

Sign up or log in to comment