From 21c5af48e12644e1e9bb97aac10029bc7c2e57bf Mon Sep 17 00:00:00 2001 From: turboderp <11859846+turboderp@users.noreply.github.com> Date: Sun, 15 Jun 2025 19:30:38 +0200 Subject: [PATCH] Tree: Format --- backends/exllamav3/model.py | 4 ++-- common/multimodal.py | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backends/exllamav3/model.py b/backends/exllamav3/model.py index c8761ff..ee2dfaa 100644 --- a/backends/exllamav3/model.py +++ b/backends/exllamav3/model.py @@ -435,7 +435,7 @@ class ExllamaV3Container(BaseModelContainer): if self.use_vision: for value in self.vision_model.load_gen( reserve_per_device=self.autosplit_reserve, - callback=progress_callback + callback=progress_callback, ): if value: yield value @@ -559,7 +559,7 @@ class ExllamaV3Container(BaseModelContainer): kwargs.get("add_bos_token"), self.hf_model.add_bos_token() ), encode_special_tokens=unwrap(kwargs.get("encode_special_tokens"), True), - embeddings=mm_embeddings_content + embeddings=mm_embeddings_content, ) .flatten() .tolist() diff --git a/common/multimodal.py b/common/multimodal.py index 8b21587..ec5fb6f 100644 --- a/common/multimodal.py +++ b/common/multimodal.py @@ -22,14 +22,12 @@ class MultimodalEmbeddingWrapper(BaseModel): async def add(self, url: str): # Determine the type of vision embedding to use if not self.type: - if ( - dependencies.exllamav2 and - isinstance(model.container.vision_model, ExLlamaV2VisionTower) + if dependencies.exllamav2 and isinstance( + model.container.vision_model, ExLlamaV2VisionTower ): self.type = "ExLlamaV2MMEmbedding" - elif ( - dependencies.exllamav3 and - isinstance(model.container.vision_model, Model) + elif dependencies.exllamav3 and isinstance( + model.container.vision_model, Model ): self.type = "MMEmbedding" @@ -43,4 +41,4 @@ class MultimodalEmbeddingWrapper(BaseModel): self.content.append(embedding) self.text_alias.append(embedding.text_alias) else: - logger.error("No valid vision model to create embedding") \ No newline at end of file + logger.error("No valid vision model to create embedding")