Communitygithub.com

Uni-Mol 工具 - 分子性质预测 CLI

基于 Uni-Mol Tools 的分子性质预测模型训练与推理交互式命令行工具,支持 5 种任务类型和项目管理。

Uni-Mol 工具 - 分子性质预测 CLI 是什么?

Uni-Mol Tools - 分子性质预测 CLI 是一个专业命令行工具,用于训练和推理分子性质预测模型。它基于 Uni-Mol Tools 后端,支持 5 种任务类型:二分类、回归、多分类、多标签分类和多标签回归。该工具提供完整的项目管理功能,允许用户组织实验、跟踪模型性能排名,并自动分析存储使用情况以清理低效模型。通过 `--json` 标志支持 JSON API 模式,便于自动化集成,同时提供交互式 REPL 模式(含 Tab 补全和历史记录)。支持的平台包括 Python 3.8+ 和 PyTorch 1.12+ 环境,训练需 8GB+ 内存。典型用例包括药物发现中的活性预测、亲和力回归等分子性质建模任务。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/HKUDS/CLI-Anything/tree/main/skills/cli-anything-unimol-tools

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Uni-Mol 工具 - 分子性质预测 CLI 是做什么的?

包名: cli-anything-unimol-tools 命令: python3 -m cli_anything.unimol_tools

描述

基于 Uni-Mol Tools 的分子性质预测模型训练与推理交互式命令行工具。支持 5 种任务类型:二分类、回归、多分类、多标签分类和多标签回归。

主要特性

  • 项目管理: 通过命名项目组织实验
  • 5 种任务类型: 分类、回归、多分类、多标签变体
  • 模型追踪: 自动记录性能历史与排名
  • 智能存储: 分析使用情况并清理低效模型
  • JSON API: 使用 --json 标志支持完全自动化

常用命令

项目管理

# 创建新项目
project create --name drug_discovery

# 列出所有项目
project list

# 切换项目
project switch --name drug_discovery

训练

# 训练分类模型
train --data-path train.csv --target-col active --task-type classification --epochs 10

# 训练回归模型
train --data-path train.csv --target-col affinity --task-type regression --epochs 10

模型管理

# 列出所有已训练模型
models list

# 显示模型详情和性能
models show --model-id <id>

# 按性能排名模型
models rank

存储与清理

# 分析存储使用情况
storage analyze

# 自动清理低效模型
cleanup auto

# 手动清理(按条件)
cleanup manual --max-models 10 --min-score 0.7

预测

# 使用已训练模型进行预测
predict --model-id <id> --data-path test.csv

数据格式

CSV 文件必须包含:

  • SMILES 列:SMILES 格式的分子结构
  • 目标列:要预测的值(通过 --target-col 指定列名)

示例:

SMILES,target
CCO,1
CCCO,0
CC(C)O,1

任务类型

  1. classification: 二分类 (0/1)
  2. regression: 连续值预测
  3. multiclass: 多类别分类
  4. multilabel_classification: 多标签二分类
  5. multilabel_regression: 多标签连续值预测

JSON 模式

为任何命令添加 --json 标志以获取机器可读输出:

python3 -m cli_anything.unimol_tools --json models list

输出格式:

{
  "status": "success",
  "data": [...],
  "message": "..."
}

交互模式

不带命令启动以进入交互式 REPL:

python3 -m cli_anything.unimol_tools

功能:

  • Tab 补全
  • 命令历史
  • 上下文帮助
  • 项目状态持久化

测试数据

示例数据集位于: https://github.com/545487677/CLI-Anything-unimol-tools/tree/main/unimol_tools/examples

包含所有 5 种任务类型的数据。

要求

  • Python 3.8+
  • PyTorch 1.12+
  • Uni-Mol Tools 后端
  • 4GB+ 内存(建议训练时使用 8GB+)

安装

cd unimol_tools/agent-harness
pip install -e .

文档

测试

cd docs/test
bash run_tests.sh --unit -v    # 单元测试(67 个测试)
bash run_tests.sh --full -v    # 完整测试套件

性能提示

  • 初始实验从 10 个 epoch 开始
  • 如果内存有限,使用更小的批量大小
  • 用 storage analyze 监控存储
  • 使用 models rank 识别最佳模型
  • 定期用 cleanup auto 清理

故障排除

  • CUDA 错误: 减小批量大小或使用 CPU 模式
  • CSV 无法识别: 确认存在 SMILES 列
  • 准确率低: 尝试更多 epoch 或调整学习率
  • 存储已满: 运行 cleanup auto 释放空间

相关资源

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cli-anything-adguardhome

>-

cli-anything-anygen

>-

cli-anything-audacity

>-

cli-anything-blender

>-

cli-anything-browser

Browser automation CLI using DOMShell MCP server. Maps Chrome

cli-anything-calibre

>-

cli-anything-ccswitch

CLI interface for CC Switch — manage AI coding tool configurations from the terminal

cli-anything-chromadb

>-

cli-anything-cloudanalyzer

Command-line interface for CloudAnalyzer — Agent-friendly harness for CloudAnalyzer, a QA platform for mapping, localization, and perception outputs. Supports 27 commands across 8 groups: point cloud evaluation, trajectory evaluation, ground segmentation QA, config-driven quality gates, baseline evolution, processing, visualization, and interactive REPL.

cli-anything-cloudcompare

Command-line interface for CloudCompare — Agent-friendly harness for CloudCompare, the open-source 3D point cloud and mesh processing software. Supports 41 commands across 9 groups: project management, session control, point cloud operations (subsample, filter, segment, analyze), mesh operations, distance computation (C2C, C2M), transformations (ICP, matrix), export (LAS/LAZ/PLY/PCD/OBJ/STL/E57), and interactive REPL.

cli-anything-comfyui

>-

cli-anything-dify-workflow

Wrapper for the Dify workflow DSL CLI. Create, inspect, validate, edit, and export Dify workflow files through a CLI-Anything harness.

cli-anything-drawio

>-

cli-anything-eez-studio

Use EEZ Studio from the command line: inspect and modify native .eez-project files, edit LVGL screens/widgets, manage SCPI commands, and invoke the real EEZ Studio backend for LVGL builds.

cli-anything-eth2-quickstart

>-

cli-anything-exa

>-

cli-anything-firefly-iii

Firefly III CLI - Personal finance management via CLI-Anything

cli-anything-freecad

Complete CLI harness for FreeCAD parametric 3D CAD modeler (258 commands). Covers ALL workbenches: Part (29 primitives + boolean + mirror + loft + sweep), Sketcher (26 cmds: geometry + constraints + editing), PartDesign (38 cmds: pad/pocket/groove/fillet/chamfer/patterns/hole/datum), Assembly (11 cmds), Mesh (16 cmds), TechDraw (15 cmds: views + dimensions + PDF/SVG), Draft (33 cmds: 2D shapes + arrays + transforms), FEM (12 cmds), CAM/CNC (10 cmds), Surface (6 cmds), Spreadsheet (7 cmds), Import (13 formats), Export (17 formats), Measure (12 cmds), Materials (21 presets). Headless FreeCAD export to STEP/IGES/STL/OBJ/DXF/PDF/glTF/3MF.

cli-anything-gimp

>-

cli-anything-godot

>-

相关技能