Run this model with HF Jobs
Run harness-race/opencode-r3 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/harness-race/opencode-r3. 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/harness-race/opencode-r3 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.
Instructions to use harness-race/opencode-r3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harness-race/opencode-r3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("object-detection", model="harness-race/opencode-r3")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForObjectDetection processor = AutoImageProcessor.from_pretrained("harness-race/opencode-r3") model = AutoModelForObjectDetection.from_pretrained("harness-race/opencode-r3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload probe.py with huggingface_hub
Browse files1 unmodified line2345678910111213141516171819201 unmodified line2223242526272829303132333435363738391 unmodified line# requires-python = ">=3.10"# dependencies = [# "torch>=2.1",# "transformers>=4.40",# "datasets>=2.18",# "pycocotools",# "Pillow",# "numpy",# ]# ///import os, io, sysimport torchfrom PIL import Imageimport datasets as hfdsfrom pycocotools.coco import COCOfrom pycocotools.cocoeval import COCOevaldata_dir = "/data"if not os.path.isdir(data_dir):1 unmodified lineds = hfds.load_dataset(data_dir, split="validation")examples = list(ds)print("loaded", len(examples))print("keys:", list(examples[0].keys()))ex = examples[0]print("objects keys:", list(ex["objects"].keys()))print("cat first val:", ex["objects"]["category_id"][:3] if isinstance(ex["objects"].get("category_id"), list) else ex["objects"]["category_id"])img = ex["image"]print("image type:", type(img))if isinstance(img, dict):print("dict keys:", img.keys())im = Image.open(io.BytesIO(img["bytes"]))else:im = imgprint("img size:", im.size)# bbox sampleprint("bbox:", ex["objects"]["bbox"][:1])print("height/width cols:", ex.get("width"), ex.get("height"))1 unmodified line23456789101112131415161 unmodified line1819202122232425262728293031323334353637381 unmodified line# requires-python = ">=3.10"# dependencies = [# "torch>=2.1",# "datasets>=2.18",# "pycocotools",# "Pillow",# "numpy",# ]# ///import os, iofrom PIL import Imageimport datasets as hfdsdata_dir = "/data"if not os.path.isdir(data_dir):1 unmodified lineds = hfds.load_dataset(data_dir, split="validation")examples = list(ds)print("loaded", len(examples))ex = examples[0]print("keys:", list(ex.keys()), "w/h:", ex["width"], ex["height"])objs = ex["objects"]print("objects type:", type(objs), "len:", len(objs))o = objs[0]print("obj keys:", list(o.keys()))print("category_id:", repr(o["category_id"]), "type:", type(o["category_id"]).__name__)print("bbox:", o["bbox"], "type:", type(o["bbox"]).__name__)img = ex["image"]print("image type:", type(img).__name__)im = img.size if not isinstance(img, dict) else Image.open(io.BytesIO(img["bytes"])).sizeprint("img size:", im)from collections import Countercats = Counter()for e in examples[:200]:for o in e["objects"]:cats[repr(o["category_id"])] += 1print("category_id value distribution sample:", dict(cats))
probe.py+17-18