Skip to content

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

Python

pulled flax changes from master

Rajat Sen56e7fd67c639
diff --cc README.md
index 3479b00,29edce2..9db8441
--- a/README.md
+++ b/README.md
@@@ -44,28 -44,30 +44,25 @@@ will be under construction over the nex
### Install
-**Step 1** (Prerequisite)
-
-Install your preferred `torch` / `jax` backend based on your OS and accelerators
-(CPU, GPU, TPU or Apple Silicon).
-
-- [Install PyTorch](https://pytorch.org/get-started/locally/).
-- [Install Jax](https://docs.jax.dev/en/latest/installation.html#installation)
- for Flax.
-
-**Step 2** (Install `timesfm`)
-
-You can now install locally.
-
-```shell
-git clone https://github.com/google-research/timesfm.git
-cd timesfm
-pip install -e ".[torch]"
-```
-
-```shell
-git clone https://github.com/google-research/timesfm.git
-cd timesfm
-pip install -e ".[flax]"
-```
+1. Clone the repository:
+ ```shell
+ git clone https://github.com/google-research/timesfm.git
+ cd timesfm
+ ```
+
+2. Create a virtual environment and install dependencies using `uv`:
+ ```shell
+ # Create a virtual environment
+ uv venv
+
+ # Activate the environment
+ source .venv/bin/activate
+
- # Install the dependencies
- uv pip install -r requirements.txt
- ```
-
- 3. (Optional) If you plan to modify the source code, install the package in editable mode:
- ```shell
- uv pip install -e .
++ # Install the package in editable mode with torch
++ uv pip install -e .[torch]
++ # Or with flax
++ uv pip install -e .[flax]
+ ```
### Code Example
diff --cc pyproject.toml
index ceb12f4,c5344be..715240b
--- a/pyproject.toml
+++ b/pyproject.toml
@@@ -3,21 -3,33 +3,33 @@@ name = "timesfm
version = "2.0.0"
description = "A time series foundation model."
authors = [
- "Rajat Sen <[email protected]>",
- "Yichen Zhou <[email protected]>",
- "Abhimanyu Das <[email protected]>",
- "Petros Mol <[email protected]>",
- "Michael Chertushkin <[email protected]>"
+ {name = "Rajat Sen", email = "[email protected]"},
+ {name = "Yichen Zhou", email = "[email protected]"},
+ {name = "Abhimanyu Das", email = "[email protected]"},
+ {name = "Petros Mol", email = "[email protected]"},
+ {name = "Michael Chertushkin", email = "[email protected]"},
]
-license = "Apache-2.0"
+license = {text = "Apache-2.0"}
readme = "README.md"
-packages = [{include = "timesfm", from = "src"}]
-
-[tool.poetry.dependencies]
-python = ">=3.11,<4.0"
-numpy = ">=1.26.4"
-huggingface_hub = { version = ">=0.23.0", extras = ["cli"] }
-safetensors = ">=0.5.3"
-torch = { version = ">=2.0.0", extras = ["cuda"], optional = true }
-flax = { version = ">=0.8.2", optional = true }
-optax = { version = ">=0.2.2", optional = true }
-einshape = { version = ">=0.8.0", optional = true }
-orbax-checkpoint = { version = ">=0.5.15", optional = true }
-jaxtyping = { version = ">=0.2.29", optional = true }
-jax = { version = ">=0.4.26", optional = true }
-
+requires-python = ">=3.11"
+dependencies = [
+ "numpy>=1.26.4",
+ "huggingface_hub[cli]>=0.23.0",
+ "safetensors>=0.5.3",
++]
+
-[tool.poetry.extras]
-torch = ["torch"]
-flax = ["flax", "optax", "einshape", "orbax-checkpoint", "jaxtyping", "jax"]
++[project.optional-dependencies]
++torch = [
+ "torch>=2.0.0",
+]
++flax = [
++ "flax>=0.8.2",
++ "optax>=0.2.2",
++ "einshape>=0.8.0",
++ "orbax-checkpoint>=0.5.15",
++ "jaxtyping>=0.2.29",
++ "jax>=0.4.26",
++]
[tool.ruff]
line-length = 88