chest2vec_0.6B / configuration_chest2vec.py
lukeingawesome's picture
Add trust_remote_code integration (Qwen3-Embedding + LoRA)
9286661 verified
"""Configuration for Chest2Vec — a LoRA-tuned Qwen3-Embedding model for
chest radiology report embeddings.
Chest2Vec = Qwen3-Embedding base + contrastive LoRA adapter. It produces a
single L2-normalized report embedding (last-token / EOS pooling), matching the
Qwen3-Embedding convention.
"""
from transformers import PretrainedConfig
class Chest2VecConfig(PretrainedConfig):
model_type = "chest2vec"
def __init__(
self,
base_model: str = "Qwen/Qwen3-Embedding-0.6B",
adapter_subdir: str = "contrastive",
require_flash_attention_2: bool = True,
default_max_len: int = 512,
**kwargs,
):
self.base_model = base_model
self.adapter_subdir = adapter_subdir
self.require_flash_attention_2 = require_flash_attention_2
self.default_max_len = default_max_len
super().__init__(**kwargs)