Skip to content

Wandbify skills - #647

Draft
ngrayluna wants to merge 30 commits into
mainfrom
wandbify_skills
Draft

Wandbify skills#647
ngrayluna wants to merge 30 commits into
mainfrom
wandbify_skills

Conversation

@ngrayluna

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.

Copilot AI lite review requested due to automatic review settings August 26, 2026 23:35
@github-actions

Copy link
Copy Markdown
Contributor

▶️ Run the marimo notebook(s) in this PR

molab launches any public marimo notebook on GitHub in a hosted environment — no local setup required.

Notebook molab
marimo/convert/alphafold-with-w-b-align-fold-log/alphafold_with_w_b_align_fold_log.py Open in molab
marimo/convert/configs-in-w-b/configs_in_w_b.py Open in molab
marimo/convert/custom-progress-callback/custom_progress_callback.py Open in molab
marimo/convert/huggingface-wandb/huggingface_wandb.py Open in molab
marimo/convert/hyperparameter-optimization-in-tensorflow-using-w-b-sweeps/hyperparameter_optimization_in_tensorflow_using_w_b_sweeps.py Open in molab
marimo/convert/intro-to-weights-biases-keras/intro_to_weights_biases_keras.py Open in molab
marimo/convert/intro-to-weights-biases/intro_to_weights_biases.py Open in molab
marimo/convert/lcm-diffusers/lcm_diffusers.py Open in molab
marimo/convert/log-a-confusion-matrix-with-w-b/log_a_confusion_matrix_with_w_b.py Open in molab
marimo/convert/log-almost-anything-with-w-b-media/log_almost_anything_with_w_b_media.py Open in molab
marimo/convert/openai-api-autologger-quickstart/openai_api_autologger_quickstart.py Open in molab
marimo/convert/optimize-hugging-face-models-with-weights-biases/optimize_hugging_face_models_with_weights_biases.py Open in molab
marimo/convert/optimize-pytorch-lightning-models-with-weights-biases/optimize_pytorch_lightning_models_with_weights_biases.py Open in molab
marimo/convert/organizing-hyperparameter-sweeps-in-pytorch-with-w-b/organizing_hyperparameter_sweeps_in_pytorch_with_w_b.py Open in molab
marimo/convert/pipeline-versioning-with-w-b-artifacts/pipeline_versioning_with_w_b_artifacts.py Open in molab
marimo/convert/plot-roc-curves-with-w-b/plot_roc_curves_with_w_b.py Open in molab
marimo/convert/report-api-quickstart/report_api_quickstart.py Open in molab
marimo/convert/simple-pytorch-integration/simple_pytorch_integration.py Open in molab
marimo/convert/torchtune-and-wandb/torchtune_and_wandb.py Open in molab
marimo/convert/train-and-debug-yolov5-models-with-weights-biases/train_and_debug_yolov5_models_with_weights_biases.py Open in molab
marimo/convert/use-wandbevalcallback-in-your-keras-workflow/use_wandbevalcallback_in_your_keras_workflow.py Open in molab
marimo/convert/use-wandbmetriclogger-in-your-keras-workflow/use_wandbmetriclogger_in_your_keras_workflow.py Open in molab
marimo/convert/use-wandbmodelcheckpoint-in-your-keras-workflow/use_wandbmodelcheckpoint_in_your_keras_workflow.py Open in molab
marimo/convert/using-w-b-sweeps-with-xgboost/using_w_b_sweeps_with_xgboost.py Open in molab
marimo/convert/w-b-tables-quickstart/w_b_tables_quickstart.py Open in molab
marimo/convert/wandb-artifacts-time-to-live-ttl-walkthrough/wandb_artifacts_time_to_live_ttl_walkthrough.py Open in molab
marimo/convert/zoo-wandb/zoo_wandb.py Open in molab

Links track the head of wandbify_skills.

with wandb.init(project="visualize-predictions", name="html") as run:
# Log HTML from file
path_to_html = "examples/data/some_html.html"
run.log({"custom_file": wandb.Html(open(path_to_html))})
# Initialize a new run
with wandb.init(project="visualize-predictions", name="3d_objects") as run:
path_to_obj = "examples/data/wolf.obj"
run.log({"3d_object": wandb.Object3D(open(path_to_obj))})
model_runner = model.RunModel(cfg, params)
processed_feature_dict = model_runner.process_features(feature_dict, random_seed=0)
prediction_result = model_runner.predict(processed_feature_dict)
mean_plddt = prediction_result['plddt'].mean()
x_train, x_test = (x_train / 255.0, x_test / 255.0)
x_train, y_train = (x_train[::5], y_train[::5])
x_test, y_test = (x_test[::20], y_test[::20])
labels = [str(digit) for digit in range(np.max(y_train) + 1)]
autolog(init=dict(project="diffusers_logging"))

# call the pipeline to generate the images
images = pipeline(
"optimizer": "Adam"}

entity = wandb_entity.value.strip() or None
model = train_and_log(train_config, entity=entity)

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.

Pull request overview

Adds a repo-specific “marimo ↔️ W&B examples” agent skill plus conversion tooling and artifacts to support batch conversion of Colab/Jupyter notebooks (.ipynb) into marimo notebooks (.py) with saved diagnostics under marimo/convert/.

Changes:

  • Added scripts/convert-colab-to-marimo.py for single/batch conversion + marimo check + structured diagnostics output.
  • Added scripts/colab_sources/* inputs and a small helper script (make_list.py) to build normalized conversion path lists.
  • Replaced prior generic/vendored marimo skills with a consolidated repo-specific skill (marimo-wandb-notebooks) and committed initial conversion outputs/logs under marimo/convert/.

Reviewed changes

Copilot reviewed 83 out of 107 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
scripts/convert-colab-to-marimo.py Conversion runner that invokes marimo convert/check and writes .logs/ + batch summary.
scripts/colab_sources/make_list.py Builds a normalized, deduped path list from the CSV “Path” column.
scripts/colab_sources/notebook_paths.txt Batch input list for conversions.
scripts/colab_sources/Notebook_mentions_Exported_wandb_docs_models_list.csv Source CSV of doc references/paths used to derive conversion targets.
marimo/convert/convert-summary.txt Human-readable batch conversion summary.
marimo/convert/zoo-wandb/.logs/result.json Per-notebook structured conversion/check result.
marimo/convert/zoo-wandb/.logs/marimo-convert.log Captured marimo convert transcript.
marimo/convert/zoo-wandb/.logs/marimo-check.log Captured marimo check transcript.
marimo/convert/torchtune-and-wandb/torchtune_and_wandb.py Converted marimo notebook output (currently with check blockers).
marimo/convert/torchtune-and-wandb/.logs/result.json Diagnostics for torchtune conversion/check.
marimo/convert/torchtune-and-wandb/.logs/marimo-convert.log marimo convert transcript for torchtune.
marimo/convert/torchtune-and-wandb/.logs/marimo-check.log marimo check transcript for torchtune.
marimo/convert/lcm-diffusers/lcm_diffusers.py Converted marimo notebook output for diffusers example.
marimo/convert/lcm-diffusers/.logs/result.json Diagnostics for lcm-diffusers conversion/check.
marimo/convert/openai-api-autologger-quickstart/openai_api_autologger_quickstart.py Converted marimo notebook output for OpenAI autologger tutorial.
marimo/convert/openai-api-autologger-quickstart/.logs/result.json Diagnostics for OpenAI autologger conversion/check.
marimo/convert/huggingface-wandb/huggingface_wandb.py Converted marimo notebook output for Hugging Face integration tutorial.
marimo/convert/huggingface-wandb/.logs/result.json Diagnostics for huggingface-wandb conversion/check.
marimo/convert/plot-roc-curves-with-w-b/plot_roc_curves_with_w_b.py Converted marimo notebook output for ROC curve plotting tutorial.
marimo/convert/plot-roc-curves-with-w-b/.logs/result.json Diagnostics for plot-roc conversion/check.
marimo/convert/log-a-confusion-matrix-with-w-b/log_a_confusion_matrix_with_w_b.py Converted marimo notebook output for confusion matrix tutorial.
marimo/convert/log-a-confusion-matrix-with-w-b/.logs/result.json Diagnostics for confusion-matrix conversion/check.
marimo/convert/configs-in-w-b/configs_in_w_b.py Converted marimo notebook output for configs tutorial.
marimo/convert/configs-in-w-b/.logs/result.json Diagnostics for configs conversion/check.
marimo/convert/use-wandbmodelcheckpoint-in-your-keras-workflow/use_wandbmodelcheckpoint_in_your_keras_workflow.py Converted marimo notebook output for Keras ModelCheckpoint tutorial.
marimo/convert/use-wandbmodelcheckpoint-in-your-keras-workflow/.logs/result.json Diagnostics for that conversion/check.
marimo/convert/use-wandbmetriclogger-in-your-keras-workflow/use_wandbmetriclogger_in_your_keras_workflow.py Converted marimo notebook output for Keras MetricsLogger tutorial.
marimo/convert/use-wandbmetriclogger-in-your-keras-workflow/.logs/result.json Diagnostics for that conversion/check.
marimo/convert/use-wandbevalcallback-in-your-keras-workflow/.logs/result.json Diagnostics for EvalCallback conversion/check.
marimo/convert/credit-scorecards-with-xgboost-and-w-b/.logs/result.json Diagnostics for credit-scorecards conversion/check.
marimo/convert/using-w-b-sweeps-with-xgboost/.logs/result.json Diagnostics for XGBoost sweeps conversion/check.
marimo/convert/w-b-tables-quickstart/.logs/result.json Diagnostics for tables quickstart conversion/check.
marimo/convert/report-api-quickstart/.logs/result.json Diagnostics for report API conversion/check.
marimo/convert/simple-pytorch-integration/.logs/result.json Diagnostics for PyTorch integration conversion/check.
marimo/convert/organizing-hyperparameter-sweeps-in-pytorch-with-w-b/.logs/result.json Diagnostics for sweeps notebook conversion/check.
marimo/convert/organizing-hyperparameter-sweeps-in-pytorch-with-w-b/.logs/marimo-convert.log marimo convert transcript for sweeps notebook.
marimo/convert/organizing-hyperparameter-sweeps-in-pytorch-with-w-b/.logs/marimo-check.log marimo check transcript for sweeps notebook.
marimo/convert/pipeline-versioning-with-w-b-artifacts/.logs/result.json Diagnostics for artifacts pipeline conversion/check.
marimo/convert/pipeline-versioning-with-w-b-artifacts/.logs/marimo-convert.log marimo convert transcript for artifacts pipeline.
marimo/convert/pipeline-versioning-with-w-b-artifacts/.logs/marimo-check.log marimo check transcript for artifacts pipeline.
marimo/convert/alphafold-with-w-b-align-fold-log/.logs/result.json Diagnostics for AlphaFold conversion/check.
marimo/convert/alphafold-with-w-b-align-fold-log/.logs/marimo-convert.log marimo convert transcript for AlphaFold.
marimo/convert/alphafold-with-w-b-align-fold-log/.logs/marimo-check.log marimo check transcript for AlphaFold.
marimo/convert/train-and-debug-yolov5-models-with-weights-biases/.logs/result.json Diagnostics for YOLOv5 conversion/check.
marimo/convert/optimize-pytorch-lightning-models-with-weights-biases/.logs/result.json Diagnostics for PyTorch Lightning conversion/check.
marimo/convert/optimize-hugging-face-models-with-weights-biases/.logs/result.json Diagnostics for HF optimization conversion/check.
marimo/convert/hyperparameter-optimization-in-tensorflow-using-w-b-sweeps/.logs/result.json Diagnostics for TF sweeps conversion/check.
marimo/convert/intro-to-weights-biases-keras/intro_to_weights_biases_keras.py Converted marimo notebook output for Keras intro tutorial.
marimo/convert/intro-to-weights-biases-keras/.logs/result.json Diagnostics for Keras intro conversion/check.
marimo/convert/intro-to-weights-biases/.logs/result.json Diagnostics for intro conversion/check.
marimo/convert/log-almost-anything-with-w-b-media/.logs/result.json Diagnostics for “log media” conversion/check.
marimo/convert/wandb-artifacts-time-to-live-ttl-walkthrough/.logs/result.json Diagnostics for TTL walkthrough conversion/check.
marimo/convert/custom-progress-callback/.logs/result.json Diagnostics for custom callback conversion/check.
marimo/convert/log-almost-anything-with-w-b-media/.logs/result.json Diagnostics for media logging conversion/check.
.agents/skills/README.md Updates skill index to point to consolidated repo-specific skill + conversion script.
.agents/skills/marimo-wandb-notebooks/SKILL.md New consolidated skill definition + workflow guidance.
.agents/skills/marimo-wandb-notebooks/references/convert-cleanup.md Reference: how to interpret/act on conversion logs.
.agents/skills/marimo-wandb-notebooks/references/marimo-idioms.md Reference: marimo structure/idioms for this repo.
.agents/skills/marimo-wandb-notebooks/references/tutorial-notebook-objectives.md Reference: preserve tutorial narrative/teaching surface.
.agents/skills/marimo-wandb-notebooks/references/wandb-patterns.md Reference: W&B SDK usage patterns for tutorials.
.agents/skills/marimo-notebook/SKILL.md Removed vendored generic skill content.
.agents/skills/marimo-notebook/references/WATCHING.md Removed (vendored references cleanup).
.agents/skills/marimo-notebook/references/UI.md Removed.
.agents/skills/marimo-notebook/references/TOP-LEVEL-IMPORTS.md Removed.
.agents/skills/marimo-notebook/references/STATE.md Removed.
.agents/skills/marimo-notebook/references/SQL.md Removed.
.agents/skills/marimo-notebook/references/REACTIVITY.md Removed.
.agents/skills/marimo-notebook/references/PYTEST.md Removed.
.agents/skills/marimo-notebook/references/EXPORTS.md Removed.
.agents/skills/marimo-notebook/references/EXPENSIVE.md Removed.
.agents/skills/marimo-notebook/references/DEPLOYMENT.md Removed.
.agents/skills/marimo-notebook/references/CONFIGURATION.md Removed.
.agents/skills/marimo-notebook/references/COLUMNS.md Removed.
.agents/skills/marimo-notebook/references/ANYWIDGET.md Removed.
.agents/skills/marimo-notebook/LICENSE Removed.
.agents/skills/marimo-example-notebook/SKILL.md Removed (superseded by consolidated skill).
.agents/skills/jupyter-to-marimo/SKILL.md Removed (superseded by consolidated skill).
.agents/skills/jupyter-to-marimo/references/widgets.md Removed.
.agents/skills/jupyter-to-marimo/references/latex.md Removed.
.agents/skills/jupyter-to-marimo/LICENSE Removed.
.gitignore Ignores conversion scratch dirs under examples/marimo/*/.conversion/ and a CSV path.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +302 to +318
print(f"Converting {display_path(source, repo_root)}...", flush=True)
commands["convert"] = run_command(
["uvx", "marimo", "convert", str(source), "-o", str(target)],
cwd=repo_root,
)

if commands["convert"].returncode != 0:
status = "convert_failed"
failed_stage = "convert"
else:
print(f"Checking {display_path(target, repo_root)}...", flush=True)
commands["check"] = run_command(
["uvx", "marimo", "check", str(target)],
cwd=repo_root,
)
failed_stage = "check" if commands["check"].returncode != 0 else None
status = "check_failed" if failed_stage else "ok"
Comment on lines +19 to +24
with open(args.input_file, newline="", encoding="utf-8") as f:
paths = {
normalize_path(row["Path"])
for row in csv.DictReader(f)
if row.get("Path")
}
colabs/intro/Intro_to_Weights_&_Biases_keras.ipynb
colabs/intro/Report_API_Quickstart.ipynb
colabs/intro/run_quickstart.ipynb
colabs/keras/Keras_pipeline_with_Weights_and_Biases.ipynb
Comment on lines +31 to +37
examples/boosting-algorithms/xgboost-housing/train.py
examples/keras/keras-cnn-fashion/train.py
examples/pytorch/pytorch-cnn-fashion/fashion_data.py
examples/pytorch/pytorch-ddp/log-ddp.py
examples/tensorflow/tf-cnn-fashion/train.py
examples/tensorflow/tf-estimator-mnist/mnist.py
examples/wandb-sweeps/sweeps-xgboost/xgboost_tune.py
Comment on lines +105 to +109
@app.cell
def _(openai):
# pass your OpenAI key
openai.api_key = 'sk-foo'
return
Comment on lines +175 to +181
@app.cell
def _(os, subprocess):
os.environ['WANDB_PROJECT'] = 'huggingface-demo'
os.environ['TASK_NAME'] = 'MRPC'
#! python run_glue.py --model_name_or_path bert-base-uncased --task_name $TASK_NAME --do_train --do_eval --max_seq_length 256 --per_device_train_batch_size 32 --learning_rate 2e-4 --num_train_epochs 3 --output_dir /tmp/$TASK_NAME/ --overwrite_output_dir --logging_steps 50
subprocess.call(['python', 'run_glue.py', '--model_name_or_path', 'bert-base-uncased', '--task_name', '$TASK_NAME', '--do_train', '--do_eval', '--max_seq_length', '256', '--per_device_train_batch_size', '32', '--learning_rate', '2e-4', '--num_train_epochs', '3', '--output_dir', '/tmp/$TASK_NAME/', '--overwrite_output_dir', '--logging_steps', '50'])
return
- Manage image generation experiments using [Weights & Biases](http://wandb.ai/site).
- Log the prompts, generated images and experiment configs to [Weigts & Biases](http://wandb.ai/site) for visalization.

![](./assets/diffusers-autolog-4.gif)
Comment on lines +43 to +58
@app.cell(hide_code=True)
def _(mo):
mo.md(r"""
# Getting Started with torchtune and Weigths & Biases

In this notebook you will learn how to use [torchtune](https://github.com/pytorch/torchtune) with [Weights & Biases](https://wandb.ai) to monitor your training runs.
""")
return


@app.cell(hide_code=True)
def _(mo):
mo.md(r"""
> You need to select a machine a GPU, go to Runtime > Change runtime type > select a GPU (L40, A100 ideally)
""")
return
Comment on lines +118 to +119
# this determines the name of your wandb project, where all your
# runs will be loggeed
Comment on lines +4 to +21
"command": [
"uvx",
"marimo",
"check",
"/Users/noahluna/Desktop/examples_group/examples/marimo/convert/zoo-wandb/zoo_wandb.py"
],
"exit_code": 1,
"log": "marimo/convert/zoo-wandb/.logs/marimo-check.log"
},
"convert": {
"command": [
"uvx",
"marimo",
"convert",
"/Users/noahluna/Desktop/examples_group/examples/colabs/wandb_registry/zoo_wandb.ipynb",
"-o",
"/Users/noahluna/Desktop/examples_group/examples/marimo/convert/zoo-wandb/zoo_wandb.py"
],
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.

3 participants