Skip to content

Commit

Permalink
utils!
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Sordoni committed Nov 12, 2024
1 parent 0ec0b1e commit bc14f13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mttl/models/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ def model_loader_helper(
torch_dtype=torch_dtype,
)
break
except:
except Exception as e:
continue
if model_object is None:
raise ValueError(f"Couldn't load {model_name}!")
raise ValueError(f"Couldn't load {model_name}! Exception: {e}")

if bnb_config is not None:
model_object = prepare_model_for_kbit_training(model_object)
Expand Down
7 changes: 2 additions & 5 deletions tests/test_library_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,13 @@ def patch_expert_weights(expert, offset=0):


def test_phatgoose(tiny_flan, tmp_path, create_dummy_expert, monkeypatch):
# disable wandb
monkeypatch.setenv("WANDB_MODE", "disabled")

dataset, dataset_id = tiny_flan

config = ExpertConfig(
**{
"model_modifier": "lora",
"lora_rank": 32,
"lora_alpha": 16,
"lora_rank": 4,
"lora_alpha": 1,
"warmup_steps": 0,
"modify_layers": "k_proj|v_proj|q_proj|o_proj",
"trainable_param_names": ".*lora_[ab].*",
Expand Down

0 comments on commit bc14f13

Please sign in to comment.