-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add model artifact and registry info to huggingface examples #451
base: master
Are you sure you want to change the base?
Changes from 1 commit
85a61e0
b659a0c
5409a95
23a382e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -10,18 +9,16 @@ | |
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Hugging Face + W&B\n", | ||
"Visualize your [Hugging Face](https://github.com/huggingface/transformers) model's performance quickly with a seamless [W&B](https://wandb.ai/site) integration.\n", | ||
"\n", | ||
"Compare hyperparameters, output metrics, and system stats like GPU utilization across your models. \n" | ||
"Compare hyperparameters, output metrics, and system stats like GPU utilization across your models.\n" | ||
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -31,7 +28,6 @@ | |
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -52,7 +48,6 @@ | |
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -63,15 +58,13 @@ | |
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# 🚀 Install, Import, and Log in\n" | ||
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -104,15 +97,13 @@ | |
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## 🖊️ [Sign up for a free account →](https://app.wandb.ai/login?signup=true)" | ||
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -131,7 +122,6 @@ | |
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -144,12 +134,11 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Optional: log both gradients and parameters\n", | ||
"%env WANDB_WATCH=all" | ||
"# Optional: log model checkpoints as W&B Artifacts\n", | ||
"%env WANDB_LOG_MODEL=\"checkpoint\"" | ||
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -164,6 +153,7 @@ | |
"outputs": [], | ||
"source": [ | ||
"%env WANDB_PROJECT=huggingface-demo\n", | ||
"%env WANDB_LOG_MODEL=checkpoint\n", | ||
"%env TASK_NAME=MRPC\n", | ||
"\n", | ||
"!python run_glue.py \\\n", | ||
|
@@ -177,11 +167,13 @@ | |
" --num_train_epochs 3 \\\n", | ||
" --output_dir /tmp/$TASK_NAME/ \\\n", | ||
" --overwrite_output_dir \\\n", | ||
" --logging_steps 50" | ||
" --logging_steps 50 \\\n", | ||
" --save_steps 100 \\\n", | ||
" --eval_steps 100 \\\n", | ||
" --report_to \"wandb\"" | ||
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
|
@@ -199,12 +191,39 @@ | |
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Model Artifacts\n", | ||
"\n", | ||
"### 📈 Track key information effortlessly by default\n", | ||
"You will also be able to view your model checkpoints in the W&B [Artifacts](https://docs.wandb.ai/guides/artifacts) page of the run above. These artifacts store all the metadata associated with this model, the W&B runs consuming it, and the whole lineage of upstream and downstream artifacts!\n", | ||
"\n", | ||
"Here's an example of the artifacts generated from the above run\n", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change text to
We should embed the image rather than link to gdrive, but ideally can we just link to this view (if project is public) so people can see output summary in the UI? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added link to workspace artifacts page instead of image. |
||
"\n", | ||
"![run_artifacts](https://drive.google.com/uc?export=view&id=1janWuNXhxgIbNnSZjSON51dq-DVv8S0i)\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Model Registry\n", | ||
"After logging a bunch of checkpoints across multiple runs during experimentation, now comes time to hand-off the best checkpoint to the next stage of the workflow (e.g. testing, deployment).\n", | ||
"\n", | ||
"The Model Registry is a central page that lives above individual W&B projects. It houses **Registered Models**, portfolios that store \"links\" to the valuable checkpoints living in individual W&B Projects.\n", | ||
"\n", | ||
"The model registry offers a centralized place to house the best checkpoints for all your model tasks. Any `model` artifact you log can be \"linked\" to a Registered Model. Please refer to the following [tutorial](https://colab.research.google.com/github/wandb/examples/blob/master/colabs/wandb-model-registry/Model_Registry_E2E.ipynb) for more information related to the model registry\n", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should link the Model Registry docs rather than jumping straight into the colab? https://docs.wandb.ai/guides/models:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated as suggested. |
||
"\n", | ||
"<a href=\"https://colab.research.google.com/github/wandb/examples/blob/master/colabs/wandb-model-registry/Model_Registry_E2E.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n", | ||
"## 📈 Track key information effortlessly by default\n", | ||
"Weights & Biases saves a new run for each experiment. Here's the information that gets saved by default:\n", | ||
"- **Hyperparameters**: Settings for your model are saved in Config\n", | ||
"- **Model Metrics**: Time series data of metrics streaming in are saved in Log\n", | ||
|
@@ -213,21 +232,19 @@ | |
] | ||
}, | ||
{ | ||
"attachments": {}, | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## 🤓 Learn more!\n", | ||
"- [Documentation](https://docs.wandb.com/huggingface): docs on the Weights & Biases and Hugging Face integration\n", | ||
"- [Videos](http://wandb.me/youtube): tutorials, interviews with practitioners, and more on our YouTube channel\n", | ||
"- Contact: Message us at [email protected] with questions " | ||
"- Contact: Message us at [email protected] with questions" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"accelerator": "GPU", | ||
"colab": { | ||
"include_colab_link": true, | ||
"provenance": [], | ||
"toc_visible": true | ||
}, | ||
|
@@ -237,5 +254,5 @@ | |
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
"nbformat_minor": 0 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated as suggested