Spaces:
Runtime error
Runtime error
Run attacks continuously
Browse files- inference.py +26 -11
inference.py
CHANGED
|
@@ -16,17 +16,32 @@ time.sleep(2) # wait for server to start
|
|
| 16 |
|
| 17 |
print("[START] task=ai-deception env=cyber-security model=baseline")
|
| 18 |
|
| 19 |
-
easy_score = easy()
|
| 20 |
-
print(f"[STEP] step=1 action=easy reward={easy_score:.2f} done=false error=null")
|
| 21 |
-
|
| 22 |
-
medium_score = medium()
|
| 23 |
-
print(f"[STEP] step=2 action=medium reward={medium_score:.2f} done=false error=null")
|
| 24 |
-
|
| 25 |
-
hard_score = hard()
|
| 26 |
-
print(f"[STEP] step=3 action=hard reward={hard_score:.2f} done=true error=null")
|
| 27 |
-
|
| 28 |
-
print(f"[END] success=true steps=3 rewards={easy_score:.2f},{medium_score:.2f},{hard_score:.2f}")
|
| 29 |
-
print(f"[END] success=true steps=3 rewards={easy_score:.2f},{medium_score:.2f},{hard_score:.2f}")
|
| 30 |
|
|
|
|
| 31 |
while True:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
time.sleep(60)
|
|
|
|
|
|
| 16 |
|
| 17 |
print("[START] task=ai-deception env=cyber-security model=baseline")
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
# Run continuously for Hugging Face
|
| 21 |
while True:
|
| 22 |
+
|
| 23 |
+
# Easy Task
|
| 24 |
+
easy_score = easy()
|
| 25 |
+
print(
|
| 26 |
+
f"[STEP] step=1 action=easy reward={easy_score:.2f} done=false error=null"
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
# Medium Task
|
| 30 |
+
medium_score = medium()
|
| 31 |
+
print(
|
| 32 |
+
f"[STEP] step=2 action=medium reward={medium_score:.2f} done=false error=null"
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
# Hard Task
|
| 36 |
+
hard_score = hard()
|
| 37 |
+
print(
|
| 38 |
+
f"[STEP] step=3 action=hard reward={hard_score:.2f} done=true error=null"
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
print(
|
| 42 |
+
f"[END] success=true steps=3 rewards={easy_score:.2f},{medium_score:.2f},{hard_score:.2f}"
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
# Wait before next attack cycle
|
| 46 |
time.sleep(60)
|
| 47 |
+
|