test descriptions
This commit is contained in:
@@ -34,6 +34,7 @@ def _write_snapshot(tmp_path, *, config=None):
|
||||
|
||||
|
||||
def test_selects_only_weight_shards_for_middle_layer_range(tmp_path):
|
||||
"Selects only weight shards for middle layer range\n\nTags: general"
|
||||
_write_snapshot(tmp_path)
|
||||
|
||||
files = select_safetensors_files_for_layers(tmp_path, 2, 3)
|
||||
@@ -49,6 +50,7 @@ def test_selects_only_weight_shards_for_middle_layer_range(tmp_path):
|
||||
|
||||
|
||||
def test_head_range_includes_embeddings(tmp_path):
|
||||
"Head range includes embeddings\n\nTags: general"
|
||||
_write_snapshot(tmp_path)
|
||||
|
||||
files = select_safetensors_files_for_layers(tmp_path, 0, 0)
|
||||
@@ -58,6 +60,7 @@ def test_head_range_includes_embeddings(tmp_path):
|
||||
|
||||
|
||||
def test_tail_range_includes_norm_and_lm_head_from_inferred_layer_count(tmp_path):
|
||||
"Tail range includes norm and lm head from inferred layer count\n\nTags: general"
|
||||
_write_snapshot(tmp_path, config={"text_config": {"num_hidden_layers": 5}})
|
||||
|
||||
files = select_safetensors_files_for_layers(tmp_path, 4, 4)
|
||||
@@ -68,6 +71,7 @@ def test_tail_range_includes_norm_and_lm_head_from_inferred_layer_count(tmp_path
|
||||
|
||||
|
||||
def test_tail_files_are_not_selected_without_total_layer_count(tmp_path):
|
||||
"Tail files are not selected without total layer count\n\nTags: general"
|
||||
_write_snapshot(tmp_path, config={"architectures": ["UnknownForTest"]})
|
||||
|
||||
files = select_safetensors_files_for_layers(tmp_path, 4, 4)
|
||||
@@ -77,6 +81,7 @@ def test_tail_files_are_not_selected_without_total_layer_count(tmp_path):
|
||||
|
||||
|
||||
def test_rejects_unsafe_weight_map_paths(tmp_path):
|
||||
"Rejects unsafe weight map paths\n\nTags: general"
|
||||
(tmp_path / "model.safetensors.index.json").write_text(
|
||||
json.dumps({"weight_map": {"model.layers.0.weight": "../escape.safetensors"}}),
|
||||
encoding="utf-8",
|
||||
|
||||
Reference in New Issue
Block a user