@@ -190,7 +190,7 @@ def embed_many(
190190 if len (texts ) > 0 and not isinstance (texts [0 ], str ):
191191 raise TypeError ("Must pass in a list of str values to embed." )
192192
193- dtype = kwargs .pop ("dtype" , None )
193+ dtype = kwargs .pop ("dtype" , "float32" )
194194
195195 embeddings : List = []
196196 for batch in self .batchify (texts , batch_size , preprocess ):
@@ -234,7 +234,7 @@ def embed(
234234 if preprocess :
235235 text = preprocess (text )
236236
237- dtype = kwargs .pop ("dtype" , None )
237+ dtype = kwargs .pop ("dtype" , "float32" )
238238
239239 result = self ._client .embeddings .create (input = [text ], model = self .model )
240240 return self ._process_embedding (result .data [0 ].embedding , as_buffer , dtype )
@@ -274,7 +274,7 @@ async def aembed_many(
274274 if len (texts ) > 0 and not isinstance (texts [0 ], str ):
275275 raise TypeError ("Must pass in a list of str values to embed." )
276276
277- dtype = kwargs .pop ("dtype" , None )
277+ dtype = kwargs .pop ("dtype" , "float32" )
278278
279279 embeddings : List = []
280280 for batch in self .batchify (texts , batch_size , preprocess ):
@@ -320,7 +320,7 @@ async def aembed(
320320 if preprocess :
321321 text = preprocess (text )
322322
323- dtype = kwargs .pop ("dtype" , None )
323+ dtype = kwargs .pop ("dtype" , "float32" )
324324
325325 result = await self ._aclient .embeddings .create (input = [text ], model = self .model )
326326 return self ._process_embedding (result .data [0 ].embedding , as_buffer , dtype )
0 commit comments