mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-01 17:37:43 +00:00
fix(security): add logging to all except/pass blocks (B110)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
import logging
|
||||
"""
|
||||
Predix CLI - Wrapper for rdagent with LLM model selection.
|
||||
|
||||
@@ -49,7 +50,7 @@ def _ensure_kronos_factor_in_pool(con) -> None:
|
||||
if existing.get("ic") is not None:
|
||||
return
|
||||
except Exception:
|
||||
pass
|
||||
logging.debug("Exception caught", exc_info=True)
|
||||
|
||||
con.print("\n[bold yellow]Kronos Factor[/bold yellow] not in pool — generating automatically...")
|
||||
con.print(" [dim]stride=500 (~4500 windows), batch=32 — ~5-10 min on GPU[/dim]")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
"""
|
||||
FT UI Components - Hierarchical Event Renderers
|
||||
"""
|
||||
@@ -223,7 +224,7 @@ def render_scenario(content: Any) -> None:
|
||||
timeout_hours = content.real_full_timeout() / 60 / 60
|
||||
st.markdown(f"**Full Train Timeout:** {timeout_hours:.2f} hours")
|
||||
except Exception:
|
||||
pass
|
||||
logging.debug("Exception caught", exc_info=True)
|
||||
|
||||
# 4. Device info - formatted nicely
|
||||
if hasattr(content, "device_info") and content.device_info:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
"""
|
||||
RL Job Summary View
|
||||
Display summary table for all tasks in a job directory
|
||||
@@ -43,7 +44,7 @@ def get_loop_status(task_path: Path, loop_id: int) -> tuple[str, bool | None]:
|
||||
feedback_decision = decision
|
||||
break
|
||||
except Exception:
|
||||
pass
|
||||
logging.debug("Exception caught", exc_info=True)
|
||||
|
||||
if feedback_decision is not None:
|
||||
return ("OK" if feedback_decision else "X"), feedback_decision
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
|
||||
@@ -355,7 +355,7 @@ def evaluate_kronos_model(
|
||||
predicted_returns.append(pred_ret)
|
||||
actual_returns.append(actual_ret)
|
||||
except Exception:
|
||||
pass
|
||||
logging.debug("Exception caught", exc_info=True)
|
||||
|
||||
pred_arr = np.array(predicted_returns)
|
||||
actual_arr = np.array(actual_returns)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import math
|
||||
from typing import Any, Callable, Dict, Optional, Union
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import copy
|
||||
|
||||
import torch
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import inspect
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import math
|
||||
|
||||
import torch
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
import torch
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import math
|
||||
from typing import Optional, Tuple
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
"""
|
||||
This is just an exmaple.
|
||||
It will be replaced wtih a list of ground truth tasks.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
"""
|
||||
Daily-rotating log for all Predix commands.
|
||||
|
||||
@@ -103,7 +104,7 @@ def log_llm_call(
|
||||
try:
|
||||
entry["duration_ms"] = int((end_time - start_time).total_seconds() * 1000)
|
||||
except Exception:
|
||||
pass
|
||||
logging.debug("Exception caught", exc_info=True)
|
||||
line = _json.dumps(entry, ensure_ascii=False)
|
||||
out_path = _today_dir() / "llm_calls.jsonl"
|
||||
with _llm_log_lock:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import json
|
||||
import os
|
||||
import pickle # nosec B301
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
import json
|
||||
from typing import Dict, List
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
"""
|
||||
GRPO Training Loop
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user