fix: 修正 tsfm-public 包名,添加一键安装脚本

- 添加 install_windows.bat 一键安装脚本
- 修正文档中 tsfm_public -> tsfm-public (PyPI 包名用连字符)
- 添加 GitHub 备用安装方式
This commit is contained in:
crypto_predictor committed 2026-02-07 22:02:56 +08:00
1 parent 340c11d4ab
commit 06800ddb43
2 files changed
+70 -1

No files matched your search

+8 -1
View File
@@ -94,7 +94,14 @@ pip install -r requirements.txt
### 3. 安装 IBM 时序模型 (TTM-R2)
```powershell
pip install tsfm_public
# 注意:PyPI 包名是 tsfm-public(带连字符),但导入时用 tsfm_public(下划线)
pip install tsfm-public
```
如果安装失败,尝试:
```powershell
# 从 GitHub 安装
pip install git+https://github.com/ibm-granite/granite-tsfm.git
```
---
+62
View File
@@ -0,0 +1,62 @@
@echo off
chcp 65001 >nul
REM ============================================
REM Windows 环境安装脚本
REM 安装所有依赖和模型
REM ============================================
echo ==========================================
echo 加密货币预测系统 - Windows 安装脚本
echo ==========================================
echo.
REM 检查 conda
where conda >nul 2>&1
if %errorlevel% neq 0 (
echo [错误] 未找到 conda
echo 请先安装 Miniconda: https://docs.conda.io/en/latest/miniconda.html
pause
exit /b 1
)
echo [1/6] 创建 conda 环境...
call conda create -n crypto_pred_312 python=3.12 -y
if %errorlevel% neq 0 (
echo [警告] 环境可能已存在,继续...
)
echo.
echo [2/6] 激活环境...
call conda activate crypto_pred_312
echo.
echo [3/6] 安装 PyTorch (CPU 版本)...
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
echo.
echo [4/6] 安装项目依赖...
pip install -r requirements.txt
echo.
echo [5/6] 安装 IBM TTM-R2 模型库...
echo 注意: tsfm-public 包名使用连字符
pip install tsfm-public
echo.
echo [6/6] 验证安装...
python -c "import torch; print(f'PyTorch: {torch.__version__}')"
python -c "import tsfm_public; print('tsfm_public: 已安装')"
python -c "from training.config import TrainingConfig; c=TrainingConfig(); print(f'设备: {c.get_device()}')"
echo.
echo ==========================================
echo 安装完成!
echo ==========================================
echo.
echo 下一步:
echo 1. 复制 .env.example 为 .env 并配置数据库
echo 2. 双击 start_system.bat 启动系统
echo 3. 访问 http://localhost:8000
echo.
pause