mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-23 03:19:38 +00:00
community: Bump ruff version to 0.9 (#29206)
Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
committed by
GitHub
parent
30f6c9f5c8
commit
723031d548
@@ -89,7 +89,7 @@ class AscendEmbeddings(Embeddings, BaseModel):
|
||||
import torch
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"Unable to import torch, please install with " "`pip install -U torch`."
|
||||
"Unable to import torch, please install with `pip install -U torch`."
|
||||
) from e
|
||||
last_hidden_state = self.model(
|
||||
inputs.input_ids.npu(), inputs.attention_mask.npu(), return_dict=True
|
||||
@@ -103,7 +103,7 @@ class AscendEmbeddings(Embeddings, BaseModel):
|
||||
import torch
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"Unable to import torch, please install with " "`pip install -U torch`."
|
||||
"Unable to import torch, please install with `pip install -U torch`."
|
||||
) from e
|
||||
if self.pooling_method == "cls":
|
||||
return last_hidden_state[:, 0]
|
||||
|
Reference in New Issue
Block a user