mirror of
https://github.com/vale981/ray
synced 2025-03-05 18:11:42 -05:00
[Tune] Fix Jupyter reporter with older IPython (#24695)
Fixes `JupyterNotebookReporter` not working with older IPython versions (eg. 5.5.0, installed on Google Colab).
This commit is contained in:
parent
b0fa9d6766
commit
8af1cc1ba1
1 changed files with 4 additions and 4 deletions
|
@ -546,12 +546,12 @@ class JupyterNotebookReporter(TuneReporterBase, RemoteReporterMixin):
|
|||
self.display(progress_str)
|
||||
|
||||
def display(self, string: str) -> None:
|
||||
from IPython.core.display import display, HTML
|
||||
from IPython.display import display, HTML, clear_output
|
||||
|
||||
if not self._display_handle:
|
||||
self._display_handle = display(
|
||||
HTML(string), display_id=True, clear=self._overwrite
|
||||
)
|
||||
if self._overwrite:
|
||||
clear_output(wait=True)
|
||||
self._display_handle = display(HTML(string), display_id=True)
|
||||
else:
|
||||
self._display_handle.update(HTML(string))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue