Syed110-3/karachi-aqi-predictor
Viewer • Updated • 29.4k • 2.69k • 2
How to use mahwizzzz/skyloom with Transformers:
# Load model directly
from transformers import AutoTokenizer, TimesFm2_5ModelForPrediction
tokenizer = AutoTokenizer.from_pretrained("mahwizzzz/skyloom")
model = TimesFm2_5ModelForPrediction.from_pretrained("mahwizzzz/skyloom")How to use mahwizzzz/skyloom with TimesFM:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
This is a fine‑tuned version of google/timesfm-2.5-200m-transformers for hourly Air Quality Index (AQI) forecasting in Karachi, Pakistan.
The model is optimised for a 24‑step forecast horizon (next 24 hours).
| Item | Value |
|---|---|
| Base model | google/timesfm-2.5-200m-transformers |
| Task | Univariate time‑series forecasting |
| Target variable | Hourly AQI |
| Location | Karachi, Pakistan |
| Forecast horizon (training) | 24 hours |
| Forecast horizon (evaluation) | 24 hours |
| Test MAE | 5.178 |
| Test sMAPE | 5.456% |
| Test MASE | 0.4687 |
Syed110-3/karachi-aqi-predictor| Model | MAE | RMSE | sMAPE | MASE |
|---|---|---|---|---|
| Skyloom | 5.178 | 8.859 | 5.456 | 0.4687 |
| ValidationWeightedEnsemble | 5.170 | 8.824 | 5.449 | 0.4679 |
| TimesFM‑ZeroShot | 5.279 | 9.023 | 5.546 | 0.4778 |
| HGBDirectLagCalendar | 6.899 | 10.597 | 7.390 | 0.6244 |
| SeasonalDrift24h | 10.238 | 15.391 | 10.867 | 0.9266 |
| RollingMean24h | 10.749 | 15.926 | 11.281 | 0.9729 |
| SeasonalNaive | 11.008 | 16.520 | 11.629 | 0.9962 |
| SameHourMean7D | 13.962 | 19.036 | 15.142 | 1.2636 |
| ETS_Additive24h | 13.962 | 19.036 | 15.142 | 1.2636 |
Note: The ensemble assigned 90% weight to the model and 0% to the zero‑shot model, confirming that fine‑tuning was essential for this dataset.
import torch
import numpy as np
from transformers import TimesFm2_5ModelForPrediction
model_id = "mahwizzzz/skyloom"
device = "cuda" if torch.cuda.is_available() else "cpu"
model = TimesFm2_5ModelForPrediction.from_pretrained(
model_id,
torch_dtype=torch.bfloat16 if device == "cuda" else torch.float32,
device_map=device
)
model.eval()
# Provide the last 1024 hourly AQI values
past_aqi = np.array([...], dtype=np.float32)
with torch.no_grad():
batch = torch.tensor(past_aqi[-1024:][None, :], dtype=torch.float32).to(device)
output = model(past_values=batch, forecast_context_len=1024)
forecast_24h = output.mean_predictions[0, :24].float().cpu().numpy()
forecast_24h = np.clip(forecast_24h, 0, None)
print(forecast_24h)
If you use this model, cite the base TimesFM work and this model repository:
@misc{skyloom2026,
title = {Skyloom: TimesFM 2.5 for Karachi AQI Forecasting},
author = {Mahwiz khalil},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/mahwizzzz/skyloom}}
}
Base model
google/timesfm-2.5-200m-transformers