Unanswered
Hi Everyone!
I Am Using Clearml-Serving
When I Am Trying To Add New Endpoint Like This
Hi @<1523701205467926528:profile|AgitatedDove14>
My preprocess file:
from typing import Any, Union, Optional, Callable
class Preprocess(object):
def init(self):
pass
def preprocess(
self,
body: Union[bytes, dict],
state: dict,
collect_custom_statistics_fn: Optional[Callable[[dict], None]]
) -> Any:
return body["length"], body["audio_signal"]
def postprocess(
self,
data: Any,
state: dict,
collect_custom_statistics_fn: Optional[Callable[[dict], None]]
) -> dict:
return {
"encoded_lengths": data["encoded_lengths"].tolist(),
"output": data["output"].tolist()
}
My request code that returns error:
import numpy as np
import requests
batch = 4
length = 3
body={
"length": [length] * batch,
"audio_signal": np.random.randn(batch, 80, length).astype(np.float16).tolist()
}
response =
(f"<>", json=body)
response.json()
142 Views
0
Answers
one year ago
one year ago