HONGRIZON commited on
Commit
023def7
·
verified ·
1 Parent(s): 3ddf519

Delete handler.py

Browse files
Files changed (1) hide show
  1. 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)