Are you sure you want to delete this access key?
title | description |
---|---|
DagsHub integration with Google Colab - Your Cloud Notebook | DagsHub | DagsHub’s integration with Google Colab allows you to open, version, and commit cloud-based Jupyter Notebook with access to free GPU, with no MLOps friction |
Google Colaboratory{:rel="nofollow" target="_blank"} , or "Colab" for short, is a free Jupyter notebook environment that runs entirely in the cloud. It does not require any setup, can be shared easily with team members, and provides free access to GPUs. DagsHub provides its users with Colab Notebook templates for various tasks, such as fully configuring DagsHub with Colab runtime, transferring data from Google Drive to DagsHub Storage, tutorials, and more.
DagsHub is officially integrated with Google Colab, enabling users to open notebooks in a Colab environment directly from DagsHub projects (free GPU included) and also version and commit them back using Git or DVC. Seamlessly build, train, and collaborate on ML models with ZERO MLOps friction.
See an example notebook:
You can easily access your DagsHub remotes using Git, DVC, and MLflow from any Colab environment. Colab allows its users to download files to your runtime using API calls and bash commands. By setting your DagsHub credentials, you'll be able to clone the Git server, pull the data hosted on DagsHub Storage and log experiments to the project's MLflow Tracking server.
To open a notebook from DagsHub in Colab, just navigate to your notebook file preview on DagsHub – there you will see the "Open in Colab" button which will open the notebook in Colab.
Adding topics with the UI
Integrating DagsHub and Colab introduces a significant improvement in notebook version control, as users can use DVC to version large notebooks that Git has trouble facilitating. DagsHub lets you diff notebooks and comment on notebook cells which unlocks collaboration for ML teams, without needing third-party platforms or sharing screenshots across Slack
To version your notebook with the DagsHub Client (run pip install dagshub
to install), use the save_notebook
function as follows:
from dagshub.notebook import save_notebook
save_notebook(repo="<repo_owner>/<repo_name>")
With the following argument:
repo
(str): your DagsHub repository in the format of <repo_owner>/<repo_name>
You can also use the following optional arguments:
path
(str): Where to save the notebook within the repository (including the filename). If the filename is not specified, we'll save it as "notebook-{datetime.now}.ipynb" under the specified folderbranch
(str): The branch under which the notebook should be saved. Will commit to the default repo branch if not specifiedcommit_message
(str): The commit message for the updateversioning
(str): ['git'|'dvc']
The VCS used to version the notebook!!! info "Alternative way to version your Colab notebook"
In some cases the above function might fail due to Colab related issues. An alternative way to version your notebook is to download it locally, then in an environment with pip install dagshub
run the following snippet:
python import dagshub dagshub.upload_files(repo="<repo_owner>/<repo_name>", local_path="<path/to/notebook.ipynb>", remote_path="<path/in/remote/notebook.ipynb>", commit_message="<commit_message>")
With this notebook, you can easily pull all of your project’s components from DagsHub to Colab runtime, train the model, log the experiments, version the changes, and push them to DagsHub remotes. You need to simply check some boxes, fill in your details, run the notebook, and you’re set to go! Behind the scenes, it will configure your DagsHub project with Colab and pull the project components you choose to the run time. From the DagYard cell on, you will be able to work on your project, version the changes with Git and DVC, and easily push them to the DagsHub remotes.
Follow this notebook to copy and version directories from Google Drive to DagsHub storage using DVC.
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?