File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 40
40
from ..tag import Tag
41
41
from ..utils import bentoml_cattr
42
42
from ..utils import filter_control_codes
43
+ from ..utils import is_jupyter
43
44
from ..utils import resolve_user_filepath
44
45
from .base import Spinner
45
46
from .schemas .modelschemas import BentoManifestSchema
@@ -625,7 +626,7 @@ def tail_image_builder_logs() -> None:
625
626
f':hourglass: Waiting for deployment "{ self .name } " to be ready. Current status: "{ status .status } "'
626
627
)
627
628
if status .status == DeploymentStatus .ImageBuilding .value :
628
- if tail_thread is None :
629
+ if tail_thread is None and not is_jupyter () :
629
630
tail_thread = Thread (
630
631
target = tail_image_builder_logs , daemon = True
631
632
)
Original file line number Diff line number Diff line change @@ -106,6 +106,11 @@ def filter(self, record: LogRecord) -> bool | LogRecord:
106
106
"handlers" : ["tracehandler" ],
107
107
"propagate" : False ,
108
108
},
109
+ "uvicorn.error" : {
110
+ "level" : logging .WARNING ,
111
+ "handlers" : ["tracehandler" ],
112
+ "propagate" : True ,
113
+ },
109
114
},
110
115
"root" : {
111
116
"handlers" : ["tracehandler" ],
Original file line number Diff line number Diff line change @@ -580,3 +580,23 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
580
580
return wrapper
581
581
582
582
return decorator
583
+
584
+
585
+ def is_jupyter () -> bool : # pragma: no cover
586
+ """Check if we're running in a Jupyter notebook."""
587
+ try :
588
+ get_ipython # type: ignore[name-defined]
589
+ except NameError :
590
+ return False
591
+ ipython = get_ipython () # noqa: F821 # type: ignore[name-defined]
592
+ shell = ipython .__class__ .__name__
593
+ if (
594
+ "google.colab" in str (ipython .__class__ )
595
+ or os .getenv ("DATABRICKS_RUNTIME_VERSION" )
596
+ or shell == "ZMQInteractiveShell"
597
+ ):
598
+ return True # Jupyter notebook or qtconsole
599
+ elif shell == "TerminalInteractiveShell" :
600
+ return False # Terminal running IPython
601
+ else :
602
+ return False # Other type (?)
You can’t perform that action at this time.
0 commit comments