Skip to content

Commit

Permalink
Update project information and workflows (#214)
Browse files Browse the repository at this point in the history
*Description of changes:* This PR updates project information and
workflows to allow for PyPi release.


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.

---------

Co-authored-by: Abdul Fatir Ansari <ansarnd@amazon.de>
  • Loading branch information
abdulfatir and Abdul Fatir Ansari authored Nov 28, 2024
1 parent 72ab641 commit ebaa13c
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: ["**"] # Run on any branch
branches: ["main"] # Run only on main branch
pull_request:
branches: ["**"] # Run on any branch
schedule:
Expand All @@ -14,7 +14,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ["3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand All @@ -35,7 +35,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ["3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Python Package to PyPi

on:
release:
types: [published]

jobs:
deploy-to-pypi:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install setuptools wheel build
- name: Build package
run: |
python -m build
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,22 @@ The following figure showcases the remarkable **zero-shot** performance of Chron

## 📈 Usage

To perform inference with Chronos or Chronos-Bolt models, install this package by running:
To perform inference with Chronos or Chronos-Bolt models, the easiest way is to install this package through `pip`:

```sh
pip install chronos-forecasting
```
pip install git+https://github.com/amazon-science/chronos-forecasting.git

If you're interested in pretraining, fine-tuning, and other research & development, clone and install the package from source:

```sh
# Clone the repository
git clone https://github.com/amazon-science/chronos-forecasting.git

# Install in editable mode with extra training-related dependencies
pip install --editable ".[training]"
```

> [!TIP]
> This repository is intended for research purposes and provides a minimal interface to Chronos models. The recommended way of using Chronos for production use cases is through [AutoGluon](https://auto.gluon.ai), which features effortless fine-tuning, augmenting Chronos models with exogenous information through covariate regressors, ensembling with other statistical and machine learning models, as well as seamless deployments on AWS with SageMaker 🧠. Check out the AutoGluon Chronos [tutorial](https://auto.gluon.ai/stable/tutorials/timeseries/forecasting-chronos.html).
Expand Down Expand Up @@ -196,10 +207,12 @@ If you find Chronos models useful for your research, please consider citing the

```
@article{ansari2024chronos,
author = {Ansari, Abdul Fatir and Stella, Lorenzo and Turkmen, Caner and Zhang, Xiyuan and Mercado, Pedro and Shen, Huibin and Shchur, Oleksandr and Rangapuram, Syama Syndar and Pineda Arango, Sebastian and Kapoor, Shubham and Zschiegner, Jasper and Maddix, Danielle C. and Wang, Hao and Mahoney, Michael W. and Torkkola, Kari and Gordon Wilson, Andrew and Bohlke-Schneider, Michael and Wang, Yuyang},
title = {Chronos: Learning the Language of Time Series},
journal = {arXiv preprint arXiv:2403.07815},
year = {2024}
title={Chronos: Learning the Language of Time Series},
author={Ansari, Abdul Fatir and Stella, Lorenzo and Turkmen, Caner and Zhang, Xiyuan, and Mercado, Pedro and Shen, Huibin and Shchur, Oleksandr and Rangapuram, Syama Syndar and Pineda Arango, Sebastian and Kapoor, Shubham and Zschiegner, Jasper and Maddix, Danielle C. and Mahoney, Michael W. and Torkkola, Kari and Gordon Wilson, Andrew and Bohlke-Schneider, Michael and Wang, Yuyang},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2024},
url={https://openreview.net/forum?id=gerNCVqqtR}
}
```

Expand Down
29 changes: 27 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
[project]
name = "chronos"
name = "chronos-forecasting"
version = "1.3.0"
requires-python = ">=3.8"
authors = [
{ name="Abdul Fatir Ansari", email="ansarnd@amazon.com" },
{ name="Lorenzo Stella", email="stellalo@amazon.com" },
{ name="Caner Turkmen", email="atturkm@amazon.com" },
]
description = "Chronos: Pretrained models for time series forecasting"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.9"
dependencies = [
"torch>=2.0,<2.6", # package was tested on 2.2
"transformers>=4.30,<4.48",
"accelerate>=0.32,<1",
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/chronos"]

[project.optional-dependencies]
test = ["pytest~=8.0", "numpy~=1.21"]
typecheck = ["mypy~=1.9"]
training = ["gluonts[pro]~=0.15", "numpy~=1.21", "datasets~=2.18", "typer", "typer-config", "joblib", "scikit-learn", "tensorboard"]
evaluation = ["gluonts[pro]~=0.15", "numpy~=1.21", "datasets~=2.18", "typer"]

[project.urls]
Homepage = "https://github.com/amazon-science/chronos-forecasting"
Issues = "https://github.com/amazon-science/chronos-forecasting/issues"
Paper = "https://arxiv.org/abs/2403.07815"

[tool.mypy]
ignore_missing_imports = true

0 comments on commit ebaa13c

Please sign in to comment.