Download code/run_unit_checks.py from laion/tyger-speaker-predictor: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/laion/tyger-speaker-predictor/resolve/main/code/run_unit_checks.py
- Command line
-
hf download hf://laion/tyger-speaker-predictor/code/run_unit_checks.py
-
curl -L -o run_unit_checks.py https://huggingface.co/laion/tyger-speaker-predictor/resolve/main/code/run_unit_checks.py
1.08 kB
| """Offline unit contracts, with machine-readable results for the English report.""" | |
| import json,time,unittest | |
| from pathlib import Path | |
| MODULES=['test_audio_input','test_shared_turn','test_speaker_names','test_speaker_session','test_speaker_turns', | |
| 'test_identity','test_speaker_teacher','test_bridge','test_performance', | |
| 'speaker_v2.test_predictor','speaker_v4.test_v4','speaker_v5.test_v5','speaker_live.test_playback'] | |
| def main(): | |
| suite=unittest.defaultTestLoader.loadTestsFromNames(MODULES) | |
| result=unittest.TextTestRunner(verbosity=1).run(suite) | |
| report={'finished':time.time(),'modules':MODULES,'tests':result.testsRun,'failures':len(result.failures), | |
| 'errors':len(result.errors),'skipped':len(result.skipped),'passed':result.wasSuccessful(), | |
| 'network_or_physical_microphone_used':False} | |
| path=Path(__file__).parent/'logs/unit-checks.json';path.parent.mkdir(exist_ok=True) | |
| path.write_text(json.dumps(report,indent=2));print(json.dumps(report)) | |
| if not result.wasSuccessful():raise SystemExit(1) | |
| if __name__=='__main__':main() | |