Skip to content

Commit

Permalink
Merge pull request #52 from JustinGuese/master
Browse files Browse the repository at this point in the history
PyPI package, Poetry support
  • Loading branch information
siriuz42 authored Jul 12, 2024
2 parents 4140bfa + c969392 commit 6a441e3
Show file tree
Hide file tree
Showing 5 changed files with 6,062 additions and 22 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.venv/
dist/
**__pycache__/** */
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 6a441e3

Please sign in to comment.