Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
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()
  
  
Posted one year ago
133 Views
0 Answers
one year ago
one year ago