Comments (5)
Thanks for the feedback, we'll take that into consideration. In the meantime, two options that may work for you:
- Forms are a handy way to supply parameters to code, and can be updated programmatically. See a demo notebook here https://colab.research.google.com/notebooks/forms.ipynb
- You can insert code into a new scratch cell, which won't be saved to the notebook but can then be executed by the user:
from google.colab import _frontend
_frontend.create_scratch_cell('print("your code here")')
from colabtools.
Note this is not unrelated to #42 - I'd actually tried %load and found it didn't work either, but it would have only been a half solution to what I want to do. I'm looking at using LLM code generation to read a description from a text box, and then insert the code required in the colab. It's not that dissimilar to the "AI" button, but would be more programmatically controllable.
from colabtools.
Thanks Colab Team! I'll try the scratch cell approach - that might be enough for now, although I'd love to be able to alternate text and code programmatically!
from colabtools.
Hi,
Just some feedback here - the create_scratch_cell approach is pretty much what I needed, but it'd be really nice to have it have the option to make it a regular cell, and to have it append to the end of the current cells. Having the user review the code before pasting it in seems redundant from a security point of view, as you still need to manually run the cell (and the code is easier to read in that cell anyway). Or at least have a one time pop up that says "trust code to be pasted into an executable cell" for this colab.
One other "bug" that I've found is that if you approve the popup too soon, the cell hangs, and you can't execute the scratch cell. Maybe that's a feature, I don't know, but it feels like a bug.
from colabtools.
One other "bug" that I've found is that if you approve the popup too soon, the cell hangs, and you can't execute the scratch cell. Maybe that's a feature, I don't know, but it feels like a bug.
I can't get this to repro for myself - I use the above snippet, execute, immediately click authorize and the cell adds and executes no problem. Am I doing it wrong?
from colabtools.
Related Issues (20)
- Module 4 interrupted, attribute error HOT 2
- INSTALLATION & IMPORTING OF PPSCORE LIBRARY IN GOOGLE COLAB HOT 2
- 视频不见了! HOT 1
- Help page of Google Colab not rendering headings properly HOT 1
- code not working HOT 1
- joblib error in memory.py HOT 12
- I had the same issue, but with your advises I found a solution. However I discover that the images tensors in the dataset cannot be converted to numpy arrays: I've got the error "Unable to read sample at index 1562 from chunk 'images/chunks/5a963182' in tensor images". HOT 2
- Google Colab Pro+ not access A100 GPU HOT 2
- files missing in the mounted drive HOT 1
- Google Colab is so laggy when I using Google Chrome HOT 6
- Print File Issue
- Google Collab shows incorrect credits (units left) HOT 1
- not connecting to hosted runtime HOT 1
- always runtime disconnected
- "File not found" specifying openbuilding country download HOT 3
- Incorrect link for Gemini quickstart in "Welcome to Colab" notebook HOT 1
- Colab AI Error HOT 2
- Variables are not being exchanged for their values when used as an argument in a script HOT 3
- Notebook for Text Classification with Movie Reviews is missing
- Cannot update to latest ggplot2 version in colab R kernel HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colabtools.