diff --git a/tools/build-catalog.py b/tools/build-catalog.py index 7b78ca6..accbe3d 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", @@ -352,9 +353,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 + "
  • " ) @@ -421,6 +423,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 b69aefe..3ddf2b0 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) {