Spaces:
Build error
Build error
fix: audit fixes - aegis_env/curriculum.py
Browse files- aegis_env/curriculum.py +7 -4
aegis_env/curriculum.py
CHANGED
|
@@ -7,7 +7,10 @@ import json
|
|
| 7 |
import random
|
| 8 |
from typing import Dict, Any, Optional
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
MAX_TOKENS = 300 # Layer-3: token cap (~300 words)
|
| 13 |
|
|
@@ -85,9 +88,9 @@ class ScenarioLoader:
|
|
| 85 |
self._step_counter += 1
|
| 86 |
scenario = pool[idx]
|
| 87 |
|
| 88 |
-
if level >= 3:
|
| 89 |
-
return
|
| 90 |
-
|
| 91 |
return scenario
|
| 92 |
|
| 93 |
def reset_counter(self) -> None:
|
|
|
|
| 7 |
import random
|
| 8 |
from typing import Dict, Any, Optional
|
| 9 |
|
| 10 |
+
try:
|
| 11 |
+
from scripts.adversarial_generator import AdversarialGenerator as _AdversarialGenerator
|
| 12 |
+
except ImportError:
|
| 13 |
+
_AdversarialGenerator = None
|
| 14 |
|
| 15 |
MAX_TOKENS = 300 # Layer-3: token cap (~300 words)
|
| 16 |
|
|
|
|
| 88 |
self._step_counter += 1
|
| 89 |
scenario = pool[idx]
|
| 90 |
|
| 91 |
+
if level >= 3 and _AdversarialGenerator is not None:
|
| 92 |
+
return _AdversarialGenerator.generate(scenario, seed=self.seed + self._step_counter)
|
| 93 |
+
|
| 94 |
return scenario
|
| 95 |
|
| 96 |
def reset_counter(self) -> None:
|