chamikaramj commented on code in PR #40439:
URL: https://github.com/apache/beam/pull/40439#discussion_r4214319882


##########
sdks/python/apache_beam/ml/rag/embeddings/huggingface.py:
##########
@@ -66,20 +61,15 @@ def __init__(
               ``model.encode()``
               (e.g. ``normalize_embeddings``).
     """
-    if not SentenceTransformer:
-      raise ImportError(
-          "sentence-transformers is required to use "
-          "HuggingfaceTextEmbeddings."
-          "Please install it with using `pip install sentence-transformers`.")
     super().__init__(type_adapter=create_text_adapter(), **kwargs)
     self.model_name = model_name
     self.max_seq_length = max_seq_length
-    self.model_class = SentenceTransformer

Review Comment:
   This is an assumption in existing code, right ? I'm not changing it.
   
   It seems to me like we pushed `self.model_class` to a variable just to 
provide a better early error (not an import error). We don't support other 
class values for `model_class` within `huggingface.py` in existing code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to