We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 309a9ac commit 9e95028Copy full SHA for 9e95028
sentence_transformers/SentenceTransformer.py
@@ -529,8 +529,9 @@ def encode(
529
if self.device.type == "hpu" and not self.is_hpu_graph_enabled:
530
import habana_frameworks.torch as ht
531
532
- ht.hpu.wrap_in_hpu_graph(self, disable_tensor_cache=True)
533
- self.is_hpu_graph_enabled = True
+ if hasattr(ht, "hpu") and hasattr(ht.hpu, "wrap_in_hpu_graph"):
+ ht.hpu.wrap_in_hpu_graph(self, disable_tensor_cache=True)
534
+ self.is_hpu_graph_enabled = True
535
536
self.eval()
537
if show_progress_bar is None:
0 commit comments