From 6c69e09c6afa7f6776a8fe26bbe9a80406b959c3 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Wed, 4 Sep 2024 23:10:38 -0700 Subject: [PATCH 1/3] Bump version to 0.0.13 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f909be9bf..c144a1720 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ def read_requirements(): setup( name="llama_toolchain", - version="0.0.12", + version="0.0.13", author="Meta Llama", author_email="llama-oss@meta.com", description="Llama toolchain", From f6b5e394ab9d61a0928ac477708b7bcdde499868 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 5 Sep 2024 15:37:12 -0700 Subject: [PATCH 2/3] Remove dependence on os.environ["USER"] --- .../agentic_system/meta_reference/agentic_system.py | 4 ++-- llama_toolchain/tools/builtin.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llama_toolchain/agentic_system/meta_reference/agentic_system.py b/llama_toolchain/agentic_system/meta_reference/agentic_system.py index 4fa2aa584..09fbfdde5 100644 --- a/llama_toolchain/agentic_system/meta_reference/agentic_system.py +++ b/llama_toolchain/agentic_system/meta_reference/agentic_system.py @@ -6,7 +6,7 @@ import logging -import os +import tempfile import uuid from typing import AsyncGenerator @@ -71,7 +71,7 @@ class MetaReferenceAgenticSystemImpl(AgenticSystem): tool = CodeInterpreterTool() elif isinstance(tool_defn, PhotogenToolDefinition): tool = PhotogenTool( - dump_dir="/tmp/photogen_dump_" + os.environ["USER"], + dump_dir=tempfile.mkdtemp(), ) else: continue diff --git a/llama_toolchain/tools/builtin.py b/llama_toolchain/tools/builtin.py index f2ddeefa7..3a53e2e26 100644 --- a/llama_toolchain/tools/builtin.py +++ b/llama_toolchain/tools/builtin.py @@ -5,8 +5,8 @@ # the root directory of this source tree. import json -import os import re +import tempfile from abc import abstractmethod from typing import List, Optional @@ -284,7 +284,7 @@ class WolframAlphaTool(SingleMessageBuiltinTool): class CodeInterpreterTool(BaseTool): def __init__(self) -> None: ctx = CodeExecutionContext( - matplotlib_dump_dir=f"/tmp/{os.environ['USER']}_matplotlib_dump", + matplotlib_dump_dir=tempfile.mkdtemp(), ) self.code_executor = CodeExecutor(ctx) From dd1e1ceb1332abc509d3a7d97a8578d4b300757d Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 5 Sep 2024 16:45:58 -0700 Subject: [PATCH 3/3] Add bubblewrap to the container --- llama_toolchain/core/build_container.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/llama_toolchain/core/build_container.sh b/llama_toolchain/core/build_container.sh index b864e7098..ec2ca8a0c 100755 --- a/llama_toolchain/core/build_container.sh +++ b/llama_toolchain/core/build_container.sh @@ -48,6 +48,7 @@ RUN apt-get update && apt-get install -y \ curl wget telnet \ procps psmisc lsof \ traceroute \ + bubblewrap \ && rm -rf /var/lib/apt/lists/* EOF