diff --git a/src/mflux/models/transformer/joint_attention.py b/src/mflux/models/transformer/joint_attention.py index 7c7cd80..6ea3f62 100644 --- a/src/mflux/models/transformer/joint_attention.py +++ b/src/mflux/models/transformer/joint_attention.py @@ -28,8 +28,6 @@ class JointAttention(nn.Module): encoder_hidden_states: mx.array, image_rotary_emb: mx.array, ) -> (mx.array, mx.array): - residual = hidden_states - query = self.to_q(hidden_states) key = self.to_k(hidden_states) value = self.to_v(hidden_states) diff --git a/src/mflux/post_processing/generated_image.py b/src/mflux/post_processing/generated_image.py index 1ba24b9..ad6c694 100644 --- a/src/mflux/post_processing/generated_image.py +++ b/src/mflux/post_processing/generated_image.py @@ -83,15 +83,6 @@ class GeneratedImage: # Define the UserComment tag ID USER_COMMENT_TAG_ID = 0x9286 - # Create an EXIF dictionary - exif_dict = { - "0th": {}, - "Exif": {USER_COMMENT_TAG_ID: user_comment_bytes}, - "GPS": {}, - "1st": {}, - "thumbnail": None, - } - # Create a piexif-compatible dictionary structure exif_piexif_dict = {"Exif": {USER_COMMENT_TAG_ID: user_comment_bytes}} diff --git a/src/mflux/weights/lora_converter.py b/src/mflux/weights/lora_converter.py index 67ab6b3..9570a04 100644 --- a/src/mflux/weights/lora_converter.py +++ b/src/mflux/weights/lora_converter.py @@ -25,7 +25,6 @@ class LoRAConverter: def _load_pytorch_weights(lora_path: str) -> dict: state_dict = {} with safe_open(lora_path, framework="pt") as f: - metadata = f.metadata() for k in f.keys(): state_dict[k] = f.get_tensor(k) return state_dict diff --git a/src/mflux/weights/lora_util.py b/src/mflux/weights/lora_util.py index dcd9f47..9145914 100644 --- a/src/mflux/weights/lora_util.py +++ b/src/mflux/weights/lora_util.py @@ -78,7 +78,7 @@ class LoraUtil: if parentKey not in visited: visited[parentKey] = {} visited[parentKey][splitKey] = weight - if not "weight" in target: + if "weight" not in target: raise ValueError(f"LoRA weights for layer {parentKey} cannot be loaded into the model.") if "lora_A" in visited[parentKey] and "lora_B" in visited[parentKey]: lora_a = visited[parentKey]["lora_A"]