Dummy handler
Browse files- handler.py +9 -8
handler.py
CHANGED
|
@@ -1,18 +1,19 @@
|
|
| 1 |
from typing import Any, List, Dict
|
| 2 |
import torch
|
| 3 |
|
| 4 |
-
from chronos import ChronosPipeline
|
| 5 |
|
| 6 |
|
| 7 |
class EndpointHandler:
|
| 8 |
-
def __init__(self) -> None:
|
| 9 |
-
self.pipeline = ChronosPipeline.from_pretrained("amazon/chronos-t5-tiny")
|
|
|
|
| 10 |
|
| 11 |
def __call__(self, data: Any) -> List[Dict[str, float]]:
|
| 12 |
inputs = data.pop("inputs")
|
| 13 |
-
# parameters = data.pop("parameters", {"prediction_length"})
|
| 14 |
|
| 15 |
-
forecast = self.pipeline.predict(
|
| 16 |
-
|
| 17 |
-
)
|
| 18 |
-
return {"
|
|
|
|
| 1 |
from typing import Any, List, Dict
|
| 2 |
import torch
|
| 3 |
|
| 4 |
+
# from chronos import ChronosPipeline
|
| 5 |
|
| 6 |
|
| 7 |
class EndpointHandler:
|
| 8 |
+
def __init__(self, path: str = "") -> None:
|
| 9 |
+
# self.pipeline = ChronosPipeline.from_pretrained("amazon/chronos-t5-tiny")
|
| 10 |
+
pass
|
| 11 |
|
| 12 |
def __call__(self, data: Any) -> List[Dict[str, float]]:
|
| 13 |
inputs = data.pop("inputs")
|
| 14 |
+
# # parameters = data.pop("parameters", {"prediction_length"})
|
| 15 |
|
| 16 |
+
# forecast = self.pipeline.predict(
|
| 17 |
+
# torch.tensor(inputs["context"]), prediction_length=5
|
| 18 |
+
# )
|
| 19 |
+
return {"response": [1, 2, 3]}
|