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:
brenoca 2025-05-20 14:26:34 +02:00 committed by GitHub
parent d34e21e7dd
commit 8ea61c4530
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: