{"id":48669787,"url":"https://github.com/DC-research/TEMPO","last_synced_at":"2026-04-26T07:00:32.547Z","repository":{"id":237392127,"uuid":"780643324","full_name":"DC-research/TEMPO","owner":"DC-research","description":"The official code for \"TEMPO: Prompt-based Generative Pre-trained Transformer for Time Series Forecasting (ICLR 2024)\".  TEMPO is one of the very first open source Time Series Foundation Models for forecasting task v1.0 version.","archived":false,"fork":false,"pushed_at":"2025-02-23T21:38:07.000Z","size":1904,"stargazers_count":118,"open_issues_count":5,"forks_count":17,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-05T09:59:08.307Z","etag":null,"topics":["forecasting","forecasting-models","forecasting-time-series","foundation-models","gpt","pretrained-language-model","pretrained-models","time-series","time-series-analysis","transformer","transformers","transformers-models"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DC-research.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-01T22:22:40.000Z","updated_at":"2025-09-02T22:45:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ad610d7-9955-4bdc-bb05-338a3b2c19f6","html_url":"https://github.com/DC-research/TEMPO","commit_stats":null,"previous_names":["dc-research/tempo"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DC-research/TEMPO","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DC-research%2FTEMPO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DC-research%2FTEMPO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DC-research%2FTEMPO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DC-research%2FTEMPO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DC-research","download_url":"https://codeload.github.com/DC-research/TEMPO/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DC-research%2FTEMPO/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32288653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T06:26:00.361Z","status":"ssl_error","status_checked_at":"2026-04-26T06:25:58.791Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forecasting","forecasting-models","forecasting-time-series","foundation-models","gpt","pretrained-language-model","pretrained-models","time-series","time-series-analysis","transformer","transformers","transformers-models"],"created_at":"2026-04-10T12:00:30.593Z","updated_at":"2026-04-26T07:00:32.525Z","avatar_url":"https://github.com/DC-research.png","language":"Python","funding_links":[],"categories":["A. Large Language Models"],"sub_categories":["Taxonomy of Roles and Unified Workflows"],"readme":"# Time Series Foundation Model - TEMPO: Prompt-based Generative Pre-trained Transformer for Time Series Forecasting\n\n[![preprint](https://img.shields.io/static/v1?label=arXiv\u0026message=2310.04948\u0026color=B31B1B\u0026logo=arXiv)](https://arxiv.org/pdf/2310.04948)\n[![huggingface](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-FFD21E)](https://huggingface.co/Melady/TEMPO)\n[![License: MIT](https://img.shields.io/badge/License-Apache--2.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=https://raw.githubusercontent.com/DC-research/TEMPO/main/tempo/pics/TEMPO_logo.png width=80% /\u003e\u003c/div\u003e\n\nThe official code for [[\"TEMPO: Prompt-based Generative Pre-trained Transformer for Time Series Forecasting (ICLR 2024)\"]](https://arxiv.org/pdf/2310.04948).\n\nTEMPO is one of the very first open source **Time Series Foundation Models** for forecasting task v1.0 version.\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=https://raw.githubusercontent.com/DC-research/TEMPO/main/tempo/pics/TEMPO.png width=80% /\u003e\u003c/div\u003e\n\n## ⏳ Upcoming Features\n\n- [✅] Parallel pre-training pipeline\n- [] Probabilistic forecasting\n- [] Multimodal dataset\n- [] Multimodal pre-training script\n\t\n\n## 🚀 News\n\n- **Nov 2024**: 🚀 We've published **TimeAGI** on PyPI! Now you can simply `pip install timeagi` to get started and try **TEMPO** by `from tempo.models.TEMPO import TEMPO`. Check out our demo for more details: [TimeAGI](https://pypi.org/project/timeagi/)!\n\n- **Oct 2024**: 🚀 We've streamlined our code structure, enabling users to download the pre-trained model and perform zero-shot inference with a single line of code! Check out our [demo](./run_TEMPO_demo.py) for more details. Our model's download count on HuggingFace is now trackable!\n\n- **Jun 2024**: 🚀 We added demos for reproducing zero-shot experiments in [Colab](https://colab.research.google.com/drive/11qGpT7H1JMaTlMlm9WtHFZ3_cJz7p-og?usp=sharing).  We also added the demo of building the customer dataset and directly do the inference via our pre-trained foundation model: [Colab](https://colab.research.google.com/drive/1ZpWbK0L6mq1pav2yDqOuORo4rHbv80-A?usp=sharing)\n- **May 2024**: 🚀 TEMPO has launched a GUI-based online [demo](https://4171a8a7484b3e9148.gradio.live/), allowing users to directly interact with our foundation model!\n- **May 2024**: 🚀 TEMPO published the 80M pretrained foundation model in [HuggingFace](https://huggingface.co/Melady/TEMPO)!\n- **May 2024**: 🧪 We added the code for pretraining and inference TEMPO models.  You can find a pre-training script demo in [this folder](./scripts/etth2.sh). We also added [a script](./scripts/etth2_test.sh) for the inference demo.\n\n- **Mar 2024**: 📈  Released [TETS dataset](https://drive.google.com/file/d/1Hu2KFj0kp4kIIpjbss2ciLCV_KiBreoJ/view?usp=drive_link) from [S\u0026P 500](https://www.spglobal.com/spdji/en/indices/equity/sp-500/#overview) used in multimodal experiments in TEMPO. \n- **Mar 2024**: 🧪 TEMPO published the project [code](https://github.com/DC-research/TEMPO) and the pre-trained checkpoint [online](https://drive.google.com/file/d/11Ho_seP9NGh-lQCyBkvQhAQFy_3XVwKp/view?usp=drive_link)! \n- **Jan 2024**: 🚀 TEMPO [paper](https://openreview.net/pdf?id=YH5w12OUuU) get accepted by ICLR!\n- **Oct 2023**: 🚀 TEMPO [paper](https://arxiv.org/pdf/2310.04948) released on Arxiv!\n\n## Build the environment\n\n```\nconda create -n tempo python=3.8\n```\n```\nconda activate tempo\n```\n```\npip install timeagi\n```\n\n## Script Demo\n\nA streamlining example showing how to perform forecasting using TEMPO:\n\n```python\n# Third-party library imports\nimport numpy as np\nimport torch\nfrom numpy.random import choice\n# Local imports\nfrom tempo.models.TEMPO import TEMPO\n\n\nmodel = TEMPO.load_pretrained_model(\n        device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu'),\n        repo_id = \"Melady/TEMPO\",\n        filename = \"TEMPO-80M_v1.pth\",\n        cache_dir = \"./checkpoints/TEMPO_checkpoints\"  \n)\n\ninput_data = np.random.rand(336)    # Random input data\nwith torch.no_grad():\n        predicted_values = model.predict(input_data, pred_length=96)\nprint(\"Predicted values:\")\nprint(predicted_values)\n\n```\n\n## Demos\n\n### 1. Reproducing zero-shot experiments on ETTh2:\n\nPlease try to reproduc the zero-shot experiments on ETTh2 [[here on Colab]](https://colab.research.google.com/drive/11qGpT7H1JMaTlMlm9WtHFZ3_cJz7p-og?usp=sharing).\n\n### 2. Zero-shot experiments on customer dataset:\n\nWe use the following Colab page to show the demo of building the customer dataset and directly do the inference via our pre-trained foundation model: [[Colab]](https://colab.research.google.com/drive/1ZpWbK0L6mq1pav2yDqOuORo4rHbv80-A?usp=sharing)\n\n### 3. Online demo:\n\nPlease try our foundation model demo [[here]](https://4171a8a7484b3e9148.gradio.live).\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=https://raw.githubusercontent.com/DC-research/TEMPO/main/tempo/pics/TEMPO_demo.jpg width=80% /\u003e\u003c/div\u003e\n\n## Practice on your end\n\nWe also updated our models on HuggingFace: [[Melady/TEMPO]](https://huggingface.co/Melady/TEMPO).\n\n\n\n### Get Data\n\n   Download the data from [[Google Drive]](https://drive.google.com/drive/folders/13Cg1KYOlzM5C7K8gK8NfC-F3EYxkM3D2?usp=sharing) or [[Baidu Drive]](https://pan.baidu.com/s/1r3KhGd0Q9PJIUZdfEYoymg?pwd=i9iy), and place the downloaded data in the folder`./dataset`. You can also download the STL results from [[Google Drive]](https://drive.google.com/file/d/1gWliIGDDSi2itUAvYaRgACru18j753Kw/view?usp=sharing), and place the downloaded data in the folder`./stl`.\n\n### Run TEMPO\n\n### Pre-Training Stage\n```\nbash [ecl, etth1, etth2, ettm1, ettm2, traffic, weather].sh\n```\n\n### Test/ Inference Stage\n\nAfter training, we can test TEMPO model under the zero-shot setting:\n\n```\nbash [ecl, etth1, etth2, ettm1, ettm2, traffic, weather]_test.sh\n```\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=https://raw.githubusercontent.com/DC-research/TEMPO/main/tempo/pics/results.jpg width=90% /\u003e\u003c/div\u003e\n\n\n## Pre-trained Models\n\nYou can download the pre-trained model from [[Google Drive]](https://drive.google.com/file/d/11Ho_seP9NGh-lQCyBkvQhAQFy_3XVwKp/view?usp=drive_link) and then run the test script for fun.\n\n## TETS dataset\n\nHere is the prompts use to generate the coresponding textual informaton of time series via [[OPENAI ChatGPT-3.5 API]](https://platform.openai.com/docs/guides/text-generation)\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=https://raw.githubusercontent.com/DC-research/TEMPO/main/tempo/pics/TETS_prompt.png width=80% /\u003e\u003c/div\u003e\n\nThe time series data are come from [[S\u0026P 500]](https://www.spglobal.com/spdji/en/indices/equity/sp-500/#overview). Here is the EBITDA case for one company from the dataset:\n\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=https://raw.githubusercontent.com/DC-research/TEMPO/main/tempo/pics/Company1_ebitda_summary.png width=80% /\u003e\u003c/div\u003e\n\nExample of generated contextual information for the Company marked above:\n\n\u003cdiv align=\"center\"\u003e\u003cimg src=https://raw.githubusercontent.com/DC-research/TEMPO/main/tempo/pics//Company1_ebitda_summary_words.jpg width=80% /\u003e\u003c/div\u003e\n\n\n\n\nYou can download the processed data with text embedding from GPT2 from: [[TETS]](https://drive.google.com/file/d/1Hu2KFj0kp4kIIpjbss2ciLCV_KiBreoJ/view?usp=drive_link\n).\n\n## Contact\nFeel free to connect DefuCao@USC.EDU / YanLiu.CS@USC.EDU if you’re interested in applying TEMPO to your real-world application.\n\n## Cite our work\n```\n@inproceedings{\ncao2024tempo,\ntitle={{TEMPO}: Prompt-based Generative Pre-trained Transformer for Time Series Forecasting},\nauthor={Defu Cao and Furong Jia and Sercan O Arik and Tomas Pfister and Yixiang Zheng and Wen Ye and Yan Liu},\nbooktitle={The Twelfth International Conference on Learning Representations},\nyear={2024},\nurl={https://openreview.net/forum?id=YH5w12OUuU}\n}\n```\n\n```\n@article{\n   Jia_Wang_Zheng_Cao_Liu_2024, \n   title={GPT4MTS: Prompt-based Large Language Model for Multimodal Time-series Forecasting}, \n   volume={38}, \n   url={https://ojs.aaai.org/index.php/AAAI/article/view/30383}, \n   DOI={10.1609/aaai.v38i21.30383}, \n   number={21}, \n   journal={Proceedings of the AAAI Conference on Artificial Intelligence}, \n   author={Jia, Furong and Wang, Kevin and Zheng, Yixiang and Cao, Defu and Liu, Yan}, \n   year={2024}, month={Mar.}, pages={23343-23351} \n   }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDC-research%2FTEMPO","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDC-research%2FTEMPO","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDC-research%2FTEMPO/lists"}