diff --git a/Dockerfile b/Dockerfile index 0365070..9b7502d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,6 @@ COPY ./scripts/docker_entrypoint.sh /docker_entrypoint.sh RUN chmod +x /docker_entrypoint.sh ENV LOG_LEVEL=INFO -ENV USE_DIAL_FILE_STORAGE=True EXPOSE 5000 USER appuser diff --git a/README.md b/README.md index 57dcbd0..f66b71d 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,9 @@ Copy `.env.example` to `.env` and customize it for your environment: |DEFAULT_REGION||AWS region e.g. "us-east-1"| |LOG_LEVEL|INFO|Log level. Use DEBUG for dev purposes and INFO in prod| |AIDIAL_LOG_LEVEL|WARNING|AI DIAL SDK log level| -|USE_DIAL_FILE_STORAGE|False|Save model artifacts to DIAL File storage (particularly, Stability images are uploaded to the files storage and their base64 encodings are replaced with links to the storage)| -|DIAL_URL||URL of the core DIAL server| -|DIAL_BEDROCK_API_KEY||API Key for DIAL File storage| +|DIAL_USE_FILE_STORAGE|False|Save model artifacts to DIAL File storage (particularly, Stability images are uploaded to the files storage and their base64 encodings are replaced with links to the storage)| +|DIAL_URL||URL of the core DIAL server (required when DIAL_USE_FILE_STORAGE=True)| +|DIAL_API_KEY||API Key for DIAL File storage (required when DIAL_USE_FILE_STORAGE=True)| |WEB_CONCURRENCY|1|Number of workers for the server| |TEST_SERVER_URL|http://0.0.0.0:5001|Server URL used in the integration tests| diff --git a/aidial_adapter_bedrock/llm/model/stability.py b/aidial_adapter_bedrock/llm/model/stability.py index 94b73ee..7c6fa6f 100644 --- a/aidial_adapter_bedrock/llm/model/stability.py +++ b/aidial_adapter_bedrock/llm/model/stability.py @@ -93,13 +93,13 @@ async def save_to_storage( return attachment -USE_DIAL_FILE_STORAGE = ( - os.getenv("USE_DIAL_FILE_STORAGE", "false").lower() == "true" +DIAL_USE_FILE_STORAGE = ( + os.getenv("DIAL_USE_FILE_STORAGE", "false").lower() == "true" ) -if USE_DIAL_FILE_STORAGE: +if DIAL_USE_FILE_STORAGE: DIAL_URL = get_env("DIAL_URL") - DIAL_BEDROCK_API_KEY = get_env("DIAL_BEDROCK_API_KEY") + DIAL_API_KEY = get_env("DIAL_API_KEY") class StabilityAdapter(ChatModel): @@ -111,10 +111,10 @@ def __init__(self, client: Bedrock, model: str): self.client = client self.storage = None - if USE_DIAL_FILE_STORAGE: + if DIAL_USE_FILE_STORAGE: self.storage = FileStorage( dial_url=DIAL_URL, - api_key=DIAL_BEDROCK_API_KEY, + api_key=DIAL_API_KEY, base_dir="stability", )