From 85b2a63b6d1fad9c8e5d3883f045189c56a35178 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 16 May 2024 23:15:39 -1000 Subject: [PATCH] fix: matplotlib --- src/lib/components/chat/Messages/CodeBlock.svelte | 4 ++-- src/lib/components/chat/Messages/ResponseMessage.svelte | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/Messages/CodeBlock.svelte b/src/lib/components/chat/Messages/CodeBlock.svelte index a9efc7fa9..5d7ae3f8e 100644 --- a/src/lib/components/chat/Messages/CodeBlock.svelte +++ b/src/lib/components/chat/Messages/CodeBlock.svelte @@ -148,7 +148,7 @@ executing = true; - document.pyodideMplTarget = document.getElementById('plt-canvas'); + document.pyodideMplTarget = document.getElementById(`plt-canvas-${id}`); let pyodide = await loadPyodide({ indexURL: '/pyodide/', @@ -314,6 +314,6 @@ __builtins__.input = input`); {/if} -
+
{/if} diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 13b2ab6c7..66268f51e 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -434,10 +434,10 @@ {:else if message.content === ''} {:else} - {#each tokens as token} + {#each tokens as token, tokenIdx} {#if token.type === 'code'}