Wandbify skills - #647
Draft
ngrayluna wants to merge 54 commits into
Draft
Wandbify skills#647ngrayluna wants to merge 54 commits into
ngrayluna wants to merge 54 commits into
Conversation
| @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 |
| # 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") |
Contributor
There was a problem hiding this comment.
🟡 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.ipynbas passed and points tomarimo/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 orOPENAI_API_KEYwithout 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 cleanuvx marimo edit --sandboxrun will fail dependency resolution before this converted notebook can start; replace this placeholder with the actual runtime requirements (includingmarimo) 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
Pathcolumn also containsexamples/.../*.pyentries, butprepare_notebook()rejects every non-.ipynbinput. Because this comprehension copies every non-empty path, the checked-in batch list produces seven guaranteedprepare_failedresults, as recorded inmarimo/convert/convert-summary.txt. Filter to.ipynbhere 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_failedresult 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 convertwithout checking or repairing the generated PEP 723 metadata. Several committed outputs importmarimobut omit it from their dependency headers, so the result is not self-contained in a cleanuvenvironment despite the notebook skill requiring complete runtime dependencies. Add/validate themarimorequirement 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 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)." | ||
| ) |
Replace the legacy YOLOv5 repository workflow with the maintained Ultralytics package and add gated dataset preparation, detection, and W&B training interactions.
| "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 |
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.Updated notebooks