diff --git a/README.md b/README.md index c8edcb0..824dcbc 100755 --- a/README.md +++ b/README.md @@ -138,6 +138,22 @@ pixi install pixi shell ``` +不同机器使用配置方式: + +```bash +# 在 Linux GPU 机器上安装和运行 +pixi install --environment gpu +pixi run --environment gpu + +# 在 macOS 或 CPU 机器上安装和运行 +pixi install --environment cpu +pixi run --environment cpu + +# 或使用默认环境(CPU) +pixi install +pixi run +``` + #### RDKit 安装建议 RDKit 推荐使用 conda 安装: @@ -192,7 +208,20 @@ python utils/mole_predictor.py --help ```bash # 预测 Frags-Enamine-18M.csv -python utils/mole_predictor.py Data/fragment/Frags-Enamine-18M.csv +# 创建测试文件(前 1001 行,包含表头) +head -1001 Data/fragment/Frags-Enamine-18M.csv > Data/fragment/test_1000.csv + +# 测试命令 - 保守参数 +nohup pixi run python utils/mole_predictor.py \ + Data/fragment/test_1000.csv \ + Data/fragment/test_1000_predicted.csv \ + --device cuda:0 \ + --batch-size 100 \ + --n-workers 8 \ + > Data/fragment/mole_test_1000.log 2>&1 & + +# 查看日志 +tail -f Data/fragment/mole_test_1000.log # 预测 GDB11-27M.csv python utils/mole_predictor.py Data/fragment/GDB11-27M.csv diff --git a/pixi.toml b/pixi.toml index 0d329c3..de8c2d0 100644 --- a/pixi.toml +++ b/pixi.toml @@ -1,29 +1,57 @@ -[workspace] -authors = ["hotwa "] -channels = ["conda-forge", "pytorch", "nvidia"] -name = "SIME" -platforms = ["linux-64"] -version = "0.1.0" - -[tasks] - -[dependencies] -python = "3.12.*" -cuda-toolkit = { version = "12.8.*", channel = "nvidia" } -pandas = { version = ">=2.3.3,<3", channel = "conda-forge" } -xgboost = { version = ">=3.0.5,<4", channel = "conda-forge" } -pyyaml = { version = ">=6.0.3,<7", channel = "conda-forge" } -pip = { version = ">=25.2,<26", channel = "conda-forge" } -click = { version = ">=8.3.0,<9", channel = "conda-forge" } -openpyxl = { version = ">=3.1.5,<4", channel = "conda-forge" } -ipython = { version = ">=9.6.0,<10", channel = "conda-forge" } - -[pypi-options] -extra-index-urls = ["https://download.pytorch.org/whl/cu128"] +[workspace] +authors = ["hotwa "] +channels = ["conda-forge", "pytorch", "nvidia"] +name = "SIME" +platforms = ["linux-64", "osx-64", "osx-arm64"] # 添加 macOS 平台 +version = "0.1.0" -[pypi-dependencies] +[tasks] +# 您的任务定义 + +# 默认依赖(所有环境共享) +[dependencies] +python = "3.12.*" +pandas = { version = ">=2.3.3,<3", channel = "conda-forge" } +xgboost = { version = ">=3.0.5,<4", channel = "conda-forge" } +pyyaml = { version = ">=6.0.3,<7", channel = "conda-forge" } +pip = { version = ">=25.2,<26", channel = "conda-forge" } +click = { version = ">=8.3.0,<9", channel = "conda-forge" } +openpyxl = { version = ">=3.1.5,<4", channel = "conda-forge" } +ipython = { version = ">=9.6.0,<10", channel = "conda-forge" } + +# GPU feature (仅 Linux) +[feature.gpu] +platforms = ["linux-64"] +system-requirements = { cuda = "12" } + +[feature.gpu.dependencies] +cuda-toolkit = { version = "12.8.*", channel = "nvidia" } + +[feature.gpu.pypi-options] +extra-index-urls = ["https://download.pytorch.org/whl/cu128"] + +[feature.gpu.pypi-dependencies] torch = "==2.8.0+cu128" torchvision = "==0.23.0+cu128" -torchaudio = "==2.8.0+cu128" -torch-geometric = ">=2.5.0,<3" -rdkit = "*" \ No newline at end of file +torchaudio = "==2.8.0+cu128" +torch-geometric = ">=2.5.0,<3" +rdkit = "*" +tqdm = ">=4.66.5,<5" + +# CPU feature (macOS 和其他平台) +[feature.cpu] +platforms = ["osx-64", "osx-arm64", "linux-64"] + +[feature.cpu.pypi-dependencies] +torch = "*" # CPU 版本 +torchvision = "*" +torchaudio = "*" +torch-geometric = ">=2.5.0,<3" +rdkit = "*" +tqdm = ">=4.66.5,<5" + +# 定义环境 +[environments] +gpu = ["gpu"] +cpu = ["cpu"] +default = ["cpu"] # 默认使用 CPU \ No newline at end of file