Phase 1
This commit is contained in:
1 parent
e8d9cf6d35
commit
8db198ec0a
51 files changed
+985
-1273
No files matched your search
@@ -0,0 +1,22 @@
|
||||
from transformers import Qwen2_5_VLForConditionalGeneration
|
||||
|
||||
from .._mixin import OstrisTransformersMixin
|
||||
|
||||
|
||||
class Qwen25VLTextEncoder(Qwen2_5_VLForConditionalGeneration, OstrisTransformersMixin):
|
||||
"""Qwen2.5-VL conditioning stack (qwen_image family). Loads from a
|
||||
checkpoint's text_encoder/ subfolder; the edit variants keep the vision
|
||||
tower, plain t2i drops it."""
|
||||
|
||||
aitk_subfolder = "text_encoder"
|
||||
aitk_tokenizer_subfolder = "tokenizer"
|
||||
|
||||
@classmethod
|
||||
def get_transformer_block_names(cls):
|
||||
return ["model.language_model.layers"]
|
||||
|
||||
def drop_vision_tower(self):
|
||||
"""Text-only conditioning: the vision tower is dead weight."""
|
||||
if getattr(self.model, "visual", None) is not None:
|
||||
self.model.visual = None
|
||||
return self
|
||||
Reference in new issue
Block a user