mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Add support to Marimo Notebooks and Enverge.ai (#38210)
* Add support to Marimo notebooks * Consice logic * Simplify logic * Ruff fixes
This commit is contained in:
parent
d34e21e7dd
commit
8ea61c4530
@ -1222,6 +1222,9 @@ def is_keras_nlp_available():
|
||||
|
||||
def is_in_notebook():
|
||||
try:
|
||||
# Check if we are running inside Marimo
|
||||
if "marimo" in sys.modules:
|
||||
return True
|
||||
# Test adapted from tqdm.autonotebook: https://github.com/tqdm/tqdm/blob/master/tqdm/autonotebook.py
|
||||
get_ipython = sys.modules["IPython"].get_ipython
|
||||
if "IPKernelApp" not in get_ipython().config:
|
||||
|
Loading…
Reference in New Issue
Block a user