Views
No views yet
ChatTS focuses on Understanding and Reasoning about time series, much like what vision/video/audio-MLLMs do.Qwen3-8B version of ChatTS-14B, with some minor bug fixes and improvements on short time series length and instructions following capabilities.
README.md in the ChatTS repository.HuggingFace):1from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor
2import torch
3import numpy as np
4
5hf_model = "bytedance-research/ChatTS-14B"
6# Load the model, tokenizer and processor
7# For pre-Ampere GPUs (like V100) use `_attn_implementation='eager'`
8model = AutoModelForCausalLM.from_pretrained(hf_model, trust_remote_code=True, device_map="auto", torch_dtype='float16')
9tokenizer = AutoTokenizer.from_pretrained(hf_model, trust_remote_code=True)
10processor = AutoProcessor.from_pretrained(hf_model, trust_remote_code=True, tokenizer=tokenizer)
11# Create time series and prompts
12timeseries = np.sin(np.arange(256) / 10) * 5.0
13timeseries[100:] -= 10.0
14prompt = f"I have a time series length of 256: <ts><ts/>. Please analyze the local changes in this time series."
15# Apply Chat Template
16prompt = f"""<|im_start|>system
17You are a helpful assistant.<|im_end|><|im_start|>user
18{prompt}<|im_end|><|im_start|>assistant
19"""
20# Convert to tensor
21inputs = processor(text=[prompt], timeseries=[timeseries], padding=True, return_tensors="pt")
22# Model Generate
23outputs = model.generate(**inputs, max_new_tokens=300)
24print(tokenizer.decode(outputs[0][len(inputs['input_ids'][0]):], skip_special_tokens=True))@article{xie2024chatts,
title={ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning},
author={Xie, Zhe and Li, Zeyan and He, Xiao and Xu, Longlong and Wen, Xidao and Zhang, Tieying and Chen, Jianjun and Shi, Rui and Pei, Dan},
journal={arXiv preprint arXiv:2412.03104},
year={2024}
}