Description of image

How to Add a Run on Gradient Badge for Notebooks

Notebooks are a web-based Jupyter IDE with shared persistent storage for long-term development and inter-notebook collaboration, backed by accelerated compute.


Run on Gradient uses a button to launch Jupyter notebooks.

Run on Gradient Run on Gradient

Run on Gradient provides additional configuration options and more GPU machine types.

Run on Gradient badges bring interactivity to GitHub repos

Try the link builder below to create your own Run on Gradient link.

Inputs

Link to repo on GitHub

Link to container (List of Templates)

Link to machine (List of machines)

Outputs

Add a valid Github repo
[![Run on Gradient](https://assets.paperspace.io/img/gradient-badge.svg)](Add a valid Github repo)
<a href='Add a valid Github repo'><img src='https://assets.paperspace.io/img/gradient-badge.svg' alt='Run on Gradient'/></a>
Run on Gradient

Configuration parameters

The following configuration parameters are available in Run on Gradient:

  1. Repository
  2. Container
  3. Machine type

The following are examples of Run on Gradient links. The only mandatory parameter is the repository or .ipynb file to pull into the notebook. The container and machine type are optional.

Parameter Required Query String Example
Repository or file Yes None https://console.paperspace.com/github/nlp-with-transformers/notebooks/blob/main/02_classification.ipynb
Container No container= https://console.paperspace.com/github/nlp-with-transformers/notebooks/blob/main/02_classification.ipynb?container=paperspace/gradient-base:tf29-pt112-py39-2022-06-29
Machine No machine= https://console.paperspace.com/github/nlp-with-transformers/notebooks/blob/main/02_classification.ipynb?machine=P4000

The container= and machine= parameters follow standard query string formatting rules.

Before the first query string, insert the ? symbol and use the & symbol after each query string excluding the last query.

Below is an example of a Run on Gradient link that features both container= and machine= query strings:

https://console.paperspace.com/github/nlp-with-transformers/notebooks/blob/main/02_classification.ipynb?container=paperspace/gradient-base:tf29-pt112-py39-2022-06-29&machine=P4000

How to Create the Run on Gradient Button

This is the Markdown syntax used to apply the Run on Gradient button in a GitHub repository:

[![Gradient](https://assets.paperspace.io/img/gradient-badge.svg)](https://console.paperspace.com/github/huggingface/nlp/blob/master/notebooks/Overview.ipynb)

The HTML equivalent to the Markdown syntax is like this:

<a href="https://console.paperspace.com/github/huggingface/nlp/blob/master/notebooks/Overview.ipynb">
  <img src="https://assets.paperspace.io/img/gradient-badge.svg" alt="Run on Gradient"/>
</a>
Note
Remember to replace the notebook URL in this template with the notebook you want to link.

The Run on Gradient link directs you to a Gradient Notebook in offline view.

Here is an example of a notebook that the Run on Gradient could direct to:

Run on Gradient offline view

Next, you are prompted to sign up for a Paperspace account or to login via Google, GitHub, or email.

Sign up for or login to a Paperspace account to run the notebook

After signing up or logging in, the notebook is online and usable:

Clicking the badge brings the user to a static notebook page where they may run the notebook