Skip to content

Commit

Permalink
fix: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik committed Dec 5, 2024
1 parent 217dcfe commit 61b8cb7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions aidial_adapter_bedrock/dial_api/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ class ModelsResponse(BaseModel):


def _encode_vector(
encoding_format: Literal["float", "base64"],
vector: List[float],
encoding_format: Literal["float", "base64"], vector: List[float]
) -> List[float] | str:
base64_encoding = encoding_format == "base64"
return vector_to_base64(vector) if base64_encoding else vector
return vector_to_base64(vector) if encoding_format == "base64" else vector


def make_embeddings_response(
Expand Down
3 changes: 2 additions & 1 deletion aidial_adapter_bedrock/llm/model/llama/v3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from typing import Awaitable, Callable

from aidial_adapter_bedrock.dial_api.request import ModelParameters
from aidial_adapter_bedrock.llm.converse.adapter import (
Expand Down Expand Up @@ -26,7 +27,7 @@ def is_stream(self, params: ModelParameters) -> bool:

def input_tokenizer_factory(
deployment: ConverseDeployment, params: ConverseRequestWrapper
):
) -> Callable[[ConverseMessages], Awaitable[int]]:
tool_tokens = default_tokenize_string(json.dumps(params.toolConfig))
system_tokens = default_tokenize_string(json.dumps(params.system))

Expand Down

0 comments on commit 61b8cb7

Please sign in to comment.