Merge pull request #52 from JustinGuese/master

PyPI package, Poetry support
This commit is contained in:
Yichen Zhou
2024-07-12 14:27:41 -07:00
committed by GitHub
5 changed files with 6062 additions and 22 deletions
+30
View File
@@ -0,0 +1,30 @@
name: Poetry publish
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
buildPush:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
# use the hardcoded version number for now. if this is merged to the main repo, you can uncomment these lines to automatically tag the version number with the github run number
- name: Set Version number
run: |
poetry version 0.1.${{ github.run_number }}
- name: Build and Publish to PyPI
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish --build
+3
View File
@@ -0,0 +1,3 @@
.venv/
dist/
**__pycache__/** */
+34 -1
View File
@@ -14,6 +14,8 @@ to download model checkpoints.
This is not an officially supported Google product.
We recommend at least 16GB RAM to load TimesFM dependencies.
## Checkpoint timesfm-1.0-200m
timesfm-1.0-200m is the first open model checkpoint:
@@ -30,7 +32,13 @@ Please look into the README files in the respective benchmark directories within
## Installation
We recommend at least 16GB RAM to load TimesFM dependencies.
### Installation as a package
To install the TimesFM as a package, you can run the following command without cloning this repo:
`pip install timesfm`
### Installation using conda
For calling TimesFM, We have two environment files. Inside `timesfm`, for
GPU installation (assuming CUDA 12 has been setup), you can create a conda
@@ -62,6 +70,31 @@ Please use the environment files under `experiments` instead.
2. The dependency `lingvo` does not support ARM architectures, and the code is not working for machines with Apple silicon. We are aware of this issue and are working on a solution. Stay tuned.
### Local installation using poetry
To from the current repository/local version (like you would have previously done with `pip -e .`), you can run the command
```
pip install poetry # optional
poetry install
```
This will install the environment in the local .venv folder (depends on the configuration) and matches the python command to the poetry environment. If this is not the case, you can use `poetry run python` to use the local environment.
### Notes
1. Running the provided benchmarks would require additional dependencies.
Please use the environment files under `experiments` instead.
2. The dependency `lingvo` does not support ARM architectures, and the code is not working for machines with Apple silicon. We are aware of this issue and are working on a solution. Stay tuned.
#### Building the package and publishing to PyPI
The package can be built using the command `poetry build`.
To build and publish it to PyPI, the command `poetry publish` can be used. This command will require the user to have the necessary permissions to publish to the PyPI repository.
## Usage
### Initialize the model and load a checkpoint.
Generated
+5958
View File
File diff suppressed because it is too large Load Diff
+37 -21
View File
@@ -1,29 +1,45 @@
# This project can be installed with `python3 -m pip install -e .` from the main directory.
[project]
[tool.poetry]
name = "timesfm"
packages = [
{ include = "*", from = "src" },
]
description = "Open weights time-series foundation model from Google Research."
version = "1.0.1"
dependencies = [
"jax[cuda12]==0.4.26",
"paxml==1.4.0",
"praxis==1.4.0",
"jaxlib==0.4.26",
"numpy==1.26.4",
"pandas==2.1.4",
"einshape==1.0.0",
"utilsforecast==0.1.10",
"huggingface_hub[cli]==0.23.0",
"scikit-learn==1.0.2",
]
authors = [
{name = "Rajat Sen", email = "senrajat@google.com"},
{name = "Yichen Zhou", email = "yichenzhou@google.com"},
{name = "Abhimanyu Das", email = "abhidas@google.com"},
{name = "Petros Mol", email = "pmol@google.com"},
"Rajat Sen <senrajat@google.com>",
"Yichen Zhou <yichenzhou@google.com>",
"Abhimanyu Das <abhidas@google.com>",
"Petros Mol <pmol@google.com>",
"Justin Güse <guese.justin@gmail.com>",
]
readme = "README.md"
keywords = ["time series", "timesfm", "forecast", "time series model"]
homepage = "https://github.com/google-research/timesfm"
repository = "https://github.com/google-research/timesfm"
classifiers = [
"Environment :: Console",
"Framework :: Flake8",
"Operating System :: OS Independent",
"Topic :: Software Development :: Documentation",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
]
include = [
"LICENSE",
]
[tool.poetry.dependencies]
python = ">=3.10,<3.11"
einshape = "1.0.0"
numpy = "1.26.4"
pandas = "2.1.4"
paxml = "1.4.0"
utilsforecast = "0.1.10"
jax = {version = "0.4.26", extras = ["cuda12"]}
jaxlib = "0.4.26"
huggingface_hub = {version = "0.23.0", extras = ["cli"]}
scikit-learn = "1.0.2"
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"