Skip to content

Commit

Permalink
fix: fixed stability adapter (#48) (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik authored Dec 21, 2023
1 parent bff58ff commit a6bdd06
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions aidial_adapter_bedrock/llm/model/stability.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,17 @@ class StabilityAdapter(ChatModel):
client: Bedrock
storage: Optional[FileStorage]

def __init__(
self, client: Bedrock, model: str, storage: Optional[FileStorage]
):
super().__init__(model=model, tools_emulator=default_tools_emulator)
self.client = client
self.storage = storage

@classmethod
def create(cls, client: Bedrock, model: str, headers: Mapping[str, str]):
storage: Optional[FileStorage] = create_file_storage(
"images/stable-diffusion", headers
)
return cls(client, model, storage)
return cls(
client=client,
model=model,
storage=storage,
tools_emulator=default_tools_emulator,
)

def _prepare_prompt(
self, messages: List[BaseMessage], max_prompt_tokens: Optional[int]
Expand Down

0 comments on commit a6bdd06

Please sign in to comment.