Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed stability adapter #48

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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