From 242aa168c991f0cbda5e7a5a68d7c94bc8f75567 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Tue, 10 Nov 2026 15:42:46 +0000 Subject: [PATCH] run-on-jobs: link to one model with ?model=org/name A visitor could not be sent to one model. Every link opened the top of the page, and the list starts below the first screen. - `?model=org/name` opens that model's entry and scrolls to it. The Hub passes the query string of the Space page to the static page. - A model listed under two tasks opens in both. - An unknown model fills the search box, so the page says nothing matches. - Each entry has a "Link to this model" link, and AGENTS.md names the URL. Co-Authored-By: Claude Fable 5.2 --- tools/build-catalog.py | 7 +++++-- tools/run-on-jobs-template.html | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tools/build-catalog.py b/tools/build-catalog.py index 63b62a9..30f3efc 100755 --- a/tools/build-catalog.py +++ b/tools/build-catalog.py @@ -24,6 +24,7 @@ ROOT = Path(__file__).resolve().parent.parent OUTPUT_DIR = ROOT / "run-on-jobs" HUB_BASE = "https://huggingface.co/datasets/uv-scripts" +SPACE_URL = "https://huggingface.co/spaces/uv-scripts/run-on-jobs" TASKS = { "ocr": "OCR", @@ -302,9 +303,10 @@ def model_row_html(task, model, recipes): label = f"{len(others)} more recipe{'s' if len(others) > 1 else ''}" more = f'
{label}' + "".join(recipe_html(recipe) for recipe in others) + "
" return ( - f'
  • ' + f'
  • ' f'{html.escape(model)}{html.escape(row_status)}' - + f'' + + f'' + recipe_html(best) + more + "
  • " ) @@ -371,6 +373,7 @@ def render_agents(): ## Find a recipe - `hf download uv-scripts/run-on-jobs recipes.json --repo-type space`, then look for the model in `recipes[].models`. +- To send a person to one model, link to `https://huggingface.co/spaces/uv-scripts/run-on-jobs?model=/`. The page opens at that model. - `kind`: `run` applies a model to data; `train` fine-tunes one. - `source`: `header` carries its launch settings; `documented` is an example from the script's docs; `flags-needed` has no command, so read the script first. - Read a script's docstring and options: `curl -s | head -100`. Running it locally may fail on GPU-only dependencies. diff --git a/tools/run-on-jobs-template.html b/tools/run-on-jobs-template.html index eb818cf..669f4f3 100644 --- a/tools/run-on-jobs-template.html +++ b/tools/run-on-jobs-template.html @@ -81,6 +81,7 @@ @media (prefers-reduced-motion:reduce){summary::before{transition:none}} .entry{font-size:15px;margin-top:12px} .model-link{margin:2px 12px 8px 28px} +ul.models>li{scroll-margin-top:12px} @@ -279,6 +280,21 @@

    For agents

    apply(); }); } +// ?model=org/name opens the page at that model. The Hub passes the query string of the Space page to this page. +const wantedModel = (new URLSearchParams(location.search).get('model') || '').trim().toLowerCase(); +if (wantedModel) { + const matches = items.filter(item => item.dataset.model === wantedModel); + for (const item of matches) item.querySelector('details').open = true; + if (matches.length) { + matches[0].scrollIntoView(); + // The example image above can load later and move the list, so scroll again once the page has loaded. + addEventListener('load', () => matches[0].scrollIntoView()); + } else { + input.value = wantedModel; + apply(); + document.getElementById('find').scrollIntoView(); + } +} const stepButtons = [...document.querySelectorAll('.switch button')]; const steps = [...document.querySelectorAll('[data-step]')]; function showStep(name) {