@@ -58,7 +58,7 @@ def ACCEPT(self):
58
58
class StringDeserializer (BaseDeserializer ):
59
59
"""Deserialize data from an inference endpoint into a decoded string."""
60
60
61
- ACCEPT = [ "application/json" , "text/csv" ]
61
+ ACCEPT = ( "application/json" , "text/csv" )
62
62
63
63
def __init__ (self , encoding = "UTF-8" ):
64
64
"""Initialize the string encoding.
@@ -87,7 +87,7 @@ def deserialize(self, stream, content_type):
87
87
class BytesDeserializer (BaseDeserializer ):
88
88
"""Deserialize a stream of bytes into a bytes object."""
89
89
90
- ACCEPT = [ "*/*" ]
90
+ ACCEPT = ( "*/*" ,)
91
91
92
92
def deserialize (self , stream , content_type ):
93
93
"""Read a stream of bytes returned from an inference endpoint.
@@ -108,7 +108,7 @@ def deserialize(self, stream, content_type):
108
108
class CSVDeserializer (BaseDeserializer ):
109
109
"""Deserialize a stream of bytes into a list of lists."""
110
110
111
- ACCEPT = [ "text/csv" ]
111
+ ACCEPT = ( "text/csv" ,)
112
112
113
113
def __init__ (self , encoding = "utf-8" ):
114
114
"""Initialize the string encoding.
@@ -143,7 +143,7 @@ class StreamDeserializer(BaseDeserializer):
143
143
reading it.
144
144
"""
145
145
146
- ACCEPT = [ "*/*" ]
146
+ ACCEPT = ( "*/*" ,)
147
147
148
148
def deserialize (self , stream , content_type ):
149
149
"""Returns a stream of the response body and the MIME type of the data.
@@ -161,7 +161,7 @@ def deserialize(self, stream, content_type):
161
161
class NumpyDeserializer (BaseDeserializer ):
162
162
"""Deserialize a stream of data in the .npy format."""
163
163
164
- ACCEPT = [ "application/x-npy" , "text/csv" , "application/json" ]
164
+ ACCEPT = ( "application/x-npy" , "text/csv" , "application/json" )
165
165
166
166
def __init__ (self , dtype = None , allow_pickle = True ):
167
167
"""Initialize the dtype and allow_pickle arguments.
@@ -201,7 +201,7 @@ def deserialize(self, stream, content_type):
201
201
class JSONDeserializer (BaseDeserializer ):
202
202
"""Deserialize JSON data from an inference endpoint into a Python object."""
203
203
204
- ACCEPT = [ "application/json" ]
204
+ ACCEPT = ( "application/json" ,)
205
205
206
206
def deserialize (self , stream , content_type ):
207
207
"""Deserialize JSON data from an inference endpoint into a Python object.
@@ -222,7 +222,7 @@ def deserialize(self, stream, content_type):
222
222
class PandasDeserializer (BaseDeserializer ):
223
223
"""Deserialize CSV or JSON data from an inference endpoint into a pandas dataframe."""
224
224
225
- ACCEPT = [ "text/csv" , "application/json" ]
225
+ ACCEPT = ( "text/csv" , "application/json" )
226
226
227
227
def deserialize (self , stream , content_type ):
228
228
"""Deserialize CSV or JSON data from an inference endpoint into a pandas
@@ -250,7 +250,7 @@ def deserialize(self, stream, content_type):
250
250
class JSONLinesDeserializer (BaseDeserializer ):
251
251
"""Deserialize JSON lines data from an inference endpoint."""
252
252
253
- ACCEPT = [ "application/jsonlines" ]
253
+ ACCEPT = ( "application/jsonlines" ,)
254
254
255
255
def deserialize (self , stream , content_type ):
256
256
"""Deserialize JSON lines data from an inference endpoint.
0 commit comments