Views
No views yet
google/timesfm-1.0-200m-pytorch) on first use:1import numpy as np
2import torch
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5tokenizer = AutoTokenizer.from_pretrained("ParadiseYu/TS-Reasoner-7B", trust_remote_code=True)
6model = AutoModelForCausalLM.from_pretrained(
7 "ParadiseYu/TS-Reasoner-7B", trust_remote_code=True, torch_dtype=torch.float16
8).to("cuda").eval()<ts><ts/> placeholder per series (preceded by a value-scaling prefix); the raw series are passed to generate via the timeseries= kwarg as a (num_series, length, 2) fp16 tensor of [scaled_value, mask] pairs. See demo.py in the code repository for a complete helper (load_ts_reasoner / ask) that handles the scaling, prompt assembly, and padding:1# git clone https://github.com/Yu-Fangxu/TS-Reasoner && cd TS-Reasoner
2from demo import load_ts_reasoner, ask
3
4tokenizer, model = load_ts_reasoner()
5answer = ask(
6 tokenizer, model,
7 question="Time series 1: <ts><ts/>\nWhat is the overall trend?",
8 timeseries=[[0.1, 0.3, 0.2, 0.5, 0.8, 1.2, 1.1, 1.6]],
9)
10print(answer)1@article{yu2025tsreasoner,
2 title={TS-Reasoner: Aligning Time Series Foundation Models with LLM Reasoning},
3 author={Yu, Fangxu and Zhao, Hongyu and Zhou, Tianyi},
4 journal={arXiv preprint arXiv:2510.03519},
5 year={2025}
6}