How can I dynamically populate a form field in my Colab notebook from a URL query parameter so I can construct preconfigured links to it from another system? I tried adapting Can a Jupyter / IPython notebook take arguments in the URL? but the JS in colab runs in a sandboxed iframe with a referrer policy which removed the path and query from document.referrer.
I would also like to make it as easy as possible for someone following such a link to run the notebook on the data supplied in the form fields. Is it possible to connect and run all automatically on opening a notebook? Is there a way to display a 'Run all' button so the user does not have to hunt for it in the menu?
Related
In Google's colab jupyter notebook I have a canvas object which displays nicely on the scree. Now I want to save it on the disk as a figure using toyplot:
import toyplot.pdf
toyplot.pdf.render(canvas, "fig.pdf")
Upon execution the code runs quitely and returns no error.
However, no file is saved nor a dialog is shown.
Using Chrome on Ubuntu.
Am I missing something?
There used to be an option in Google Colab under File called Update Drive preview. I no longer see that option and my previews are very out of date. I assumed if it was removed that maybe the preview was updated when saving, but that does not appear to be the case. The worst part is that I have renamed the files and the preview still shows the old filename along the top, which can be confusing. Is another way that I can make this update occur?
Edit:
It is important to note that I do not want the URL for sharing to change, so making a copy would not work as a solution.
The Update Drive preview is now available through the command palette in Colab which is available through Tools->command palette, [CMD/CTRL]+SHIFT+P, or in the menu along the left side of the notebook.
Does anyone know how exactly I can share a unique version of a google colab doc? I have a colab sheet on my Google Drive and I want to allow for someone to access the file, run, make edits, etc. However, I don't want any of the edits made to be on my version of the doc.
I've searched everywhere...
To share a link to your notebook that allows editing but does not modify your copy, first open the notebook in playground mode using the command palette. (Tools menu -> Command palette)
Then, select the 'Open in playground' command.
This will reload the notebook with a new URL that you can share, allowing others to modify and execute an ephemeral copy of the notebook without modifying the original. If they attempt to save, they will be prompted to create a copy in their own Drive.
I uploaded a previously created Jupyter notebook. I could initially see all the cell outputs in Colab right after uploading it, but if I close the notebook and come back to it later -- or if I share the notebook with a coworker -- then all the cell outputs have been cleared, which is quite annoying.
This is happening even though I've verified that the following two checkboxes are UNCHECKED:
Edit > Notebook settings > Omit code cell output when saving this notebook
Tools > Preferences > New notebooks use private outputs (omit outputs when saving)
From what I can tell, it looks like the cell outputs get preserved across sessions for notebooks created and edited in Colab, but not for notebooks that were created elsewhere and then uploaded. What am I missing? How can I preserve cell outputs across sessions in uploaded notebooks?
Are you trying to open the file from Drive directly in Jupyter?
If so, you'll need to save the full file using the File -> Download ipynb menu item.
By default, Colab saves outputs using a different format to support incremental saves, so the Drive file created during auto-save will show outputs, but only in Colab itself, and you'll need to download the full ipynb to export to other notebook viewing tools.
I cannot find a way to find a specific file in a custom model via the online GUI. I have uploaded the file via the api along with several hundred images used for training. How can I filter the files displayed using the image id only. From there can I view the results of the prediction. I tried drag and drop and got a selected image displayed with a selected tick mark.
Anybody any idea where I go from here?
Or is there another way?