(self, device="cpu", dtype=dtype, model_options={})
| 171 | def ltxv_gemma_clip(encoder_path, ltxv_path, processor=None, dtype=None): |
| 172 | class _LTXVGemmaTextEncoderModel(LTXVGemmaTextEncoderModel): |
| 173 | def __init__(self, device="cpu", dtype=dtype, model_options={}): |
| 174 | dtype = torch.bfloat16 # TODO: make this configurable |
| 175 | |
| 176 | gemma_model = Gemma3ForConditionalGeneration.from_pretrained( |
| 177 | encoder_path, |
| 178 | local_files_only=True, |
| 179 | torch_dtype=dtype, |
| 180 | ) |
| 181 | |
| 182 | feature_extractor, embeddings_processor = load_text_embeddings_pipeline( |
| 183 | ltxv_path, |
| 184 | dtype=dtype, |
| 185 | fallback_proj_path=encoder_path / "proj_linear.safetensors", |
| 186 | ) |
| 187 | |
| 188 | super().__init__( |
| 189 | model=gemma_model, |
| 190 | feature_extractor=feature_extractor, |
| 191 | embeddings_processor=embeddings_processor, |
| 192 | processor=processor, |
| 193 | dtype=dtype, |
| 194 | device=device, |
| 195 | ) |
| 196 | |
| 197 | return _LTXVGemmaTextEncoderModel |
| 198 |
nothing calls this directly
no test coverage detected