Skip to content

Commit

Permalink
reno & black
Browse files Browse the repository at this point in the history
  • Loading branch information
jlonge4 committed Nov 24, 2023
1 parent 2c5e5a7 commit bc370b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 3 additions & 5 deletions haystack/nodes/retriever/_embedding_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,8 @@ def embed(self, text: str) -> np.ndarray:
input_body["inputText"] = text
body = json.dumps(input_body)
response = self.client.invoke_model(
body=body,
modelId=self.model,
accept="application/json",
contentType="application/json",
)
body=body, modelId=self.model, accept="application/json", contentType="application/json"
)

response_body = json.loads(response.get("body").read())
return np.array(response_body.get("embedding"))
Expand Down Expand Up @@ -487,6 +484,7 @@ def train(
def save(self, save_dir: Union[Path, str]):
raise NotImplementedError(f"Saving is not implemented for {self.__class__}")


_EMBEDDING_ENCODERS: Dict[str, Callable] = {
"farm": _DefaultEmbeddingEncoder,
"transformers": _DefaultEmbeddingEncoder,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
features:
- |
Adding Bedrock Embeddings Encoder to use as a retriever.

0 comments on commit bc370b8

Please sign in to comment.