How to Build a T4-Friendly Autonomous Data Science Agent with DeepAnalyze-8B, Sandboxed Code Execution, and Iterative Analysis
def _hsize(nbytes): for u in [“B”, “KB”, “MB”, “GB”]: if nbytes < 1024: return f”{nbytes:.1f}{u}” nbytes /= 1024 return f”{nbytes:.1f}TB” def build_prompt(instruction, workspace): exts = (“.csv”, “.xlsx”, “.xls”, “.json”, “.xml”, “.yaml”, “.yml”, “.txt”, “.md”, “.tsv”, “.db”, “.sqlite”) files = sorted(f for f in os.listdir(workspace) if f.lower().endswith(exts)) lines = [f’File {i+1}: {{“name”: “{f}”, “size”: “‘ f'{_hsize(os.path.getsize(os.path.join(workspace,…
