examples icon indicating copy to clipboard operation
examples copied to clipboard

Adds new artifacts colab.

Open katjacksonWB opened this issue 9 months ago • 7 comments

Adds a new Artifacts colab to replace the old, outdated one linked on the Artifacts landing page.

katjacksonWB avatar May 15 '24 22:05 katjacksonWB

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Thanks for contributing to wandb/examples! We appreciate your efforts in opening a PR for the examples repository. Our goal is to ensure a smooth and enjoyable experience for you 😎.

Guidelines

The examples repo is regularly tested against the ever-evolving ML stack. To facilitate our work, please adhere to the following guidelines:

  • Notebook naming: You can use a combination of snake_case and CamelCase for your notebook name. Avoid using spaces (replace them with _) and special characters (&%$?). For example:
Cool_Keras_integration_example_with_weights_and_biases.ipynb 

is acceptable, but

Cool Keras Example with W&B.ipynb

is not. Avoid spaces and the & character. To refer to W&B, you can use: weights_and_biases or just wandb (it's our library, after all!)

  • Managing dependencies within the notebook: You may need to set up dependencies to ensure that your code works. Please avoid the following practices:

    • Docker-related activities. If Docker installation is required, consider adding a full example with the corresponding Dockerfile to the wandb/examples/examples folder (where non-Colab examples reside).
    • Using pip install as the primary method to install packages. When calling pip in a cell, avoid performing other tasks. We automatically filter these types of cells, and executing other actions might break the automatic testing of the notebooks. For example,
    pip install -qU wandb transformers gpt4
    

    is acceptable, but

    pip install -qU wandb
    import wandb
    

    is not.

    • Installing packages from a GitHub branch. Although it's acceptable 😎 to directly obtain the latest bleeding-edge libraries from GitHub, did you know that you can install them like this:
    !pip install -q git+https://github.com/huggingface/transformers
    

    You don't need to clone, then cd into the repo and install it in editable mode.

    • Avoid referencing specific Colab directories. Google Colab has a /content directory where everything resides. Avoid explicitly referencing this directory because we test our notebooks with pure Jupyter (without Colab). Instead, use relative paths to make the notebook reproducible.
  • The Jupyter notebook file .ipynb is nothing more than a JSON file with primarily two types of cells: markdown and code. There is also a bunch of other metadata specific to Google Colab. We have a set of tools to ensure proper notebook formatting. These tools can be found at wandb/nb_helpers.

Before merging, wait for a maintainer to clean and format the notebooks you're adding. You can tag @tcapelle.

Before marking the PR as ready for review, please run your notebook one more time. Restart the Colab and run all. We will provide you with links to open the Colabs below

The following colabs were changed -colabs/wandb-artifacts/Artifact_fundamentals.ipynb

github-actions[bot] avatar May 15 '24 22:05 github-actions[bot]

Hey @katjacksonWB - some feedback from reviewing the whole thing:

  • I think it's important to cover how to version an artifact because if not the colab doesn't really show the utility of logging your stuff to an artifact. It can be a minimal example, like adding a few new images and showing that a new version is created
  • the colab should also showcase how someone can navigate to the UI for the artifact logged and link to a public project that the user can look at the understand how the actions done in colab reflect in UI (the SDK prints out a URL so we should show user how to find this to get to the UI from their log_artifact command)

noaleetz avatar May 16 '24 21:05 noaleetz

Ping me when ready for final review/merge

tcapelle avatar May 27 '24 08:05 tcapelle

Why we don't show the classic:

# you can log using the one-liner:
wandb.log_artifact("file.csv", name="my_artifact", type="data")

# or
at = Artifact(name="my_artifact",  type="data")
at.add_file("file.csv")
# add_dir(...)
wandb.log_artifact(at)
  • Shouldn't this live in wandb-artifacts?
  • Please also replace the "old outdated one"

is referring to a specific line?

noaleetz avatar Jun 10 '24 17:06 noaleetz

Why we don't show the classic:

# you can log using the one-liner:
wandb.log_artifact("file.csv", name="my_artifact", type="data")

# or
at = Artifact(name="my_artifact",  type="data")
at.add_file("file.csv")
# add_dir(...)
wandb.log_artifact(at)
  • Shouldn't this live in wandb-artifacts?
  • Please also replace the "old outdated one"

is referring to a specific line?

This plan and the code don't match: image

You are doing 2+3+4 in one line.

tcapelle avatar Jun 12 '24 09:06 tcapelle

I would also use this PR to remove/replace old stuff in wandb-artifacts (and put this file in there as a getting started)

tcapelle avatar Jun 12 '24 09:06 tcapelle

Hey @rymc - would you be up to revising the changes you proposed directly? Katherine is out on medical leave so I am trying to get some support with wrapping up her in-flight docs PR so we can get the new and improved Artifacts colab out. If it is easy enough to make those fixes directly that would be a huge help so I can focus on some of the other docs work.

noaleetz avatar Jul 07 '24 00:07 noaleetz

Hey @noaleetz done. Addressed comments and confirmed working on Colab.

rymc avatar Jul 08 '24 09:07 rymc

Hey @noaleetz done. Addressed comments and confirmed working on Colab.

Ryan you are awesome, thank you so so much. I will give the colab a final run myself, but we should be good to merge. @ngrayluna can I ask you to give your review and stamp as well?

noaleetz avatar Jul 08 '24 20:07 noaleetz

Ah, good point @ngrayluna. I've pushed a new version that makes the Colab notebook executable regardless of where it runs.

rymc avatar Jul 10 '24 08:07 rymc

PR for small nits: https://github.com/wandb/examples/pull/548

ngrayluna avatar Jul 22 '24 15:07 ngrayluna

can you make both wandbcode consistent?

tcapelle avatar Jul 24 '24 21:07 tcapelle

can you make both wandbcode consistent?

Not sure I follow?

ngrayluna avatar Jul 24 '24 21:07 ngrayluna