Publish Tiny Hinglish Turn Detector development preview
Browse filesrelease inventory sha256: 6ea0e0072d85325f2df1f3bc61b4cfe8c21698e95767ec2d519c20cd4a537b86
- export_manifest.json +5 -5
- release_provenance.json +12 -12
- scripts/build_release.py +21 -2
- space/requirements.txt +1 -0
- tests/test_release_guardrails.py +13 -3
export_manifest.json
CHANGED
|
@@ -126,9 +126,9 @@
|
|
| 126 |
"sha256": "146763ebbe4d4ca0858c3fda2f56aa235aa9a4b6686b3216bcea58d148945d04"
|
| 127 |
},
|
| 128 |
{
|
| 129 |
-
"bytes":
|
| 130 |
"path": "scripts/build_release.py",
|
| 131 |
-
"sha256": "
|
| 132 |
},
|
| 133 |
{
|
| 134 |
"bytes": 10147,
|
|
@@ -196,9 +196,9 @@
|
|
| 196 |
"sha256": "40569f1e553f0cb340cf81414e072839ca734a7d303c5cb5f1e46c5035590804"
|
| 197 |
},
|
| 198 |
{
|
| 199 |
-
"bytes":
|
| 200 |
"path": "space/requirements.txt",
|
| 201 |
-
"sha256": "
|
| 202 |
},
|
| 203 |
{
|
| 204 |
"bytes": 160,
|
|
@@ -371,7 +371,7 @@
|
|
| 371 |
"sha256": "da0eac829fe43615f7bb149998c2f2762f148790fb0c14d4ba6db4d6b25298f4"
|
| 372 |
}
|
| 373 |
],
|
| 374 |
-
"source_inventory_sha256": "
|
| 375 |
"task": "audio-turn-end-detection",
|
| 376 |
"threshold": 0.741000771522522,
|
| 377 |
"training_data": {
|
|
|
|
| 126 |
"sha256": "146763ebbe4d4ca0858c3fda2f56aa235aa9a4b6686b3216bcea58d148945d04"
|
| 127 |
},
|
| 128 |
{
|
| 129 |
+
"bytes": 40974,
|
| 130 |
"path": "scripts/build_release.py",
|
| 131 |
+
"sha256": "f4bb9e1c5cbde4514fabeeed354fb2fcb7374c3b6abe1245a3f61f6aceb2a2c4"
|
| 132 |
},
|
| 133 |
{
|
| 134 |
"bytes": 10147,
|
|
|
|
| 196 |
"sha256": "40569f1e553f0cb340cf81414e072839ca734a7d303c5cb5f1e46c5035590804"
|
| 197 |
},
|
| 198 |
{
|
| 199 |
+
"bytes": 114,
|
| 200 |
"path": "space/requirements.txt",
|
| 201 |
+
"sha256": "3e359db5a7fb0103c3cbb504cb45e195d1ea7c2bcef513b5b3a5b13132d6a69e"
|
| 202 |
},
|
| 203 |
{
|
| 204 |
"bytes": 160,
|
|
|
|
| 371 |
"sha256": "da0eac829fe43615f7bb149998c2f2762f148790fb0c14d4ba6db4d6b25298f4"
|
| 372 |
}
|
| 373 |
],
|
| 374 |
+
"source_inventory_sha256": "231b988fbe808c67d53f9c51577b9286006937764a343077b4dc8598daf37528",
|
| 375 |
"task": "audio-turn-end-detection",
|
| 376 |
"threshold": 0.741000771522522,
|
| 377 |
"training_data": {
|
release_provenance.json
CHANGED
|
@@ -107,8 +107,8 @@
|
|
| 107 |
"sha256": "d57a8b0b7e11eebce8b76812548d7e12bcc63c5880ef01633fef4914c8633b02"
|
| 108 |
},
|
| 109 |
"export_manifest.json": {
|
| 110 |
-
"bytes":
|
| 111 |
-
"sha256": "
|
| 112 |
},
|
| 113 |
"model.onnx": {
|
| 114 |
"bytes": 625431,
|
|
@@ -247,8 +247,8 @@
|
|
| 247 |
"sha256": "146763ebbe4d4ca0858c3fda2f56aa235aa9a4b6686b3216bcea58d148945d04"
|
| 248 |
},
|
| 249 |
"scripts/build_release.py": {
|
| 250 |
-
"bytes":
|
| 251 |
-
"sha256": "
|
| 252 |
},
|
| 253 |
"scripts/compare_models.py": {
|
| 254 |
"bytes": 10147,
|
|
@@ -303,8 +303,8 @@
|
|
| 303 |
"sha256": "40569f1e553f0cb340cf81414e072839ca734a7d303c5cb5f1e46c5035590804"
|
| 304 |
},
|
| 305 |
"space/requirements.txt": {
|
| 306 |
-
"bytes":
|
| 307 |
-
"sha256": "
|
| 308 |
},
|
| 309 |
"src/turn_detection/__init__.py": {
|
| 310 |
"bytes": 160,
|
|
@@ -531,8 +531,8 @@
|
|
| 531 |
"sha256": "5af81ad7995b6bfd3816b7d97ee1226027659dc5b8a7cb4fe4376fa850dcd14e"
|
| 532 |
},
|
| 533 |
"tests/test_release_guardrails.py": {
|
| 534 |
-
"bytes":
|
| 535 |
-
"sha256": "
|
| 536 |
},
|
| 537 |
"tests/test_runtime_controller.py": {
|
| 538 |
"bytes": 3086,
|
|
@@ -574,7 +574,7 @@
|
|
| 574 |
},
|
| 575 |
"README.md": {
|
| 576 |
"bytes": 1337,
|
| 577 |
-
"sha256": "
|
| 578 |
},
|
| 579 |
"app.py": {
|
| 580 |
"bytes": 10381,
|
|
@@ -589,8 +589,8 @@
|
|
| 589 |
"sha256": "43636ad5efb642138c281a4582e85f19b5aae2f4f6cca69211169341ae4399b4"
|
| 590 |
},
|
| 591 |
"requirements.txt": {
|
| 592 |
-
"bytes":
|
| 593 |
-
"sha256": "
|
| 594 |
},
|
| 595 |
"src/turn_detection/__init__.py": {
|
| 596 |
"bytes": 160,
|
|
@@ -626,5 +626,5 @@
|
|
| 626 |
"metrics_file": "development_metrics.json",
|
| 627 |
"metrics_scope": "development",
|
| 628 |
"model_file": "model.onnx",
|
| 629 |
-
"source_and_artifact_inventory_sha256": "
|
| 630 |
}
|
|
|
|
| 107 |
"sha256": "d57a8b0b7e11eebce8b76812548d7e12bcc63c5880ef01633fef4914c8633b02"
|
| 108 |
},
|
| 109 |
"export_manifest.json": {
|
| 110 |
+
"bytes": 12431,
|
| 111 |
+
"sha256": "92bc97c3913e8478dacad988285232c2c678ba906a67697e5a022d3e48a1a2c7"
|
| 112 |
},
|
| 113 |
"model.onnx": {
|
| 114 |
"bytes": 625431,
|
|
|
|
| 247 |
"sha256": "146763ebbe4d4ca0858c3fda2f56aa235aa9a4b6686b3216bcea58d148945d04"
|
| 248 |
},
|
| 249 |
"scripts/build_release.py": {
|
| 250 |
+
"bytes": 40974,
|
| 251 |
+
"sha256": "f4bb9e1c5cbde4514fabeeed354fb2fcb7374c3b6abe1245a3f61f6aceb2a2c4"
|
| 252 |
},
|
| 253 |
"scripts/compare_models.py": {
|
| 254 |
"bytes": 10147,
|
|
|
|
| 303 |
"sha256": "40569f1e553f0cb340cf81414e072839ca734a7d303c5cb5f1e46c5035590804"
|
| 304 |
},
|
| 305 |
"space/requirements.txt": {
|
| 306 |
+
"bytes": 114,
|
| 307 |
+
"sha256": "3e359db5a7fb0103c3cbb504cb45e195d1ea7c2bcef513b5b3a5b13132d6a69e"
|
| 308 |
},
|
| 309 |
"src/turn_detection/__init__.py": {
|
| 310 |
"bytes": 160,
|
|
|
|
| 531 |
"sha256": "5af81ad7995b6bfd3816b7d97ee1226027659dc5b8a7cb4fe4376fa850dcd14e"
|
| 532 |
},
|
| 533 |
"tests/test_release_guardrails.py": {
|
| 534 |
+
"bytes": 19180,
|
| 535 |
+
"sha256": "452361358e93e92465f70d05bc0232bce195292a1b70bf73ce150810c7c53674"
|
| 536 |
},
|
| 537 |
"tests/test_runtime_controller.py": {
|
| 538 |
"bytes": 3086,
|
|
|
|
| 574 |
},
|
| 575 |
"README.md": {
|
| 576 |
"bytes": 1337,
|
| 577 |
+
"sha256": "a604dbde1c5d837eea5a4a924747df34c0d3af653a8c2e7a5703a9816898ca3f"
|
| 578 |
},
|
| 579 |
"app.py": {
|
| 580 |
"bytes": 10381,
|
|
|
|
| 589 |
"sha256": "43636ad5efb642138c281a4582e85f19b5aae2f4f6cca69211169341ae4399b4"
|
| 590 |
},
|
| 591 |
"requirements.txt": {
|
| 592 |
+
"bytes": 114,
|
| 593 |
+
"sha256": "3e359db5a7fb0103c3cbb504cb45e195d1ea7c2bcef513b5b3a5b13132d6a69e"
|
| 594 |
},
|
| 595 |
"src/turn_detection/__init__.py": {
|
| 596 |
"bytes": 160,
|
|
|
|
| 626 |
"metrics_file": "development_metrics.json",
|
| 627 |
"metrics_scope": "development",
|
| 628 |
"model_file": "model.onnx",
|
| 629 |
+
"source_and_artifact_inventory_sha256": "f8365e3e5c27cb371be1dd2d701b0f9abc125da008b7d9b310dbcc1d3bae8f4d"
|
| 630 |
}
|
scripts/build_release.py
CHANGED
|
@@ -23,6 +23,9 @@ _SPACE_CARD_COLORS = frozenset(
|
|
| 23 |
{"red", "yellow", "green", "blue", "indigo", "purple", "pink", "gray"}
|
| 24 |
)
|
| 25 |
_SPACE_SHORT_DESCRIPTION_MAX_LENGTH = 60
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
def parse_args() -> argparse.Namespace:
|
|
@@ -104,8 +107,8 @@ def _validate_space_card(path: Path) -> None:
|
|
| 104 |
raise SystemExit("Space README sdk must be 'gradio'")
|
| 105 |
if metadata.get("app_file") != "app.py":
|
| 106 |
raise SystemExit("Space README app_file must be 'app.py'")
|
| 107 |
-
if metadata.get("python_version") != "3.
|
| 108 |
-
raise SystemExit("Space README python_version must
|
| 109 |
for field in ("colorFrom", "colorTo"):
|
| 110 |
color = metadata.get(field)
|
| 111 |
if color not in _SPACE_CARD_COLORS:
|
|
@@ -121,6 +124,21 @@ def _validate_space_card(path: Path) -> None:
|
|
| 121 |
)
|
| 122 |
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
def _copy_runtime(destination: Path) -> None:
|
| 125 |
package_root = destination / "src" / "turn_detection"
|
| 126 |
package_root.mkdir(parents=True, exist_ok=True)
|
|
@@ -755,6 +773,7 @@ def main() -> int:
|
|
| 755 |
metadata.get("controller"),
|
| 756 |
)
|
| 757 |
_validate_space_card(ROOT / "space" / "README.md")
|
|
|
|
| 758 |
|
| 759 |
frozen_manifest: dict | None = None
|
| 760 |
if not metadata_is_development:
|
|
|
|
| 23 |
{"red", "yellow", "green", "blue", "indigo", "purple", "pink", "gray"}
|
| 24 |
)
|
| 25 |
_SPACE_SHORT_DESCRIPTION_MAX_LENGTH = 60
|
| 26 |
+
_SPACE_RUNTIME_REQUIREMENTS = frozenset(
|
| 27 |
+
{"numpy==2.3.5", "onnxruntime==1.26.0", "soundfile==0.14.0"}
|
| 28 |
+
)
|
| 29 |
|
| 30 |
|
| 31 |
def parse_args() -> argparse.Namespace:
|
|
|
|
| 107 |
raise SystemExit("Space README sdk must be 'gradio'")
|
| 108 |
if metadata.get("app_file") != "app.py":
|
| 109 |
raise SystemExit("Space README app_file must be 'app.py'")
|
| 110 |
+
if metadata.get("python_version") != "3.12":
|
| 111 |
+
raise SystemExit("Space README python_version must match the ZeroGPU Python 3.12 runtime")
|
| 112 |
for field in ("colorFrom", "colorTo"):
|
| 113 |
color = metadata.get(field)
|
| 114 |
if color not in _SPACE_CARD_COLORS:
|
|
|
|
| 124 |
)
|
| 125 |
|
| 126 |
|
| 127 |
+
def _validate_space_requirements(path: Path) -> None:
|
| 128 |
+
try:
|
| 129 |
+
requirements = frozenset(
|
| 130 |
+
line.strip()
|
| 131 |
+
for line in path.read_text(encoding="utf-8").splitlines()
|
| 132 |
+
if line.strip() and not line.lstrip().startswith("#")
|
| 133 |
+
)
|
| 134 |
+
except OSError as exc:
|
| 135 |
+
raise SystemExit(f"Space requirements are unreadable: {path}") from exc
|
| 136 |
+
if requirements != _SPACE_RUNTIME_REQUIREMENTS:
|
| 137 |
+
raise SystemExit(
|
| 138 |
+
"Space requirements must use the reviewed CPython-3.12-compatible runtime pins"
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
|
| 142 |
def _copy_runtime(destination: Path) -> None:
|
| 143 |
package_root = destination / "src" / "turn_detection"
|
| 144 |
package_root.mkdir(parents=True, exist_ok=True)
|
|
|
|
| 773 |
metadata.get("controller"),
|
| 774 |
)
|
| 775 |
_validate_space_card(ROOT / "space" / "README.md")
|
| 776 |
+
_validate_space_requirements(ROOT / "space" / "requirements.txt")
|
| 777 |
|
| 778 |
frozen_manifest: dict | None = None
|
| 779 |
if not metadata_is_development:
|
space/requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
numpy==2.3.5
|
| 2 |
onnxruntime==1.26.0
|
| 3 |
soundfile==0.14.0
|
|
|
|
| 1 |
+
# Hugging Face ZeroGPU supports this CPython 3.12 runtime set.
|
| 2 |
numpy==2.3.5
|
| 3 |
onnxruntime==1.26.0
|
| 4 |
soundfile==0.14.0
|
tests/test_release_guardrails.py
CHANGED
|
@@ -86,14 +86,14 @@ class ReleaseGuardrailTest(unittest.TestCase):
|
|
| 86 |
self.assertFalse((destination / "old.txt").exists())
|
| 87 |
|
| 88 |
def test_space_card_rejects_server_invalid_frontmatter(self) -> None:
|
| 89 |
-
from scripts.build_release import _validate_space_card
|
| 90 |
|
| 91 |
valid = """---
|
| 92 |
title: Test Space
|
| 93 |
colorFrom: yellow
|
| 94 |
colorTo: indigo
|
| 95 |
sdk: gradio
|
| 96 |
-
python_version: "3.
|
| 97 |
app_file: app.py
|
| 98 |
short_description: Tiny endpoint detector
|
| 99 |
---
|
|
@@ -117,10 +117,20 @@ short_description: Tiny endpoint detector
|
|
| 117 |
with self.assertRaisesRegex(SystemExit, "at most 60"):
|
| 118 |
_validate_space_card(card)
|
| 119 |
|
| 120 |
-
card.write_text(valid.replace('python_version: "3.
|
| 121 |
with self.assertRaisesRegex(SystemExit, "python_version"):
|
| 122 |
_validate_space_card(card)
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
def test_synthetic_replay_must_be_labelled_and_hash_bound(self) -> None:
|
| 125 |
from scripts.build_release import _validate_synthetic_replay
|
| 126 |
|
|
|
|
| 86 |
self.assertFalse((destination / "old.txt").exists())
|
| 87 |
|
| 88 |
def test_space_card_rejects_server_invalid_frontmatter(self) -> None:
|
| 89 |
+
from scripts.build_release import _validate_space_card, _validate_space_requirements
|
| 90 |
|
| 91 |
valid = """---
|
| 92 |
title: Test Space
|
| 93 |
colorFrom: yellow
|
| 94 |
colorTo: indigo
|
| 95 |
sdk: gradio
|
| 96 |
+
python_version: "3.12"
|
| 97 |
app_file: app.py
|
| 98 |
short_description: Tiny endpoint detector
|
| 99 |
---
|
|
|
|
| 117 |
with self.assertRaisesRegex(SystemExit, "at most 60"):
|
| 118 |
_validate_space_card(card)
|
| 119 |
|
| 120 |
+
card.write_text(valid.replace('python_version: "3.12"\n', ""), encoding="utf-8")
|
| 121 |
with self.assertRaisesRegex(SystemExit, "python_version"):
|
| 122 |
_validate_space_card(card)
|
| 123 |
|
| 124 |
+
requirements = Path(directory) / "requirements.txt"
|
| 125 |
+
requirements.write_text(
|
| 126 |
+
"# ZeroGPU CPython 3.12\nnumpy==2.3.5\nonnxruntime==1.26.0\nsoundfile==0.14.0\n",
|
| 127 |
+
encoding="utf-8",
|
| 128 |
+
)
|
| 129 |
+
_validate_space_requirements(requirements)
|
| 130 |
+
requirements.write_text("numpy==2.2.6\n", encoding="utf-8")
|
| 131 |
+
with self.assertRaisesRegex(SystemExit, "CPython-3.12-compatible"):
|
| 132 |
+
_validate_space_requirements(requirements)
|
| 133 |
+
|
| 134 |
def test_synthetic_replay_must_be_labelled_and_hash_bound(self) -> None:
|
| 135 |
from scripts.build_release import _validate_synthetic_replay
|
| 136 |
|