From 087f32f6062451ded8fd46c2a1b51de76608c7ab Mon Sep 17 00:00:00 2001 From: 666ghj <670939375@qq.com> Date: Mon, 3 Nov 2025 16:36:18 +0800 Subject: [PATCH] Update requirements.txt to clarify optional machine learning dependencies and provide installation notes for CPU and GPU versions of torch. --- requirements.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6bee269..90665d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -49,11 +49,12 @@ plotly>=5.17.0 matplotlib==3.9.0 wordcloud==1.9.3 -# ===== 机器学习(可选,用于情感分析) ===== -# torch>=2.0.0 # 需要单独安装CUDA版本 -# transformers>=4.30.0 -# scikit-learn>=1.3.0 -# xgboost>=2.0.0 +# ===== 机器学习(可选,用于情感分析,不安装也没事写了容错程序) ===== +torch>=2.0.0 # CPU版本 +transformers>=4.30.0 +scikit-learn>=1.3.0 +xgboost>=2.0.0 +# NOTE:如果要安装GPU版本的torch,指令为pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu126 # ===== 工具库 ===== python-dotenv>=1.0.0