Skip to content

Commit

Permalink
add possibility for clf_from_scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
markus583 committed Apr 14, 2024
1 parent 447f54d commit f97c280
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wtpsplit/evaluation/intrinsic_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Args:
do_strip: bool = False
tqdm: bool = False
skip_adaptation: bool = False
clf_from_scratch: bool = False


def process_logits_list(text, model, lang_code, block_size, stride, batch_size, verbose=True) -> List[np.ndarray]:
Expand Down Expand Up @@ -143,6 +144,8 @@ def load_or_compute_logits(args, model, eval_data, valid_data=None, save_str: st
dataset_load_name = dataset_name
try:
if args.adapter_path:
if args.clf_from_scratch:
model.model.classifier = torch.nn.Linear(model.model.classifier.in_features, 1)
model.model.load_adapter(
args.adapter_path + "/" + dataset_load_name + "/" + lang_code,
set_active=True,
Expand Down

0 comments on commit f97c280

Please sign in to comment.