Last active
July 11, 2024 14:54
-
-
Save vndee/1725c06e7df15001d5fc5fa321e38e50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from llm_sandbox import SandboxSession | |
with SandboxSession(lang="python", keep_template=True) as session: | |
# Copy a file from the host to the sandbox | |
session.copy_to_runtime("test.py", "/sandbox/test.py") | |
# Run the copied Python code in the sandbox | |
result = session.run("python /sandbox/test.py") | |
print(result) | |
# Copy a file from the sandbox to the host | |
session.copy_from_runtime("/sandbox/output.txt", "output.txt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment