Wandbify skills - #647
Draft
ngrayluna wants to merge 30 commits into
Draft
Conversation
Contributor
|
| 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) |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a repo-specific “marimo .ipynb) into marimo notebooks (.py) with saved diagnostics under marimo/convert/.
Changes:
- Added
scripts/convert-colab-to-marimo.pyfor 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 undermarimo/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. | ||
|
|
||
|  |
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" | ||
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
scripts/convert-colab-to-marimo.pyconverts individual.ipynbnotebooks or a batch list to marimo.pyfiles. It runsmarimo convertand an initialmarimo check. Records and saves diagnostics as JSON and/or.txtfiles.Outputs are written under
marimo/convert/: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:
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, purposewandb-patterns.md: contains W&B SDK conventionsscripts/convert-colab-to-marimo.pyhandles mechanical conversion and initial validation; agents rerunmarimo checkduring cleanup and final verification.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.