-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better Decoupling of HuggingFace Demo Tests
Signed-off-by: Rajeev Rao <rajeevrao@nvidia.com>
- Loading branch information
1 parent
44b451d
commit d868c4c
Showing
5 changed files
with
104 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# HF-OSS Demo changelog | ||
|
||
Uses [changelog conventions](https://keepachangelog.com/en/1.0.0/). | ||
Uses [semantic versioning](https://semver.org/). | ||
|
||
## Guiding Principles | ||
- Changelogs are for humans, not machines. | ||
- There should be an entry for every single version. | ||
- The same types of changes should be grouped. | ||
- Versions and sections should be linkable. | ||
- The latest version comes first. | ||
- The release date of each version is displayed. | ||
- Mention whether you follow Semantic Versioning. | ||
|
||
## Types of changes | ||
- `Added` for new features. | ||
- `Changed` for changes in existing functionality. | ||
- `Deprecated` for soon-to-be removed features. | ||
- `Removed` for now removed features. | ||
- `Fixed` for any bug fixes. | ||
- `Security` in case of vulnerabilities. | ||
|
||
# [1.1.0] - 2022-02-09 | ||
|
||
- Added `-o` or `--save-output-fpath` which saves a pickled version of the `NetworkResult` object. Useful for testing. | ||
|
||
# [1.0.0] - 2022 | ||
|
||
- Added initial working example of HF samples and notebooks. |
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,45 @@ | ||
""" | ||
Tests and verifies our interface objects | ||
""" | ||
|
||
# std | ||
import os | ||
import sys | ||
|
||
# pytest | ||
import pytest | ||
|
||
# Add library path | ||
TEST_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
sys.path.append(os.path.join(TEST_DIR, os.pardir)) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def inetwork(): | ||
import NNDF.networks as mod | ||
return mod | ||
|
||
|
||
def test_network_result(inetwork): | ||
# Test the API by explicit flags | ||
inetwork.NetworkResult( | ||
input="example", | ||
output_tensor=[], | ||
semantic_output="hello", | ||
median_runtime=9001, | ||
models=[], | ||
) | ||
|
||
|
||
def test_network_checkpoint_result(inetwork): | ||
inetwork.NetworkCheckpointResult(network_results=[], accuracy=9001.0) | ||
|
||
|
||
def test_precision(inetwork): | ||
inetwork.Precision(fp16=True) | ||
|
||
|
||
def test_network_metadata(inetwork): | ||
inetwork.NetworkMetadata( | ||
variant="gpt2", precision=inetwork.Precision(fp16=True), other=None | ||
) |