Skip to content

Commit

Permalink
Image error fix (#80)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Fabio Nonato <[email protected]>
  • Loading branch information
nonatofabio and Fabio Nonato authored Dec 11, 2024
1 parent 241d5c0 commit 4fc0d3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/models/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import AsyncIterable, Iterable, Literal

import boto3
from botocore.config import Config
import numpy as np
import requests
import tiktoken
Expand Down Expand Up @@ -42,9 +43,12 @@

logger = logging.getLogger(__name__)

config = Config(connect_timeout=1, read_timeout=120, retries={"max_attempts": 1})

bedrock_runtime = boto3.client(
service_name="bedrock-runtime",
region_name=AWS_REGION,
config=config,
)

SUPPORTED_BEDROCK_EMBEDDING_MODELS = {
Expand Down Expand Up @@ -362,7 +366,7 @@ def _invoke_bedrock(self, chat_request: ChatRequest, stream=False):
# convert OpenAI chat request to Bedrock SDK request
args = self._parse_request(chat_request)
if DEBUG:
logger.info("Bedrock request: " + json.dumps(args))
logger.info("Bedrock request: " + json.dumps(str(args)))

try:
if stream:
Expand Down

0 comments on commit 4fc0d3b

Please sign in to comment.