Skip to content

Support .ipynb with colab run. #74

Description

@ggprior

Currently colab run --gpu T4 notebook.ipynb attempts to execute the notebook .json as Python:

$ colab run tiny.ipynb
[colab] Creating session 'run-8f06e6'...
[colab] Session READY (run-8f06e6). Executing tiny.ipynb...
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
/tmp/ipykernel_1065/1694935949.py in <cell line: 0>()
      5 {
      6  "cells": [
----> 7   {"cell_type": "code", "execution_count": null, "id": "a", ... "source": ["print('hello from cell 1')\n", "x = 21"]},
      8   {"cell_type": "code", "execution_count": null, "id": "b", ... "source": ["print('cell 2 result:', x*2)"]}
      9  ],
NameError: name 'null' is not defined
[colab] Stopping session 'run-8f06e6'...
[colab] Session terminated.
=== EXIT CODE: 1 ===

That was a slight gotcha for me -- in particular as the same will work for colab exec.
Would you be interested in a PR that adds support for .ipynb on the colab run command?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions