Run this model with HF Jobs

Run Louvain/embed-4b-erb 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/Louvain/embed-4b-erb. 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/Louvain/embed-4b-erb 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.
embed-4b-erb / training /evaluate.py
scotty595's picture
Model card: what the model has seen, limits, measured difference; add training scripts
7b9a14b verified
Raw History Blame Contribute Delete
1.88 kB
"""
STEP 5 — SCORE A FINE-TUNED MODEL WITH THE SAME HARNESS AS THE MODEL TABLE. Loads the embedder harness
(an evaluation harness that is not part of this release) unchanged and registers the fine-tuned model under the base's own
pooling and query prompt (`self-tune.json`), then runs it exactly as any row of that table: the same pool, the same
chunker and header, gold@1/5/10/18, semantic against the others.
python evaluate.py --harness <evaluation harness> --model models/qwen3-0.6b-st \\
--pool pool-hard.json --out result.json [--name qwen3-0.6b-st]
"""
import argparse
import importlib.util
import json
import os
import sys
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--harness", required=True)
ap.add_argument("--model", required=True, help="a directory train.py wrote")
ap.add_argument("--name", default="")
a, rest = ap.parse_known_args()
meta = json.load(open(os.path.join(a.model, "self-tune.json")))
name = a.name or os.path.basename(os.path.normpath(a.model))
spec = importlib.util.spec_from_file_location("embed_pool_probe", a.harness)
probe = importlib.util.module_from_spec(spec)
spec.loader.exec_module(probe)
entry = (os.path.abspath(a.model), meta["pooling"], meta["prefix"])
# A newer harness also declares a document prefix per model; the self-tuned models take none, as their bases do.
width = len(next(iter(probe.MODELS.values())))
probe.MODELS[name] = entry + ("",) * (width - len(entry))
# The harness treats a Qwen-family model's precision by its name; a fine-tuned Qwen keeps that behaviour.
if meta["pooling"] == "last" and not name.startswith("qwen3"):
probe.MODELS[f"qwen3-{name}"] = probe.MODELS.pop(name)
name = f"qwen3-{name}"
sys.argv = [a.harness, "--model", name, *rest]
probe.main()
if __name__ == "__main__":
main()