Skip to content

Commit

Permalink
fix: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik committed Jan 12, 2024
1 parent 6e42def commit b04403e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_image_type(image: PIL_Image.Image) -> str:
case "PNG":
return "image/png"
case _:
raise ValueError(f"Unknown image mode: {image.mode}")
raise ValueError(f"Unknown image format: {image.format}")

@override
async def chat(
Expand Down
23 changes: 0 additions & 23 deletions aidial_adapter_vertexai/universal_api/errors.py

This file was deleted.

9 changes: 2 additions & 7 deletions aidial_adapter_vertexai/utils/env.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import os
from typing import Optional


def get_env(name: str, err_msg: Optional[str] = None) -> str:
def get_env(name: str) -> str:
if name in os.environ:
val = os.environ.get(name)
if val is not None:
return val

raise Exception(err_msg or f"{name} env variable is not set")


def get_env_bool(name: str, default: bool = False) -> bool:
return os.getenv(name, str(default)).lower() == "true"
raise Exception(f"{name} env variable is not set")
6 changes: 0 additions & 6 deletions client/chat/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,6 @@ async def create(
model = ImageGenerationModel.from_pretrained(deployment.value)
return cls(model)

@staticmethod
def save_file(data: bytes, ext: str) -> Path:
path: Path = SDKImagenChat.get_filename(ext)
path.write_bytes(data)
return path

@staticmethod
def get_filename(ext) -> Path:
dir = get_project_root() / "~images"
Expand Down

0 comments on commit b04403e

Please sign in to comment.