Skip to content

Commit 05a6fa0

Browse files
committed
added Marimo support for echo=True
1 parent b66f2a0 commit 05a6fa0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

guidance/models/_model.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
torch_is_imported = True
3030
except ImportError:
3131
torch_is_imported = False
32-
32+
try:
33+
import marimo
34+
marimo_is_imported = True
35+
except ImportError:
36+
marimo_is_imported = False
3337

3438
logger = logging.getLogger(__name__)
3539
try:
@@ -1026,6 +1030,8 @@ def _update_display(self, throttle=True):
10261030
if ipython_is_imported:
10271031
clear_output(wait=True)
10281032
display(HTML(self._html()))
1033+
elif marimo_is_imported:
1034+
marimo.output.replace(marimo.Html(self._html()))
10291035
else:
10301036
pprint(self._state)
10311037

@@ -1612,4 +1618,4 @@ def _check_dominated(node, parser, match_version, next_byte_mask):
16121618
parser.pos = curr_pos
16131619
if not child_dominate:
16141620
return False
1615-
return True
1621+
return True

0 commit comments

Comments
 (0)