Text Generation
Transformers
PyTorch
chatts
feature-extraction
conversational
custom_code
xiezhe24 xiezhe22 commited on
Commit
138d7dc
·
verified ·
1 Parent(s): 877dae2

Update README.md (#14)

Browse files

- Update README.md (660555cf25f45adb8d9547e7a547002cd2f0436d)


Co-authored-by: Zhe Xie <xiezhe22@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +99 -91
README.md CHANGED
@@ -1,92 +1,100 @@
1
- ---
2
- license: apache-2.0
3
- library_name: transformers
4
- pipeline_tag: text-generation
5
- base_model:
6
- - Qwen/Qwen2.5-14B-Instruct
7
- datasets:
8
- - ChatTSRepo/ChatTS-Training-Dataset
9
- language:
10
- - zho
11
- - eng
12
- - fra
13
- - spa
14
- - por
15
- - deu
16
- - ita
17
- - rus
18
- - jpn
19
- - kor
20
- - vie
21
- - tha
22
- - ara
23
- ---
24
-
25
- # [VLDB' 25] ChatTS-14B Model
26
-
27
- <div style="display:flex;justify-content: center">
28
- <a href="https://github.com/NetmanAIOps/ChatTS"><img alt="github" src="https://img.shields.io/badge/Code-GitHub-blue"></a>
29
- <a href="https://arxiv.org/abs/2412.03104"><img alt="preprint" src="https://img.shields.io/static/v1?label=arXiv&amp;message=2412.03104&amp;color=B31B1B&amp;logo=arXiv"></a>
30
- </div>
31
-
32
- **[VLDB' 25] ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning**
33
-
34
- `ChatTS` focuses on **Understanding and Reasoning** about time series, much like what vision/video/audio-MLLMs do.
35
- This repo provides code, datasets and model for `ChatTS`: [ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning](https://arxiv.org/pdf/2412.03104).
36
-
37
- `ChatTS` features native support for multi-variate time series data with any length and range of values. With `ChatTS`, you can easily understand and reason about both the **shape** features and **value** features in the time series.
38
- `ChatTS` can also be integrated into existing LLM pipelines for more time series-related applications, leveraging existing inference frameworks such as `vLLMs`.
39
-
40
- Here is an example of a ChatTS application, which allows users to interact with a LLM to understand and reason about time series data:
41
- ![Chat](figures/chat_example.png)
42
-
43
- [Link to the paper](https://arxiv.org/pdf/2412.03104)
44
-
45
- [Link to the Github repository](https://github.com/NetManAIOps/ChatTS)
46
-
47
- ## Usage
48
- - This model is fine-tuned on the QWen2.5-14B-Instruct (https://huggingface.co/Qwen/Qwen2.5-14B-Instruct) model. For more usage details, please refer to the `README.md` in the ChatTS repository.
49
- - An example usage of ChatTS (with `HuggingFace`):
50
- ```python
51
- from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor
52
- import torch
53
- import numpy as np
54
-
55
- # Load the model, tokenizer and processor
56
- model = AutoModelForCausalLM.from_pretrained("./ckpt", trust_remote_code=True, device_map="auto", torch_dtype='float16')
57
- tokenizer = AutoTokenizer.from_pretrained("./ckpt", trust_remote_code=True)
58
- processor = AutoProcessor.from_pretrained("./ckpt", trust_remote_code=True, tokenizer=tokenizer)
59
- # Create time series and prompts
60
- timeseries = np.sin(np.arange(256) / 10) * 5.0
61
- timeseries[100:] -= 10.0
62
- prompt = f"I have a time series length of 256: <ts><ts/>. Please analyze the local changes in this time series."
63
- # Apply Chat Template
64
- prompt = f"<|im_start|>system
65
- You are a helpful assistant.<|im_end|><|im_start|>user
66
- {prompt}<|im_end|><|im_start|>assistant
67
- "
68
- # Convert to tensor
69
- inputs = processor(text=[prompt], timeseries=[timeseries], padding=True, return_tensors="pt")
70
- # Model Generate
71
- outputs = model.generate(**inputs, max_new_tokens=300)
72
- print(tokenizer.decode(outputs[0][len(inputs['input_ids'][0]):], skip_special_tokens=True))
73
- ```
74
-
75
- ## Reference
76
- - QWen2.5-14B-Instruct (https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)
77
- - transformers (https://github.com/huggingface/transformers.git)
78
- - [ChatTS Paper](https://arxiv.org/pdf/2412.03104)
79
-
80
-
81
- ## License
82
- This model is licensed under the [Apache License 2.0](LICENSE).
83
-
84
- ## Cite
85
- ```
86
- @article{xie2024chatts,
87
- title={ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning},
88
- 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},
89
- journal={arXiv preprint arXiv:2412.03104},
90
- year={2024}
91
- }
 
 
 
 
 
 
 
 
92
  ```
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ pipeline_tag: text-generation
5
+ base_model:
6
+ - Qwen/Qwen2.5-14B-Instruct
7
+ datasets:
8
+ - ChatTSRepo/ChatTS-Training-Dataset
9
+ language:
10
+ - zho
11
+ - eng
12
+ - fra
13
+ - spa
14
+ - por
15
+ - deu
16
+ - ita
17
+ - rus
18
+ - jpn
19
+ - kor
20
+ - vie
21
+ - tha
22
+ - ara
23
+ ---
24
+
25
+ # [VLDB' 25] ChatTS-14B Model
26
+
27
+ <div style="display:flex;justify-content: center">
28
+ <a href="https://github.com/NetmanAIOps/ChatTS"><img alt="github" src="https://img.shields.io/badge/Code-GitHub-blue"></a>
29
+ <a href="https://arxiv.org/abs/2412.03104"><img alt="preprint" src="https://img.shields.io/static/v1?label=arXiv&amp;message=2412.03104&amp;color=B31B1B&amp;logo=arXiv"></a>
30
+ </div>
31
+
32
+ **[VLDB' 25] ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning**
33
+
34
+ `ChatTS` focuses on **Understanding and Reasoning** about time series, much like what vision/video/audio-MLLMs do.
35
+ This repo provides code, datasets and model for `ChatTS`: [ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning](https://arxiv.org/pdf/2412.03104).
36
+
37
+ ## Key Features
38
+ ChatTS is a Multimodal LLM built natively for time series as a core modality:
39
+ - ✅ **Native support for multivariate time series**
40
+ - **Flexible input**: Supports multivariate time series with **different lengths** and **flexible dimensionality**
41
+ - ✅ **Conversational understanding + reasoning**:
42
+ Enables interactive dialogue over time series to explore insights about time series
43
+ - **Preserves raw numerical values**:
44
+ Can answer **statistical questions**, such as _"How large is the spike at timestamp t?"_
45
+ - **Easy integration with existing LLM pipelines**, including support for **vLLM**.
46
+
47
+ ### Example Application
48
+ Here is an example of a ChatTS application, which allows users to interact with a LLM to understand and reason about time series data:
49
+ ![Chat](figures/chat_example.png)
50
+
51
+ [Link to the paper](https://arxiv.org/pdf/2412.03104)
52
+
53
+ [Link to the Github repository](https://github.com/NetManAIOps/ChatTS)
54
+
55
+ ## Usage
56
+ - This model is fine-tuned on the QWen2.5-14B-Instruct (https://huggingface.co/Qwen/Qwen2.5-14B-Instruct) model. For more usage details, please refer to the `README.md` in the ChatTS repository.
57
+ - An example usage of ChatTS (with `HuggingFace`):
58
+ ```python
59
+ from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor
60
+ import torch
61
+ import numpy as np
62
+
63
+ # Load the model, tokenizer and processor
64
+ model = AutoModelForCausalLM.from_pretrained("./ckpt", trust_remote_code=True, device_map="auto", torch_dtype='float16')
65
+ tokenizer = AutoTokenizer.from_pretrained("./ckpt", trust_remote_code=True)
66
+ processor = AutoProcessor.from_pretrained("./ckpt", trust_remote_code=True, tokenizer=tokenizer)
67
+ # Create time series and prompts
68
+ timeseries = np.sin(np.arange(256) / 10) * 5.0
69
+ timeseries[100:] -= 10.0
70
+ prompt = f"I have a time series length of 256: <ts><ts/>. Please analyze the local changes in this time series."
71
+ # Apply Chat Template
72
+ prompt = f"<|im_start|>system
73
+ You are a helpful assistant.<|im_end|><|im_start|>user
74
+ {prompt}<|im_end|><|im_start|>assistant
75
+ "
76
+ # Convert to tensor
77
+ inputs = processor(text=[prompt], timeseries=[timeseries], padding=True, return_tensors="pt")
78
+ # Model Generate
79
+ outputs = model.generate(**inputs, max_new_tokens=300)
80
+ print(tokenizer.decode(outputs[0][len(inputs['input_ids'][0]):], skip_special_tokens=True))
81
+ ```
82
+
83
+ ## Reference
84
+ - QWen2.5-14B-Instruct (https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)
85
+ - transformers (https://github.com/huggingface/transformers.git)
86
+ - [ChatTS Paper](https://arxiv.org/pdf/2412.03104)
87
+
88
+
89
+ ## License
90
+ This model is licensed under the [Apache License 2.0](LICENSE).
91
+
92
+ ## Cite
93
+ ```
94
+ @article{xie2024chatts,
95
+ title={ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning},
96
+ 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},
97
+ journal={arXiv preprint arXiv:2412.03104},
98
+ year={2024}
99
+ }
100
  ```