-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow strong preferences from pick_device using a string; release fid…
…dles (#85) * pick_device allows strong preferences now * Fixing deprecation * using python 3.9 and above --------- Co-authored-by: Will Dumm <wrhdumm@gmail.com>
- Loading branch information
Showing
9 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import netam.pretrained as pretrained | ||
from pathlib import Path | ||
import shutil | ||
|
||
|
||
def test_names_unique(): | ||
# Check all defined models can be loaded and they have unique names | ||
assert len(set(pretrained.MODEL_TO_LOCAL.keys())) == sum( | ||
len(models) for _, _, _, models in pretrained.PACKAGE_LOCATIONS_AND_CONTENTS | ||
) | ||
|
||
|
||
def test_load_all_models(): | ||
# Remove cached models: | ||
shutil.rmtree(Path(pretrained.PRETRAINED_DIR)) | ||
# Check each can be loaded without caching | ||
for model_name in pretrained.MODEL_TO_LOCAL: | ||
pretrained.load(model_name) | ||
|
||
# Check each can be loaded with caching | ||
for model_name in pretrained.MODEL_TO_LOCAL: | ||
pretrained.load(model_name) |