Downloads · 30 days
0
ANTICH/htsr-grpo-train
htsr-grpo-train is a reinforcement learning model from ANTICH. Use it for the reinforcement learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Hierarchical Time-Series Reasoning with Vision-Language Model — 使用 GRPO (Group Relative Policy Optimization) 强化学习训练 Qwen3-VL-8B 进行工业时序异常分析。
Downloads · 30 days
0
Access
Public
Updated Mar 9, 2026
Repo size
4.4 GB
Likes
0
Public
Click a slice to open those files.
.png4.3 GB · 100%
From the Hugging Face model README
Hierarchical Time-Series Reasoning with Vision-Language Model — 使用 GRPO (Group Relative Policy Optimization) 强化学习训练 Qwen3-VL-8B 进行工业时序异常分析。
# 安装 uv(如未安装)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 安装 Git LFS(图片以 LFS 存储,必须安装)
# Ubuntu/Debian:
apt install git-lfs && git lfs install
# 或 macOS:
brew install git-lfs && git lfs install
git lfs install
git clone https://huggingface.co/ANTICH/htsr-grpo-train
cd htsr-grpo-train
克隆包含训练图片(3060张,2.8GB)和 benchmark 图片(1716张,1.5GB),总计约 4.3GB,需要等待下载完成。
uv sync
bash setup_data.sh
此脚本会:
Qwen/Qwen3-VL-8B-Instruct 到 models/qwen3vl-8b-base/preprocessor_config.json 限制图片分辨率为 512x512# 8x H100/H800(默认)
bash run_grpo.sh
# 2x A800(指定配置文件)
bash run_grpo.sh configs/grpo_config_2gpu.yaml
训练完成后,合并 LoRA 并运行 benchmark 评测:
# 使用 LLamaFactory 合并(需安装 llamafactory-cli)
llamafactory-cli export configs/grpo_merge.yaml
# 用 vLLM 启动推理(替换为你合并后的模型路径)
vllm serve models/qwen3vl-8b-htsr-grpo \
--served-model-name htsr-grpo \
--tensor-parallel-size 2 \
--max-model-len 4096 \
--port 8000
# 设置环境变量
export VLM_BASE_URL="http://localhost:8000/v1"
export VLM_API_KEY="EMPTY"
export JUDGE_API_KEY="your-dashscope-api-key" # 用于 qwen-plus 评分
# 运行评测
python run_benchmark_eval.py --models htsr-grpo
评测指标包括:
htsr-grpo-train/
├── pyproject.toml # Python 依赖(uv sync 入口)
├── uv.lock # 锁定依赖版本
├── run_grpo.sh # 训练启动脚本
├── setup_data.sh # 模型下载脚本
├── run_benchmark_eval.py # Benchmark 评测入口
├── benchmark_eval.py # 评测核心逻辑
├── EasyR1/ # Patched EasyR1/verl 框架
├── configs/
│ ├── grpo_config_8gpu.yaml # 8x H100/H800 配置
│ ├── grpo_config_2gpu.yaml # 2x A800 配置
│ └── grpo_merge.yaml # LoRA 合并配置
├── MultiAgentTS/
│ ├── training_data/
│ │ ├── reward_function/htsr.py # 自定义奖励函数
│ │ └── format_prompt/htsr.jinja # Prompt 模板
│ └── Data/benchmark_tb/ # Benchmark 图片(1716张,含在 repo 中)
│ ├── LongTS_Industrial/test.jsonl
│ ├── coal_mill/
│ ├── pump/
│ ├── transformer/
│ └── wind_turbine/
├── Data/
│ ├── training/grpo_parquet/ # 训练数据(parquet,含在 repo 中)
│ └── training_series/ # 训练图片(3060张,含在 repo 中)
├── models/ # 基座模型(通过 setup_data.sh 下载)
└── checkpoints/ # 训练 checkpoint(自动创建)
| 配置 | GPU | global_batch_size | rollout_batch_size | 预计时间 (3 epochs) |
|---|---|---|---|---|
| 8gpu | 8x H100/H800 80GB | 128 | 256 | ~15-18 小时 |
| 2gpu | 2x A800 80GB | 32 | 64 | ~57 小时 |
包含的 EasyR1 针对 vLLM 0.16.0 做了兼容性修改:
verl/utils/vllm_utils.py: LoRAModel import 路径 + from_lora_tensors API 适配verl/workers/sharding_manager/fsdp_vllm.py: get_tensor_model_parallel_group -> get_tp_groupverl/workers/rollout/vllm_rollout_spmd.py: disable_mm_preprocessor_cache -> mm_processor_cache_gb