convitom Claude Sonnet 4.6 commited on
Commit ·
93ddbd3
1
Parent(s): 215ecd6
fix: complete image_encoder→rad_dino rename (repair broken HEAD)
Browse filesThe file rename landed in 215ecd6 but the importer updates in
model/__init__.py, model/cxr_vlm.py, evaluation/{evaluate,inference}.py
and training/train.py were left uncommitted, so a clean checkout of HEAD
raised ImportError (from .image_encoder import …, file no longer exists).
Commit only those import-line fixes (6 lines) to make HEAD importable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- evaluation/evaluate.py +1 -1
- evaluation/inference.py +1 -1
- model/__init__.py +1 -1
- model/cxr_vlm.py +2 -2
- training/train.py +1 -1
evaluation/evaluate.py
CHANGED
|
@@ -52,7 +52,7 @@ from tqdm import tqdm
|
|
| 52 |
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
| 53 |
|
| 54 |
from model import CXRVisionLanguageModel
|
| 55 |
-
from model.
|
| 56 |
from data import CXRInstructDataset, CXRDataCollator
|
| 57 |
from data.prompt_templates import (
|
| 58 |
build_findings_prompt,
|
|
|
|
| 52 |
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
| 53 |
|
| 54 |
from model import CXRVisionLanguageModel
|
| 55 |
+
from model.rad_dino import BioViLTEncoder
|
| 56 |
from data import CXRInstructDataset, CXRDataCollator
|
| 57 |
from data.prompt_templates import (
|
| 58 |
build_findings_prompt,
|
evaluation/inference.py
CHANGED
|
@@ -67,7 +67,7 @@ from omegaconf import OmegaConf
|
|
| 67 |
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
| 68 |
|
| 69 |
from model import CXRVisionLanguageModel
|
| 70 |
-
from model.
|
| 71 |
from data.prompt_templates import (
|
| 72 |
build_findings_prompt,
|
| 73 |
build_impression_prompt,
|
|
|
|
| 67 |
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
| 68 |
|
| 69 |
from model import CXRVisionLanguageModel
|
| 70 |
+
from model.rad_dino import BioViLTEncoder
|
| 71 |
from data.prompt_templates import (
|
| 72 |
build_findings_prompt,
|
| 73 |
build_impression_prompt,
|
model/__init__.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
from .cxr_vlm import CXRVisionLanguageModel
|
| 2 |
-
from .
|
| 3 |
from .projection import MLPProjection
|
| 4 |
from .chexpert_classifier import CheXpertClassifier
|
|
|
|
| 1 |
from .cxr_vlm import CXRVisionLanguageModel
|
| 2 |
+
from .rad_dino import BioViLTEncoder
|
| 3 |
from .projection import MLPProjection
|
| 4 |
from .chexpert_classifier import CheXpertClassifier
|
model/cxr_vlm.py
CHANGED
|
@@ -26,7 +26,7 @@ from omegaconf import DictConfig
|
|
| 26 |
from transformers import AutoTokenizer, LlamaForCausalLM, BitsAndBytesConfig
|
| 27 |
from peft import get_peft_model, LoraConfig, TaskType, PeftModel, prepare_model_for_kbit_training
|
| 28 |
|
| 29 |
-
from .
|
| 30 |
from .projection import MLPProjection
|
| 31 |
from .chexpert_classifier import CheXpertClassifier
|
| 32 |
|
|
@@ -55,7 +55,7 @@ class CXRVisionLanguageModel(nn.Module):
|
|
| 55 |
|
| 56 |
# ── 1. Image Encoder (rad_dino / biovilt / vit, frozen) ─────────────
|
| 57 |
# `backend` defaults to "auto" → tries rad_dino → biovilt → vit and
|
| 58 |
-
# uses the first that loads (see model/
|
| 59 |
_enc_backend = getattr(model_cfg.image_encoder, "backend", "auto")
|
| 60 |
self.image_encoder = BioViLTEncoder(
|
| 61 |
frozen = model_cfg.image_encoder.frozen,
|
|
|
|
| 26 |
from transformers import AutoTokenizer, LlamaForCausalLM, BitsAndBytesConfig
|
| 27 |
from peft import get_peft_model, LoraConfig, TaskType, PeftModel, prepare_model_for_kbit_training
|
| 28 |
|
| 29 |
+
from .rad_dino import BioViLTEncoder
|
| 30 |
from .projection import MLPProjection
|
| 31 |
from .chexpert_classifier import CheXpertClassifier
|
| 32 |
|
|
|
|
| 55 |
|
| 56 |
# ── 1. Image Encoder (rad_dino / biovilt / vit, frozen) ─────────────
|
| 57 |
# `backend` defaults to "auto" → tries rad_dino → biovilt → vit and
|
| 58 |
+
# uses the first that loads (see model/rad_dino.py docstring).
|
| 59 |
_enc_backend = getattr(model_cfg.image_encoder, "backend", "auto")
|
| 60 |
self.image_encoder = BioViLTEncoder(
|
| 61 |
frozen = model_cfg.image_encoder.frozen,
|
training/train.py
CHANGED
|
@@ -40,7 +40,7 @@ from transformers import TrainingArguments, Trainer, TrainerCallback
|
|
| 40 |
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
| 41 |
|
| 42 |
from model import CXRVisionLanguageModel
|
| 43 |
-
from model.
|
| 44 |
from data import CXRInstructDataset, CXRDataCollator
|
| 45 |
from utils.logger import setup_logger
|
| 46 |
from utils.checkpoint import save_checkpoint, load_checkpoint
|
|
|
|
| 40 |
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
| 41 |
|
| 42 |
from model import CXRVisionLanguageModel
|
| 43 |
+
from model.rad_dino import BioViLTEncoder
|
| 44 |
from data import CXRInstructDataset, CXRDataCollator
|
| 45 |
from utils.logger import setup_logger
|
| 46 |
from utils.checkpoint import save_checkpoint, load_checkpoint
|