Skip to content

Commit

Permalink
update reqs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Sordoni committed Nov 12, 2024
1 parent 706494d commit 895b1cb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions mttl/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,7 @@ def __post_init__(self):
self.train_batch_size = self.micro_batch_size

if self.finetune_task_path is not None:
if (
not os.path.exists(self.finetune_task_path)
and self.finetune_task_name is None
):
if not os.path.exists(self.finetune_task_path):
raise ValueError(f"Task path {self.finetune_task_path} does not exist!")

# resolve task keys
Expand Down
4 changes: 3 additions & 1 deletion mttl/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def model_loader_helper(
logger.info(f"Loading phi-2 model from {os.environ['PHI_PATH']}")
else:
model_object = None
exception = None
for klass in [AutoModelForCausalLM, AutoModelForSeq2SeqLM]:
try:
model_object = klass.from_pretrained(
Expand All @@ -159,9 +160,10 @@ def model_loader_helper(
)
break
except Exception as e:
exception = e
continue
if model_object is None:
raise ValueError(f"Couldn't load {model_name}! Exception: {e}")
raise ValueError(f"Couldn't load {model_name}! Exception: {exception}")

if bnb_config is not None:
model_object = prepare_model_for_kbit_training(model_object)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
transformers>=4.42.0
transformers>=4.44.2
torch>=2.3.1
datasets>=2.20.0
pytorch-lightning>=2.3.3
Expand Down

0 comments on commit 895b1cb

Please sign in to comment.