Download gradio/ipython_ext.py from Asukaa02/tet: direct link, hf CLI and curl.
- Browser
- Download file 564 Bytes
-
https://huggingface.co/Asukaa02/tet/resolve/main/gradio/ipython_ext.py
- Command line
-
hf download hf://Asukaa02/tet/gradio/ipython_ext.py
-
curl -L -o ipython_ext.py https://huggingface.co/Asukaa02/tet/resolve/main/gradio/ipython_ext.py
564 Bytes
| try: | |
| from IPython.core.magic import needs_local_scope, register_cell_magic | |
| except ImportError: | |
| pass | |
| import warnings | |
| import gradio as gr | |
| def load_ipython_extension(ipython): | |
| __demo = gr.Blocks() | |
| def blocks(line, cell, local_ns=None): | |
| if "gr.Interface" in cell: | |
| warnings.warn( | |
| "Usage of gradio.Interface with %%blocks may result in errors." | |
| ) | |
| with __demo.clear(): | |
| exec(cell, None, local_ns) | |
| __demo.launch(quiet=True) | |