Run this model with HF Jobs

Run nvidia/LocateAnything-3B 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/nvidia/LocateAnything-3B. 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/nvidia/LocateAnything-3B 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/nvidia/LocateAnything-3B. 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/nvidia/LocateAnything-3B. 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.

Windows: modeling_qwen2.py raises NotImplementedError for 'eager' attention with no automatic fallback

#17
by kanklc - opened

Environment

  • OS: Windows 11
  • GPU: RTX 4060 (8GB VRAM)
  • CUDA: 12.4
  • torch: 2.6.0+cu124
  • transformers: 4.51.3

Problem

On Windows with native Python (no Docker/WSL2), loading the model and calling
model.generate() raises:

NotImplementedError: self._attn_implementation='eager'

This happens because modeling_qwen2.py line 1335 raises NotImplementedError
for 'eager' attention, but the automatic fallback to 'sdpa' (lines 932-947)
does not trigger on Windows.

Passing attn_implementation='sdpa' to from_pretrained() also does not fix
it — the model loads but still uses 'eager' internally.

Workaround

After loading the model, manually patch all submodules:

for module in model.modules():
    if hasattr(module, '_attn_implementation'):
        module._attn_implementation = 'sdpa'
    if hasattr(module, 'config') and hasattr(module.config, '_attn_implementation'):
        module.config._attn_implementation = 'sdpa'

Suggestion

Either fix the fallback logic on Windows, or raise a clear error message
pointing users to this workaround instead of a cryptic NotImplementedError.

Sign up or log in to comment