@@ -65,8 +65,10 @@ def __init__(
6565 try :
6666 import cohere
6767 except ImportError :
68- raise ImportError ("Cohere vectorizer requires the cohere library. \
69- Please install with `pip install cohere`" )
68+ raise ImportError (
69+ "Cohere vectorizer requires the cohere library. \
70+ Please install with `pip install cohere`"
71+ )
7072
7173 # Fetch the API key from api_config or environment variable
7274 api_key = (
@@ -142,8 +144,10 @@ def embed(
142144 if not isinstance (text , str ):
143145 raise TypeError ("Must pass in a str value to embed." )
144146 if not isinstance (input_type , str ):
145- raise TypeError ("Must pass in a str value for cohere embedding input_type. \
146- See https://docs.cohere.com/reference/embed." )
147+ raise TypeError (
148+ "Must pass in a str value for cohere embedding input_type. \
149+ See https://docs.cohere.com/reference/embed."
150+ )
147151 if preprocess :
148152 text = preprocess (text )
149153 embedding = self ._model_client .embed (
@@ -208,8 +212,10 @@ def embed_many(
208212 if len (texts ) > 0 and not isinstance (texts [0 ], str ):
209213 raise TypeError ("Must pass in a list of str values to embed." )
210214 if not isinstance (input_type , str ):
211- raise TypeError ("Must pass in a str value for cohere embedding input_type.\
212- See https://docs.cohere.com/reference/embed." )
215+ raise TypeError (
216+ "Must pass in a str value for cohere embedding input_type.\
217+ See https://docs.cohere.com/reference/embed."
218+ )
213219
214220 embeddings : List = []
215221 for batch in self .batchify (texts , batch_size , preprocess ):
0 commit comments