Skip to content

Commit

Permalink
Merge pull request #227 from ibm-granite/testing_repo
Browse files Browse the repository at this point in the history
Update model paths
  • Loading branch information
wgifford authored Dec 17, 2024
2 parents 0254d2e + 76f492b commit f51b65e
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data_root_path=$1
for cl in 512; do
for fl in 96 192 336 720; do
python ../ttm_full_benchmarking.py --context_length $cl --forecast_length $fl --num_epochs 50 --num_workers 16 \
--hf_model_path ibm/ttm-research-r2 \
--hf_model_path ibm-research/ttm-research-r2 \
--data_root_path $data_root_path \
--fewshot 0 \
--plot 0 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ for cl in 512 1024 1536; do
for fl in 96 192 336 720; do
python ttm_full_benchmarking.py --context_length $cl --forecast_length $fl \
--num_epochs 50 --num_workers 16 --enable_prefix_tuning 1 \
--hf_model_path ibm/ttm-research-r2 \
--hf_model_path ibm-research/ttm-research-r2 \
--data_root_path $data_root_path \
--save_dir results-research-use-r2/
done;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# TTM models for Only Research and Academic (Non-Commercial) Use are here: https://huggingface.co/ibm/ttm-research-r2\n",
"# Please provide the branch name properly based on context_len and forecast_len\n",
"\n",
"hf_model_path = \"ibm/ttm-research-r2\"\n",
"hf_model_path = \"ibm-research/ttm-research-r2\"\n",
"if context_length == 512:\n",
" hf_model_branch = \"main\"\n",
"elif context_length == 1024 or context_length == 1536:\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# TTM models for Only Research and Academic (Non-Commercial) Use are here: https://huggingface.co/ibm/ttm-research-r2\n",
"# TTM models for Only Research and Academic (Non-Commercial) Use are here: https://huggingface.co/ibm-research/ttm-research-r2\n",
"# Please provide the branch name properly based on context_len and forecast_len\n",
"\n",
"hf_model_path = \"ibm/ttm-research-r2\"\n",
"hf_model_path = \"ibm-research/ttm-research-r2\"\n",
"if context_length == 512:\n",
" hf_model_branch = \"main\"\n",
"elif context_length == 1024 or context_length == 1536:\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# TTM models for Only Research and Academic (Non-Commercial) Use are here: https://huggingface.co/ibm/ttm-research-r2\n",
"# TTM models for Only Research and Academic (Non-Commercial) Use are here: https://huggingface.co/ibm-research/ttm-research-r2\n",
"# Please provide the branch name properly based on context_len and forecast_len\n",
"\n",
"hf_model_path = \"ibm/ttm-research-r2\"\n",
"hf_model_path = \"ibm-research/ttm-research-r2\"\n",
"if context_length == 512:\n",
" hf_model_branch = \"main\"\n",
"elif context_length == 1024 or context_length == 1536:\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"\n",
"1. IBM Granite TTM-R1 pre-trained models can be found here: [Granite-TTM-R1 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r1)\n",
"2. IBM Granite TTM-R2 pre-trained models can be found here: [Granite-TTM-R2 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2)\n",
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm/ttm-research-r2)"
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm-research/ttm-research-r2)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"\n",
"1. IBM Granite TTM-R1 pre-trained models can be found here: [Granite-TTM-R1 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r1)\n",
"2. IBM Granite TTM-R2 pre-trained models can be found here: [Granite-TTM-R2 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2)\n",
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm/ttm-research-r2)"
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm-research/ttm-research-r2)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"\n",
"1. IBM Granite TTM-R1 pre-trained models can be found here: [Granite-TTM-R1 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r1)\n",
"2. IBM Granite TTM-R2 pre-trained models can be found here: [Granite-TTM-R2 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2)\n",
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm/ttm-research-r2)"
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm-research/ttm-research-r2)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"\n",
"1. IBM Granite TTM-R1 pre-trained models can be found here: [Granite-TTM-R1 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r1)\n",
"2. IBM Granite TTM-R2 pre-trained models can be found here: [Granite-TTM-R2 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2)\n",
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm/ttm-research-r2)"
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm-research/ttm-research-r2)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
1. TTM-Granite-R1 pre-trained models can be found here: [TTM-R1 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r1)
2. TTM-Granite-R2 pre-trained models can be found here: [TTM-R2 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2)
3. TTM-Research-Use pre-trained models can be found here: [TTM-Research-Use Model Card](https://huggingface.co/ibm/ttm-research-r2)
3. TTM-Research-Use pre-trained models can be found here: [TTM-Research-Use Model Card](https://huggingface.co/ibm-research/ttm-research-r2)
Every model card has a suite of TTM models. Please read the respective model cards for usage instructions.
"""
Expand Down
6 changes: 3 additions & 3 deletions notebooks/hfdemo/ttm_getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"\n",
"1. IBM Granite TTM-R1 pre-trained models can be found here: [Granite-TTM-R1 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r1)\n",
"2. IBM Granite TTM-R2 pre-trained models can be found here: [Granite-TTM-R2 Model Card](https://huggingface.co/ibm-granite/granite-timeseries-ttm-r2)\n",
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm/ttm-research-r2)"
"3. Research-use (non-commercial use only) TTM-R2 pre-trained models can be found here: [Research-Use-TTM-R2](https://huggingface.co/ibm-research/ttm-research-r2)"
]
},
{
Expand Down Expand Up @@ -283,7 +283,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "a826c4f3-1c6c-4088-b6af-f430f45fd380",
"metadata": {},
"outputs": [],
Expand All @@ -295,7 +295,7 @@
"# TTM Model path. The default model path is Granite-R2. Below, you can choose other TTM releases.\n",
"TTM_MODEL_PATH = \"ibm-granite/granite-timeseries-ttm-r2\"\n",
"# TTM_MODEL_PATH = \"ibm-granite/granite-timeseries-ttm-r1\"\n",
"# TTM_MODEL_PATH = \"ibm/ttm-research-r2\"\n",
"# TTM_MODEL_PATH = \"ibm-research/ttm-research-r2\"\n",
"\n",
"# Context length, Or Length of the history.\n",
"# Currently supported values are: 512/1024/1536 for Granite-TTM-R2 and Research-Use-TTM-R2, and 512/1024 for Granite-TTM-R1\n",
Expand Down
2 changes: 1 addition & 1 deletion services/finetuning/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ image:

clone_models:
git lfs install || true
git clone https://huggingface.co/ibm/test-tsfm mytest-tsfm || true
git clone https://huggingface.co/ibm-research/test-tsfm mytest-tsfm || true


fetchdata:
Expand Down
2 changes: 1 addition & 1 deletion services/inference/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ install_dev: boilerplate

clone_models:
git lfs install || true
git clone https://huggingface.co/ibm/test-tsfm mytest-tsfm || true
git clone https://huggingface.co/ibm-research/test-tsfm mytest-tsfm || true

delete_models:
rm -rf mytest-tsfm || true
Expand Down
4 changes: 2 additions & 2 deletions tests/toolkit/test_get_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ def test_get_model():
assert model.config.prediction_length == fl
assert model.config.context_length == cl

mp = "ibm/ttm-research-r2"
mp = "ibm-research/ttm-research-r2"
for cl in [512, 1024, 1536]:
for fl in [96, 192, 336, 720]:
model = get_model(model_path=mp, context_length=cl, prediction_length=fl)
assert model.config.prediction_length == fl
assert model.config.context_length == cl

mp = "ibm/ttm-research-r2"
mp = "ibm-research/ttm-research-r2"
for cl in range(1, 2000, 500):
for fl in range(1, 900, 90):
model = get_model(model_path=mp, context_length=cl, prediction_length=fl)
Expand Down
24 changes: 12 additions & 12 deletions tsfm_public/resources/model_paths_config/ttm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,73 +88,73 @@ ibm-granite-models:
research-use-models:
r2-512-96-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: main
context_length: 512
prediction_length: 96
r2-512-192-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 512-192-ft-r2
context_length: 512
prediction_length: 192
r2-512-336-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 512-336-ft-r2
context_length: 512
prediction_length: 336
r2-512-720-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 512-720-ft-r2
context_length: 512
prediction_length: 720
r2-1024-96-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 1024-96-ft-r2
context_length: 1024
prediction_length: 96
r2-1024-192-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 1024-192-ft-r2
context_length: 1024
prediction_length: 192
r2-1024-336-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 1024-336-ft-r2
context_length: 1024
prediction_length: 336
r2-1024-720-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 1024-720-ft-r2
context_length: 1024
prediction_length: 720
r2-1536-96-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 1536-96-ft-r2
context_length: 1536
prediction_length: 96
r2-1536-192-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 1536-192-ft-r2
context_length: 1536
prediction_length: 192
r2-1536-336-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 1536-336-ft-r2
context_length: 1536
prediction_length: 336
r2-1536-720-freq:
release: r2
model_card: ibm/ttm-research-r2
model_card: ibm-research/ttm-research-r2
revision: 1536-720-ft-r2
context_length: 1536
prediction_length: 720
6 changes: 3 additions & 3 deletions tsfm_public/toolkit/get_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def check_ttm_model_path(model_path):
return 1
elif "ibm-granite/granite-timeseries-ttm-r2" in model_path:
return 2
elif "ibm/ttm-research-r2" in model_path:
elif "ibm-research/ttm-research-r2" in model_path:
return 3
else:
return 0
Expand All @@ -63,10 +63,10 @@ def get_model(
model name to use. Allowed values: ttm
context_length (int):
Input Context length. For ibm-granite/granite-timeseries-ttm-r1, we allow 512 and 1024.
For ibm-granite/granite-timeseries-ttm-r2 and ibm/ttm-research-r2, we allow 512, 1024 and 1536
For ibm-granite/granite-timeseries-ttm-r2 and ibm-research/ttm-research-r2, we allow 512, 1024 and 1536
prediction_length (int):
Forecast length to predict. For ibm-granite/granite-timeseries-ttm-r1, we can forecast upto 96.
For ibm-granite/granite-timeseries-ttm-r2 and ibm/ttm-research-r2, we can forecast upto 720.
For ibm-granite/granite-timeseries-ttm-r2 and ibm-research/ttm-research-r2, we can forecast upto 720.
Model is trained for fixed forecast lengths (96,192,336,720) and this model add required `prediction_filter_length` to the model instance for required pruning.
For Ex. if we need to forecast 150 timepoints given last 512 timepoints using model_path = ibm-granite/granite-timeseries-ttm-r2, then get_model will select the
model from 512_192_r2 branch and applies prediction_filter_length = 150 to prune the forecasts from 192 to 150. prediction_filter_length also applies loss
Expand Down

0 comments on commit f51b65e

Please sign in to comment.