tvalentyn commented on code in PR #40439:
URL: https://github.com/apache/beam/pull/40439#discussion_r4212520753
##########
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:
is SentenceTransformer the only possible model class and will always be the
only candidate for this codepath? It looks like we are making an assumption
that if model_class is not callable, then it is SentenceTransformer. Is it safe
to assume it will hold?
--
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]