Time Series Forecasting
Transformers
PyTorch
Korean
jnu_tsb
feature-extraction
jnu-tsb
time-series
forecasting
chronos-2
polyglot-ko
korean
finance
covariates
r
reticulate
education
custom_code
Instructions to use HONGRIZON/JNU-TSB with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HONGRIZON/JNU-TSB with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("HONGRIZON/JNU-TSB", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Delete modeling_jnu_tsb.py
Browse files- modeling_jnu_tsb.py +0 -43
modeling_jnu_tsb.py
DELETED
|
@@ -1,43 +0,0 @@
|
|
| 1 |
-
from __future__ import annotations
|
| 2 |
-
|
| 3 |
-
from typing import Any, Dict, Optional
|
| 4 |
-
|
| 5 |
-
import torch
|
| 6 |
-
from torch import nn
|
| 7 |
-
from transformers import PreTrainedModel
|
| 8 |
-
|
| 9 |
-
try:
|
| 10 |
-
from .configuration_jnu_tsb import JNUTSBConfig
|
| 11 |
-
except ImportError: # pragma: no cover - local execution fallback
|
| 12 |
-
from configuration_jnu_tsb import JNUTSBConfig
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
class JNUTSBModel(PreTrainedModel):
|
| 16 |
-
"""Tiny placeholder model for Hugging Face AutoModel loading.
|
| 17 |
-
|
| 18 |
-
The actual forecasting and routing logic lives in ``runtime.JNUTSBRuntime``.
|
| 19 |
-
This class exists so that ``AutoModel.from_pretrained(..., trust_remote_code=True)``
|
| 20 |
-
can load a normal model object from the Hub.
|
| 21 |
-
"""
|
| 22 |
-
|
| 23 |
-
config_class = JNUTSBConfig
|
| 24 |
-
base_model_prefix = "jnu_tsb"
|
| 25 |
-
main_input_name = "inputs"
|
| 26 |
-
|
| 27 |
-
def __init__(self, config: JNUTSBConfig) -> None:
|
| 28 |
-
super().__init__(config)
|
| 29 |
-
self.dummy = nn.Parameter(torch.zeros(1), requires_grad=False)
|
| 30 |
-
|
| 31 |
-
def forward(self, *args: Any, **kwargs: Any) -> Dict[str, str]:
|
| 32 |
-
return {
|
| 33 |
-
"message": "JNU-TSB is a router wrapper. Use pipeline(task='jnu-tsb', ...) or model.predict(...)."
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
-
def predict(self, inputs: Optional[Dict[str, Any]] = None, **kwargs: Any) -> Any:
|
| 37 |
-
try:
|
| 38 |
-
from .runtime import JNUTSBRuntime
|
| 39 |
-
except ImportError: # pragma: no cover
|
| 40 |
-
from runtime import JNUTSBRuntime
|
| 41 |
-
|
| 42 |
-
runtime = JNUTSBRuntime.from_config(self.config)
|
| 43 |
-
return runtime.predict(inputs=inputs, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|