Skip to content

Commit d0abbf3

Browse files
authored
[Cherry Pick 1.5.4] Fix Index error with nm-transformers 1.5.1 upgrade (#1708)
* Fix Index error with 1.5.1 transformers upgrade * Deafult resolve_archive_file to None instead of empty list * Update Hotfix version * Remove failing tensorflow_v1 tests; they are outdated and not supported now
1 parent c3eda9a commit d0abbf3

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

.github/workflows/test-check.yaml

-24
Original file line numberDiff line numberDiff line change
@@ -160,30 +160,6 @@ jobs:
160160
run: pip3 install .[dev,torchvision,onnxruntime]
161161
- name: "🔬 Running pytorch tests"
162162
run: make test TARGETS=pytorch
163-
tensorflow-v1-tests:
164-
runs-on: ubuntu-22.04
165-
env:
166-
SPARSEZOO_TEST_MODE: "true"
167-
needs: test-setup
168-
if: ${{needs.test-setup.outputs.tensorflow_v1 == 1}}
169-
steps:
170-
- uses: actions/setup-python@v4
171-
with:
172-
python-version: '3.7'
173-
- uses: actions/checkout@v2
174-
- uses: actions/checkout@v2
175-
with:
176-
repository: "neuralmagic/sparsezoo"
177-
path: "sparsezoo"
178-
ref: ${{needs.test-setup.outputs.branch}}
179-
- name: "⚙️ Install sparsezoo dependencies"
180-
run: pip3 install -U pip && pip3 install setuptools sparsezoo/
181-
- name: "Clean sparsezoo directory"
182-
run: rm -r sparsezoo/
183-
- name: "⚙️ Install dependencies"
184-
run: pip3 install .[dev,tf_v1,onnxruntime]
185-
- name: "🔬 Running tensorflow_v1 tests"
186-
run: make test TARGETS=tensorflow_v1
187163
compat-pytorch-1_9-pytorch-tests:
188164
runs-on: ubuntu-22.04
189165
env:

src/sparseml/transformers/sparsification/trainer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -673,11 +673,11 @@ def _reload_model_state(self, load_path: str, orig_state_dict: Dict[str, Any]):
673673
loaded_state_dict = torch.load(
674674
os.path.join(load_path, WEIGHTS_NAME), map_location="cpu"
675675
)
676-
_, missing, unexpected, _, _ = self.model._load_pretrained_model(
676+
_, missing, unexpected, _, _, _ = self.model._load_pretrained_model(
677677
model=self.model,
678678
state_dict=loaded_state_dict,
679679
loaded_keys=list(loaded_state_dict.keys()),
680-
resolved_archive_file=[],
680+
resolved_archive_file=None,
681681
pretrained_model_name_or_path=load_path,
682682
_fast_init=False,
683683
)

src/sparseml/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from datetime import date
2020

2121

22-
version_base = "1.5.3"
22+
version_base = "1.5.4"
2323
is_release = False # change to True to set the generated version as a release version
2424

2525

0 commit comments

Comments
 (0)