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 handler.py
Browse files- handler.py +0 -27
handler.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 1 |
-
from __future__ import annotations
|
| 2 |
-
|
| 3 |
-
from typing import Any, Dict
|
| 4 |
-
|
| 5 |
-
try:
|
| 6 |
-
from .runtime import JNUTSBRuntime
|
| 7 |
-
except ImportError: # pragma: no cover - local execution fallback
|
| 8 |
-
from runtime import JNUTSBRuntime
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class EndpointHandler:
|
| 12 |
-
"""Custom Hugging Face Inference Endpoint handler for JNU-TSB.
|
| 13 |
-
|
| 14 |
-
Request body:
|
| 15 |
-
{
|
| 16 |
-
"inputs": {"stock": [...], "news": [...]},
|
| 17 |
-
"parameters": {"prediction_length": 5, "use_llm_extractor": false}
|
| 18 |
-
}
|
| 19 |
-
"""
|
| 20 |
-
|
| 21 |
-
def __init__(self, model_dir: str, **kwargs: Any) -> None:
|
| 22 |
-
self.runtime = JNUTSBRuntime.from_config_dir(model_dir)
|
| 23 |
-
|
| 24 |
-
def __call__(self, data: Dict[str, Any]) -> Any:
|
| 25 |
-
inputs = data.get("inputs", data)
|
| 26 |
-
parameters = data.get("parameters", {})
|
| 27 |
-
return self.runtime.predict(inputs=inputs, **parameters)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|