Skip to content

Commit

Permalink
Closes #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
negar-foroutan authored Apr 1, 2024
1 parent e5633b6 commit 1e39409
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions LT_ner.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from torch.utils.data.distributed import DistributedSampler
from tqdm import tqdm, trange

from helpers.pruning_utils import rewind, pruning_model, see_weight_rate, component_wise_pruning_model
from helpers.pruning_utils import rewind, pruning_model, see_weight_rate
from helpers.utils import set_seed
from datasets import ClassLabel, load_dataset, load_metric

Expand Down Expand Up @@ -405,10 +405,7 @@ def train(args, train_dataset, eval_dataset, model, data_collator, compute_metri

logger.info('starting pruning')
logger.info('saving model for ', 100-pruning_step*10)
if args.pruning_method == "component_wise":
component_wise_pruning_model(model, 1/(10-pruning_step))
else:
pruning_model(model, 1/(10-pruning_step))
pruning_model(model, 1/(10-pruning_step))
rate_weight_equal_zero = see_weight_rate(model)
pruning_step += 1
logger.info('zero_rate = ', rate_weight_equal_zero)
Expand Down

0 comments on commit 1e39409

Please sign in to comment.