Upload reproduce.py with huggingface_hub
Browse files- reproduce.py +5 -1
reproduce.py
CHANGED
|
@@ -6,6 +6,7 @@ from __future__ import annotations
|
|
| 6 |
import argparse
|
| 7 |
import hashlib
|
| 8 |
import json
|
|
|
|
| 9 |
import subprocess
|
| 10 |
import sys
|
| 11 |
from pathlib import Path
|
|
@@ -54,7 +55,10 @@ def classify(model: TinyTriggerNet, rows: list[list[float]]) -> dict[str, object
|
|
| 54 |
|
| 55 |
|
| 56 |
def run_modelscan(path: Path) -> dict[str, object]:
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
| 58 |
if not modelscan_bin.exists():
|
| 59 |
modelscan_bin = Path(sys.executable).with_name("modelscan")
|
| 60 |
if not modelscan_bin.exists():
|
|
|
|
| 6 |
import argparse
|
| 7 |
import hashlib
|
| 8 |
import json
|
| 9 |
+
import os
|
| 10 |
import subprocess
|
| 11 |
import sys
|
| 12 |
from pathlib import Path
|
|
|
|
| 55 |
|
| 56 |
|
| 57 |
def run_modelscan(path: Path) -> dict[str, object]:
|
| 58 |
+
env_modelscan = os.environ.get("MODELSCAN_BIN")
|
| 59 |
+
modelscan_bin = Path(env_modelscan) if env_modelscan else None
|
| 60 |
+
if not modelscan_bin or not modelscan_bin.exists():
|
| 61 |
+
modelscan_bin = Path(__file__).resolve().parents[1] / ".venv-keras315/bin/modelscan"
|
| 62 |
if not modelscan_bin.exists():
|
| 63 |
modelscan_bin = Path(sys.executable).with_name("modelscan")
|
| 64 |
if not modelscan_bin.exists():
|