| # RATs40K Adapter for ChatTime |
|
|
| This folder adapts ChatTime to the RATs40K univariate anomaly QA task. |
|
|
| It intentionally uses the numeric `Observation` field only. It does not use |
| `FigurePath`, so the resulting baseline should be compared with numeric-only |
| Time-RA settings rather than VLM image-input settings. |
|
|
| ## Required inputs |
|
|
| - `MODEL_PATH`: local ChatTime model directory. This is required by default. |
| - `PYTHON_BIN`: Python executable. The shell scripts default to |
| `/dev/shm/suiqk/conda_envs/scalerag-ts-v4/bin/python`. |
| - `DATA_PATH`: defaults to |
| `/mnt/share01/sqk/datasets/RATs40K/RATs-Uni-TSImage_Reason.json`. |
|
|
| The scripts do not download HuggingFace weights unless `ALLOW_HF_DOWNLOAD=1` |
| is set explicitly. |
|
|
| The default precision is FP16 because the configured four-GPU machine uses |
| Tesla V100 GPUs. SFT defaults to regular FP16 LoRA with |
| `LOAD_IN_4BIT=0`, `PER_DEVICE_TRAIN_BATCH_SIZE=1`, and |
| `GRADIENT_ACCUMULATION_STEPS=16`. |
|
|
| Evaluation defaults to `EVAL_BATCH_SIZE=4` per GPU. With four GPUs, the |
| maximum global evaluation batch size is 16. |
|
|
| The task prompt is aligned with Time-RA's univariate |
| `USER_DETECTION_PROMPT`; ChatTime still receives the normalized/discretized |
| series through its native `### Input` section. Evaluation checks prompt token |
| lengths and fails instead of truncating. Defaults are `MAX_INPUT_TOKENS=3936`, |
| `MAX_NEW_TOKENS=160`, and `MAX_SEQ_LENGTH=4096` for SFT. |
|
|
| ## Zero-shot |
|
|
| ```bash |
| cd /mnt/share01/sqk/ChatTime |
| MODEL_PATH=/mnt/share01/sqk/models/ChatTime-1-7B-Chat \ |
| bash rats40k_adapter/run_zeroshot_4gpu.sh |
| ``` |
|
|
| ## SFT + Eval |
|
|
| ```bash |
| cd /mnt/share01/sqk/ChatTime |
| MODEL_PATH=/mnt/share01/sqk/models/ChatTime-1-7B-Chat \ |
| bash rats40k_adapter/run_sft_4gpu.sh |
| ``` |
|
|
| ## Zero-shot Then SFT + Eval |
|
|
| ```bash |
| cd /mnt/share01/sqk/ChatTime |
| bash rats40k_adapter/run_zeroshot_then_sft_4gpu.sh |
| ``` |
|
|
| ## Saved Results |
|
|
| - Zero-shot outputs: |
| `/mnt/share01/sqk/ChatTime/rats40k_adapter/outputs/pipeline_20260608_175250/zeroshot` |
| - SFT outputs: |
| `/mnt/share01/sqk/ChatTime/rats40k_adapter/outputs/pipeline_20260608_175250/sft` |
|
|
| Useful smoke-test knobs: |
|
|
| ```bash |
| MAX_TRAIN_SAMPLES=128 MAX_EVAL_SAMPLES=64 bash rats40k_adapter/run_zeroshot_then_sft_4gpu.sh |
| MAX_TRAIN_SAMPLES=128 MAX_EVAL_SAMPLES=64 bash rats40k_adapter/run_sft_4gpu.sh |
| MAX_EVAL_SAMPLES=64 bash rats40k_adapter/run_zeroshot_4gpu.sh |
| ``` |
|
|