Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

382 B
Raw Blame
#!/usr/bin/env python3
"""The client's own cleanup: terminate every sandbox it still holds."""

import glob
import json
import os

import modal

for p in glob.glob(os.path.join(os.environ["CHAOS_DIR"], "slots", "*.json")):
    try:
        modal.Sandbox.from_id(json.load(open(p))["id"]).terminate()
    except Exception as e:
        print("terminate failed:", e)
    os.unlink(p)