We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 91a4f51 + d161196 commit 65cd16bCopy full SHA for 65cd16b
ts/torch_handler/request_envelope/kservev2.py
@@ -30,6 +30,10 @@
30
# NOTE: numpy has more types than v2 protocol
31
_NumpyToDatatype["object"] = "BYTES"
32
33
+# Adding support for unicode string
34
+# Ref: https://numpy.org/doc/stable/reference/arrays.dtypes.html
35
+_NumpyToDatatype["U"] = "BYTES"
36
+
37
38
def _to_dtype(datatype: str) -> "np.dtype":
39
dtype = _DatatypeToNumpy[datatype]
@@ -38,6 +42,8 @@ def _to_dtype(datatype: str) -> "np.dtype":
42
43
def _to_datatype(dtype: np.dtype) -> str:
40
44
as_str = str(dtype)
45
+ if as_str not in _NumpyToDatatype:
46
+ as_str = getattr(dtype, "kind")
41
47
datatype = _NumpyToDatatype[as_str]
48
49
return datatype
0 commit comments