tensorflow / swift-models

Models and examples built with Swift for TensorFlow
Apache License 2.0
646 stars 146 forks source link

Repairing two text-based tests on macOS #716

Closed BradLarson closed 3 years ago

BradLarson commented 3 years ago

The testCreateWikiText103WithoutBpe test will always fail a precondition because it sets bpe to nil, while encodedFileName is also nil for that dataset. This test case is not active on Linux, but will run on macOS, where it crashes tests. As a result, I've removed this test case.

Additionally, the WordSegDataset used a hardcoded path to /dev/null when no filename is specified for two components. Direct access to /dev/null is blocked on macOS, and is problematic for Windows. I've replaced this with creation of an empty Data instance if the file name is missing.

With these changes, all tests now pass on macOS.