Skip to content

Wandbify skills - #647

Draft
ngrayluna wants to merge 54 commits into
mainfrom
wandbify_skills
Draft

ngrayluna wants to merge 54 commits into
mainfrom
wandbify_skills

Conversation

@ngrayluna

@ngrayluna ngrayluna commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds tooling (Python scripts) for converting Colab/Jupyter notebooks to marimo and consolidates marimo conversion guidance into a focused W&B-specific skill.

How this works

convert -> inspect diagnostics -> clean up with an agent -> verify

scripts/convert-colab-to-marimo.py converts individual .ipynb notebooks or a batch list to marimo .py files. It runs marimo convert and an initial marimo check. Records and saves diagnostics as JSON and/or .txt files.

Outputs are written under marimo/convert/:

marimo/convert/
  <example-name>/
    <example_name>.py
    .logs/
      result.json
      marimo-*.log
  convert-summary.txt

Converted notebooks may still need cleanup before they can run successfully on molab. An agent uses the generated output files (.json) to identify blockers, then use the marimo notebook skill to fix reactive-graph issues (i.e. marimo idioms) and preserve tutorial intent (i.e. preserve teaching qualities of the notebook).

Skill updates

Replaces the previous general marimo/Jupyter conversion guidance with one repo-specific skill:

SKILL.md
references/
  convert-cleanup.md
  marimo-idioms.md
  tutorial-notebook-objectives.md
  wandb-patterns.md

Key changes:

  • SKILL.md: defines the conversion and cleanup workflow.
  • convert-cleanup.md: covers conversion diagnostics and cleanup.
  • marimo-idioms.md: contains marimo mechanics and reactive-notebook conventions.
  • tutorial-notebook-objectives.md: covers tutorial narrative, purpose
  • wandb-patterns.md: contains W&B SDK conventions
  • scripts/convert-colab-to-marimo.py handles mechanical conversion and initial validation; agents rerun marimo check during cleanup and final verification.

The previous marimo skills were too broad, generic for wandb/examples. It also removed the teaching quality with strict rules about helper functions.

Scripts added

  • scripts/colab_sources/make_list.py: converts the source CSV into a deduplicated notebook path list.
  • scripts/colab_sources/notebook_paths.txt: batch input for conversion.
  • scripts/convert-colab-to-marimo.py: converts notebooks, runs the initial check, and records diagnostics.

Updated notebooks

Name Colab Molab
Credit Scorecards with XGBoost and W&B Open in Colab Open in Molab
Using W&B Sweeps with XGBoost Open in Colab Open in Molab
W&B Tables Quickstart Open in Colab Open in Molab
lcm-diffusers Open in Colab Open in Molab
Custom Progress Callback Open in Colab Open in Molab
Huggingface wandb Open in Colab Open in Molab
Optimize Hugging Face models with Weights & Biases Open in Colab Open in Molab
Intro to Weights & Biases Open in Colab Open in Molab
Intro to Weights & Biases keras Open in Colab Open in Molab
Report API Quickstart Open in Colab Open in Molab
Use WandbEvalCallback in your Keras workflow Open in Colab Open in Molab
Use WandbMetricLogger in your Keras workflow Open in Colab Open in Molab
Use WandbModelCheckpoint in your Keras workflow Open in Colab Open in Molab
OpenAI API Autologger Quickstart Open in Colab Open in Molab
Optimize Pytorch Lightning models with Weights & Biases Open in Colab Open in Molab
Organizing Hyperparameter Sweeps in PyTorch with W&B Open in Colab Open in Molab
Simple PyTorch Integration Open in Colab Open in Molab
AlphaFold with W&B Align, Fold, Log Open in Colab Open in Molab
Hyperparameter Optimization in TensorFlow using W&B Sweeps Open in Colab Open in Molab
torchtune and wandb Open in Colab Open in Molab
Pipeline Versioning with W&B Artifacts Open in Colab Open in Molab
WandB Artifacts Time to live TTL Walkthrough Open in Colab Open in Molab
Configs in W&B Open in Colab Open in Molab
Log (Almost) Anything with W&B Media Open in Colab Open in Molab
Log a Confusion Matrix with W&B Open in Colab Open in Molab
Plot ROC Curves with W&B Open in Colab Open in Molab
zoo wandb Open in Colab Open in Molab
Train and Debug YOLOv5 Models with Weights & Biases Open in Colab Open in Molab

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@app.cell(hide_code=True)
def _(wandb_login_form):
# Recreate the form after authentication is submitted, requiring a fresh training submission.
_connection_is_submitted = wandb_login_form.value is not None
Copilot AI review requested due to automatic review settings September 14, 2026 20:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

# remove slow mirror from list of MNIST mirrors
torchvision.datasets.MNIST.mirrors = [
mirror for mirror in torchvision.datasets.MNIST.mirrors
if not mirror.startswith("http://yann.lecun.com")
Copilot AI review requested due to automatic review settings September 14, 2026 21:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate findings affect conversion correctness, dependencies, inputs, outputs, and runtime behavior.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (10)

marimo/convert/convert-summary.txt:99

  • The summary records colabs/intro/run_quickstart.ipynb as passed and points to marimo/convert/run-quickstart/run_quickstart.py, but that target is not present in the change. This makes the committed batch report inconsistent with the actual outputs; regenerate the summary together with the outputs or remove the stale passed entry.
    marimo/convert/huggingface-wandb/huggingface_wandb.py:9
  • The notebook imports and uses torch (for example in the GPU check), but it is absent from the PEP 723 dependency block. A sandbox created from this header does not explicitly guarantee that direct runtime dependency; declare torch with a compatible constraint so this notebook is reproducible.
    marimo/convert/openai-api-autologger-quickstart/openai_api_autologger_quickstart.py:108
  • This cell overwrites any valid environment/client credential with the literal placeholder sk-foo, so the following API calls fail unless a user edits the source. Read the key from a password form or OPENAI_API_KEY without displaying or committing it, and leave existing runtime credentials intact.
    marimo/convert/pipeline-versioning-with-w-b-artifacts/marimo/session/pipeline_versioning_with_w_b_artifacts.py.json:1
  • This committed file is a marimo session cache containing rendered cell outputs, not notebook source or diagnostics. The repository skill explicitly excludes __marimo__/ runtime-generated files; remove this cache from the change and ignore the directory so local sessions cannot add machine-specific state.
    marimo/convert/torchtune-and-wandb/torchtune_and_wandb.py:2
  • "-" is not a valid PEP 508 requirement. A clean uvx marimo edit --sandbox run will fail dependency resolution before this converted notebook can start; replace this placeholder with the actual runtime requirements (including marimo) during cleanup.
    marimo/convert/wandb-artifacts-time-to-live-ttl-walkthrough/wandb_artifacts_time_to_live_ttl_walkthrough.py:193
  • This hard-codes the entity wandb-smle, so readers authenticated to another account or team cannot run the walkthrough's artifact logging step. Make the entity an input (or omit it to use the authenticated default) as required for a reusable molab tutorial.
    scripts/colab_sources/make_list.py:24
  • The CSV's Path column also contains examples/.../*.py entries, but prepare_notebook() rejects every non-.ipynb input. Because this comprehension copies every non-empty path, the checked-in batch list produces seven guaranteed prepare_failed results, as recorded in marimo/convert/convert-summary.txt. Filter to .ipynb here or maintain a separate list for Python examples.
    scripts/colab_sources/notebook_paths.txt:12
  • This entry does not exist in the repository, so the committed batch input always produces a prepare_failed result instead of converting the documented Keras pipeline. Update the source CSV and regenerate this list, or remove the stale entry.
    scripts/convert-colab-to-marimo.py:200
  • The command transcript serializes raw subprocess arguments, while prepare_notebook() passes absolute source and target paths. The committed logs consequently contain machine-specific paths such as /Users/noahluna/Desktop/..., so another checkout cannot replay the recorded command and the author's local path is unnecessarily exposed. Sanitize command arguments to repository-relative paths (or omit machine-local transcripts) before writing diagnostics.
    scripts/convert-colab-to-marimo.py:304
  • This invokes marimo convert without checking or repairing the generated PEP 723 metadata. Several committed outputs import marimo but omit it from their dependency headers, so the result is not self-contained in a clean uv environment despite the notebook skill requiring complete runtime dependencies. Add/validate the marimo requirement after conversion or report incomplete metadata as a preparation failure.
  • Files reviewed: 73/98 changed files
  • Comments generated: 10
  • Review effort level: Lite

@@ -0,0 +1,765 @@
# /// script
# dependencies = ["client.git@molecule_tables @ git+https://github.com/wandb/client.git@molecule_tables"]
@@ -0,0 +1,244 @@
# /// script
# dependencies = ["wandb"]
],
)

response_1 = openai.ChatCompletion.create(**chat_request_kwargs)
@@ -0,0 +1,466 @@
# /// script
# dependencies = ["wandb", "wandb-workspaces"]
Comment on lines +146 to +150
@app.cell
def _():
# magic command not supported in marimo; please file an issue to add support
# %%writefile mistral_wandb_lora.yaml
# tokenizer:
@@ -0,0 +1,345 @@
# /// script
# dependencies = ["wandb"]
docs/models/integrations/keras.mdx,36,https://colab.research.google.com/github/wandb/examples/blob/master/colabs/keras/Use_WandbMetricLogger_in_your_Keras_workflow.ipynb,Yes,/wandb/examples/blob/master/colabs/keras/Use_WandbMetricLogger_in_your_Keras_workflow.ipynb
docs/models/integrations/keras.mdx,74,https://colab.research.google.com/github/wandb/examples/blob/master/colabs/keras/Use_WandbModelCheckpoint_in_your_Keras_workflow.ipynb,Yes,/wandb/examples/blob/master/colabs/keras/Use_WandbModelCheckpoint_in_your_Keras_workflow.ipynb
docs/models/integrations/keras.mdx,149,https://colab.research.google.com/github/wandb/examples/blob/master/colabs/keras/Use_WandbEvalCallback_in_your_Keras_workflow.ipynb,Yes,/wandb/examples/blob/master/colabs/keras/Use_WandbEvalCallback_in_your_Keras_workflow.ipynb
docs/models/integrations/keras.mdx,260,https://colab.research.google.com/github/wandb/examples/blob/master/colabs/keras/Keras_pipeline_with_Weights_and_Biases.ipynb,Yes,/wandb/examples/blob/master/colabs/keras/Keras_pipeline_with_Weights_and_Biases.ipynb
Comment thread .agents/skills/README.md
Comment on lines +16 to +20
Use [`../../scripts/convert-colab-to-marimo.py`](../../scripts/convert-colab-to-marimo.py)
to create the initial marimo notebook from a Jupyter `.ipynb`, capture
`marimo check` output, and write a temporary `.conversion/` report directory
for the polishing pass. The report directory includes a Markdown handoff,
raw convert/check output, structured JSON metadata, and an event log.
Comment on lines +1 to +3
# /// script
# requires-python = ">=3.10"
# dependencies = [
Comment on lines +61 to +63
"Run this script from the root of the wandb/examples repository "
"(the directory containing examples/marimo)."
)
Copilot AI review requested due to automatic review settings September 14, 2026 21:55
"optimizer": "Adam"}

entity = wandb_entity.value.strip() or None
model = train_and_log(train_config, entity=entity)
report_5.blocks = [b]
assert b.text == ["Hello", " World!"]
assert report_5.blocks[0].text == ["Hello", " World!"]
initial_assignment_done = True
assert report_5.blocks[0].text == ["Something", " New"]

# Older releases could leave the previously assigned value here.
mutation_example_done = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants