soumi guria commited on
Commit ·
472e56f
1
Parent(s): 42b5c37
updated according to requirements
Browse files- inference.py +106 -254
- requirements.txt +327 -327
inference.py
CHANGED
|
@@ -1,321 +1,175 @@
|
|
| 1 |
-
# import os
|
| 2 |
-
# import json
|
| 3 |
-
# import urllib.request
|
| 4 |
-
# import urllib.error
|
| 5 |
-
# from typing import List, Optional
|
| 6 |
-
|
| 7 |
-
# try:
|
| 8 |
-
# from dotenv import load_dotenv
|
| 9 |
-
# load_dotenv()
|
| 10 |
-
# except ImportError:
|
| 11 |
-
# pass
|
| 12 |
-
|
| 13 |
-
# # /// script
|
| 14 |
-
# # requires-python = ">=3.11"
|
| 15 |
-
# # dependencies = [
|
| 16 |
-
# # "openai",
|
| 17 |
-
# # ]
|
| 18 |
-
# # ///
|
| 19 |
-
|
| 20 |
-
# from openai import OpenAI
|
| 21 |
-
|
| 22 |
-
# def post_json(url: str, payload: dict) -> dict:
|
| 23 |
-
# data = json.dumps(payload).encode("utf-8")
|
| 24 |
-
# req = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"})
|
| 25 |
-
# try:
|
| 26 |
-
# with urllib.request.urlopen(req) as res:
|
| 27 |
-
# return json.loads(res.read().decode("utf-8"))
|
| 28 |
-
# except urllib.error.HTTPError as e:
|
| 29 |
-
# raise Exception(f"HTTP Error {e.code}: {e.read().decode('utf-8')}")
|
| 30 |
-
|
| 31 |
-
# # ── Environment variables ────────────────────────────────────────────────────
|
| 32 |
-
# # API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
|
| 33 |
-
# # HF_TOKEN = os.getenv("HF_TOKEN")
|
| 34 |
-
|
| 35 |
-
# # API_KEY = HF_TOKEN or os.getenv("API_KEY")
|
| 36 |
-
# # if not API_KEY:
|
| 37 |
-
# # raise ValueError("API_KEY environment variable is required")
|
| 38 |
-
|
| 39 |
-
# API_BASE_URL = os.environ.get("API_BASE_URL")
|
| 40 |
-
# API_KEY = os.environ.get("API_KEY")
|
| 41 |
-
# MODEL_NAME = os.environ.get("MODEL_NAME")
|
| 42 |
-
# ENV_BASE_URL = os.environ.get("ENV_BASE_URL", "http://localhost:7860")
|
| 43 |
-
|
| 44 |
-
# if not API_BASE_URL:
|
| 45 |
-
# raise ValueError("API_BASE_URL must be set")
|
| 46 |
-
|
| 47 |
-
# if not API_KEY:
|
| 48 |
-
# raise ValueError("API_KEY must be set")
|
| 49 |
-
|
| 50 |
-
# MODEL_NAME = os.getenv("MODEL_NAME", "Qwen/Qwen2.5-72B-Instruct")
|
| 51 |
-
# ENV_BASE_URL = os.getenv("ENV_BASE_URL", "http://localhost:7860")
|
| 52 |
-
|
| 53 |
-
# TASK_NAME = "schedule-optimization"
|
| 54 |
-
# BENCHMARK = "cognitive-load-manager"
|
| 55 |
-
# SUCCESS_SCORE_THRESHOLD = 0.5
|
| 56 |
-
# MAX_STEPS = 50
|
| 57 |
-
|
| 58 |
-
# def log_start(task: str, env: str, model: str) -> None:
|
| 59 |
-
# print(f"[START] task={task} env={env} model={model}", flush=True)
|
| 60 |
-
|
| 61 |
-
# def log_step(step: int, action: str, reward: float, done: bool, error: Optional[str]) -> None:
|
| 62 |
-
# error_val = error if error else "null"
|
| 63 |
-
# done_val = str(done).lower()
|
| 64 |
-
# print(
|
| 65 |
-
# f"[STEP] step={step} action={action} reward={reward:.2f} done={done_val} error={error_val}",
|
| 66 |
-
# flush=True,
|
| 67 |
-
# )
|
| 68 |
-
|
| 69 |
-
# def log_end(success: bool, steps: int, score: float, rewards: List[float]) -> None:
|
| 70 |
-
# rewards_str = ",".join(f"{r:.2f}" for r in rewards)
|
| 71 |
-
# print(f"[END] success={str(success).lower()} steps={steps} score={score:.3f} rewards={rewards_str}", flush=True)
|
| 72 |
-
|
| 73 |
-
# def main():
|
| 74 |
-
# # Always initialise the OpenAI client using the proxy URL and API key.
|
| 75 |
-
# # The hackathon validator requires ALL LLM calls to go through API_BASE_URL
|
| 76 |
-
# # with the provided API_KEY — never bypass this with hardcoded credentials.
|
| 77 |
-
# client = OpenAI(base_url=API_BASE_URL, api_key=API_KEY)
|
| 78 |
-
|
| 79 |
-
# task_id = os.getenv("CLM_LEVEL", "hard")
|
| 80 |
-
|
| 81 |
-
# log_start(task=TASK_NAME, env=BENCHMARK, model=MODEL_NAME)
|
| 82 |
-
|
| 83 |
-
# # 1. Reset Environment
|
| 84 |
-
# try:
|
| 85 |
-
# data = post_json(f"{ENV_BASE_URL}/reset", {"task_id": task_id})
|
| 86 |
-
# except Exception as e:
|
| 87 |
-
# log_step(step=0, action="reset", reward=0.0, done=True, error=str(e)[:50])
|
| 88 |
-
# log_end(success=False, steps=0, score=0.0, rewards=[])
|
| 89 |
-
# return
|
| 90 |
-
|
| 91 |
-
# session_id = data["session_id"]
|
| 92 |
-
# observation = data["observation"]
|
| 93 |
-
|
| 94 |
-
# done = False
|
| 95 |
-
# step = 0
|
| 96 |
-
# rewards = []
|
| 97 |
-
# history = []
|
| 98 |
-
# info = {}
|
| 99 |
-
|
| 100 |
-
# while not done and step < MAX_STEPS:
|
| 101 |
-
# step += 1
|
| 102 |
-
|
| 103 |
-
# # 2. Get next action from LLM via the hackathon proxy
|
| 104 |
-
# history_str = "\n".join(history[-5:]) if history else "No previous actions."
|
| 105 |
-
# system_prompt = """
|
| 106 |
-
# You are an AI task scheduler managing cognitive load.
|
| 107 |
-
# CRITICAL RULES:
|
| 108 |
-
# 1. If "fatigue_level" is "high" or "medium", output {"type": "break"}. Do NOT work until fatigue is "low".
|
| 109 |
-
# 2. If "stress_warning" is true, {"type": "break"} reduces stress safely.
|
| 110 |
-
# 3. Find tasks where "progress" < 1.0. Output {"type": "work", "task_id": "<id>"}. Do NOT work on 1.0 tasks.
|
| 111 |
-
# 4. Respond ONLY with raw JSON format. No markdown blocks.
|
| 112 |
-
# Valid actions: {"type": "work", "task_id": "id"}, {"type": "break"}, {"type": "delay"}, {"type": "switch", "task_id": "id"}
|
| 113 |
-
# """
|
| 114 |
-
# user_prompt = f"""
|
| 115 |
-
# Previous 5 Steps History:
|
| 116 |
-
# {history_str}
|
| 117 |
-
|
| 118 |
-
# Current Observation:
|
| 119 |
-
# {json.dumps(observation, indent=2)}
|
| 120 |
-
|
| 121 |
-
# What is your next action JSON?
|
| 122 |
-
# """
|
| 123 |
-
# action = None
|
| 124 |
-
# error_msg = None
|
| 125 |
-
|
| 126 |
-
# try:
|
| 127 |
-
# completion = client.chat.completions.create(
|
| 128 |
-
# model=MODEL_NAME,
|
| 129 |
-
# messages=[
|
| 130 |
-
# {"role": "system", "content": system_prompt.strip()},
|
| 131 |
-
# {"role": "user", "content": user_prompt.strip()}
|
| 132 |
-
# ],
|
| 133 |
-
# temperature=0.1,
|
| 134 |
-
# max_tokens=150
|
| 135 |
-
# )
|
| 136 |
-
# action_text = (completion.choices[0].message.content or "").strip()
|
| 137 |
-
|
| 138 |
-
# # Strip accidental markdown code fences
|
| 139 |
-
# if action_text.startswith("```json"):
|
| 140 |
-
# action_text = action_text[7:]
|
| 141 |
-
# if action_text.startswith("```"):
|
| 142 |
-
# action_text = action_text[3:]
|
| 143 |
-
# if action_text.endswith("```"):
|
| 144 |
-
# action_text = action_text[:-3]
|
| 145 |
-
|
| 146 |
-
# start_idx = action_text.find("{")
|
| 147 |
-
# end_idx = action_text.rfind("}")
|
| 148 |
-
# if start_idx != -1 and end_idx != -1:
|
| 149 |
-
# action = json.loads(action_text[start_idx:end_idx + 1])
|
| 150 |
-
# except Exception as e:
|
| 151 |
-
# error_msg = str(e)[:50]
|
| 152 |
-
|
| 153 |
-
# # Fallback heuristic only if LLM call failed / returned unparseable output
|
| 154 |
-
# if not action:
|
| 155 |
-
# tasks = observation.get("tasks", [])
|
| 156 |
-
# incomp = [t for t in tasks if t.get("progress", 0.0) < 1.0]
|
| 157 |
-
# if observation.get("visible_state", {}).get("fatigue_level") in ("high", "medium"):
|
| 158 |
-
# action = {"type": "break"}
|
| 159 |
-
# elif incomp:
|
| 160 |
-
# action = {"type": "work", "task_id": incomp[0]["id"]}
|
| 161 |
-
# else:
|
| 162 |
-
# action = {"type": "delay"}
|
| 163 |
-
|
| 164 |
-
# action_str = json.dumps(action).replace(" ", "")
|
| 165 |
-
|
| 166 |
-
# # 3. Step the environment
|
| 167 |
-
# try:
|
| 168 |
-
# step_data = post_json(f"{ENV_BASE_URL}/step", {
|
| 169 |
-
# "session_id": session_id,
|
| 170 |
-
# "action": action
|
| 171 |
-
# })
|
| 172 |
-
# observation = step_data["observation"]
|
| 173 |
-
# reward = step_data.get("reward", 0.0)
|
| 174 |
-
# done = step_data.get("done", False)
|
| 175 |
-
# info = step_data.get("info", {})
|
| 176 |
-
# except Exception as e:
|
| 177 |
-
# reward = 0.0
|
| 178 |
-
# done = True
|
| 179 |
-
# error_msg = error_msg or str(e)[:50]
|
| 180 |
-
|
| 181 |
-
# rewards.append(reward)
|
| 182 |
-
# history.append(f"Step {step} Action: {action_str} -> Reward: {reward}")
|
| 183 |
-
# log_step(step=step, action=action_str, reward=reward, done=done, error=error_msg)
|
| 184 |
-
|
| 185 |
-
# score = info.get("final_score", 0.0)
|
| 186 |
-
# success = score >= SUCCESS_SCORE_THRESHOLD
|
| 187 |
-
# log_end(success=success, steps=step, score=score, rewards=rewards)
|
| 188 |
-
|
| 189 |
-
# if __name__ == "__main__":
|
| 190 |
-
# main()
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
import os
|
| 195 |
import json
|
| 196 |
import urllib.request
|
| 197 |
import urllib.error
|
| 198 |
from typing import List, Optional
|
| 199 |
|
| 200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
|
|
|
|
| 202 |
|
| 203 |
-
# ── HTTP Helper ──────────────────────────────────────────────────────────────
|
| 204 |
def post_json(url: str, payload: dict) -> dict:
|
| 205 |
data = json.dumps(payload).encode("utf-8")
|
| 206 |
req = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"})
|
| 207 |
-
|
| 208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
|
| 210 |
|
| 211 |
-
# ── STRICT ENV (NO FALLBACKS) ────────────────────────────────────────────────
|
| 212 |
API_BASE_URL = os.environ.get("API_BASE_URL")
|
| 213 |
API_KEY = os.environ.get("API_KEY")
|
| 214 |
MODEL_NAME = os.environ.get("MODEL_NAME")
|
|
|
|
| 215 |
|
| 216 |
if not API_BASE_URL:
|
| 217 |
raise ValueError("API_BASE_URL must be set")
|
|
|
|
| 218 |
if not API_KEY:
|
| 219 |
raise ValueError("API_KEY must be set")
|
| 220 |
-
if not MODEL_NAME:
|
| 221 |
-
raise ValueError("MODEL_NAME must be set")
|
| 222 |
-
|
| 223 |
-
ENV_BASE_URL = os.environ.get("ENV_BASE_URL", "http://localhost:7860")
|
| 224 |
|
|
|
|
|
|
|
| 225 |
|
| 226 |
-
# ── CONFIG ───────────────────────────────────────────────────────────────────
|
| 227 |
TASK_NAME = "schedule-optimization"
|
| 228 |
BENCHMARK = "cognitive-load-manager"
|
| 229 |
SUCCESS_SCORE_THRESHOLD = 0.5
|
| 230 |
MAX_STEPS = 50
|
| 231 |
|
| 232 |
-
|
| 233 |
-
# ── LOGGING ──────────────────────────────────────────────────────────────────
|
| 234 |
-
def log_start(task: str, env: str, model: str):
|
| 235 |
print(f"[START] task={task} env={env} model={model}", flush=True)
|
| 236 |
|
| 237 |
-
|
| 238 |
-
def log_step(step: int, action: str, reward: float, done: bool, error: Optional[str]):
|
| 239 |
error_val = error if error else "null"
|
| 240 |
-
|
| 241 |
-
|
|
|
|
|
|
|
|
|
|
| 242 |
|
| 243 |
-
def log_end(success: bool, steps: int, score: float, rewards: List[float]):
|
| 244 |
rewards_str = ",".join(f"{r:.2f}" for r in rewards)
|
| 245 |
print(f"[END] success={str(success).lower()} steps={steps} score={score:.3f} rewards={rewards_str}", flush=True)
|
| 246 |
|
| 247 |
-
|
| 248 |
-
# ── MAIN ─────────────────────────────────────────────────────────────────────
|
| 249 |
def main():
|
|
|
|
|
|
|
|
|
|
| 250 |
client = OpenAI(base_url=API_BASE_URL, api_key=API_KEY)
|
| 251 |
|
| 252 |
-
|
|
|
|
|
|
|
| 253 |
|
| 254 |
-
#
|
| 255 |
try:
|
| 256 |
-
data = post_json(f"{ENV_BASE_URL}/reset", {"task_id":
|
| 257 |
except Exception as e:
|
| 258 |
-
log_step(0, "reset", 0.0, True, str(e)[:50])
|
| 259 |
-
log_end(False, 0, 0.0, [])
|
| 260 |
return
|
| 261 |
|
| 262 |
session_id = data["session_id"]
|
| 263 |
observation = data["observation"]
|
| 264 |
|
| 265 |
-
rewards = []
|
| 266 |
done = False
|
| 267 |
step = 0
|
|
|
|
|
|
|
| 268 |
info = {}
|
| 269 |
|
| 270 |
while not done and step < MAX_STEPS:
|
| 271 |
step += 1
|
| 272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
action = None
|
| 274 |
error_msg = None
|
| 275 |
|
| 276 |
-
# 🔥 FORCE LLM CALL (NO SKIP)
|
| 277 |
try:
|
| 278 |
-
|
| 279 |
model=MODEL_NAME,
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
|
|
|
|
|
|
|
|
|
| 283 |
)
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
if
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
action = json.loads(text[start:end+1])
|
| 299 |
-
|
| 300 |
except Exception as e:
|
| 301 |
error_msg = str(e)[:50]
|
| 302 |
|
| 303 |
-
#
|
| 304 |
if not action:
|
| 305 |
tasks = observation.get("tasks", [])
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
else:
|
| 309 |
action = {"type": "break"}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 310 |
|
| 311 |
action_str = json.dumps(action).replace(" ", "")
|
| 312 |
|
| 313 |
-
#
|
| 314 |
try:
|
| 315 |
-
step_data = post_json(
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
)
|
| 319 |
observation = step_data["observation"]
|
| 320 |
reward = step_data.get("reward", 0.0)
|
| 321 |
done = step_data.get("done", False)
|
|
@@ -326,14 +180,12 @@ def main():
|
|
| 326 |
error_msg = error_msg or str(e)[:50]
|
| 327 |
|
| 328 |
rewards.append(reward)
|
| 329 |
-
|
| 330 |
-
log_step(step, action_str, reward, done, error_msg)
|
| 331 |
|
| 332 |
score = info.get("final_score", 0.0)
|
| 333 |
success = score >= SUCCESS_SCORE_THRESHOLD
|
| 334 |
-
|
| 335 |
-
log_end(success, step, score, rewards)
|
| 336 |
-
|
| 337 |
|
| 338 |
if __name__ == "__main__":
|
| 339 |
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import json
|
| 3 |
import urllib.request
|
| 4 |
import urllib.error
|
| 5 |
from typing import List, Optional
|
| 6 |
|
| 7 |
+
try:
|
| 8 |
+
from dotenv import load_dotenv
|
| 9 |
+
load_dotenv()
|
| 10 |
+
except ImportError:
|
| 11 |
+
pass
|
| 12 |
+
|
| 13 |
+
# /// script
|
| 14 |
+
# requires-python = ">=3.11"
|
| 15 |
+
# dependencies = [
|
| 16 |
+
# "openai",
|
| 17 |
+
# ]
|
| 18 |
+
# ///
|
| 19 |
|
| 20 |
+
from openai import OpenAI
|
| 21 |
|
|
|
|
| 22 |
def post_json(url: str, payload: dict) -> dict:
|
| 23 |
data = json.dumps(payload).encode("utf-8")
|
| 24 |
req = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"})
|
| 25 |
+
try:
|
| 26 |
+
with urllib.request.urlopen(req) as res:
|
| 27 |
+
return json.loads(res.read().decode("utf-8"))
|
| 28 |
+
except urllib.error.HTTPError as e:
|
| 29 |
+
raise Exception(f"HTTP Error {e.code}: {e.read().decode('utf-8')}")
|
| 30 |
+
|
| 31 |
+
# ── Environment variables ────────────────────────────────────────────────────
|
| 32 |
+
# API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
|
| 33 |
+
# HF_TOKEN = os.getenv("HF_TOKEN")
|
| 34 |
+
|
| 35 |
+
# API_KEY = HF_TOKEN or os.getenv("API_KEY")
|
| 36 |
+
# if not API_KEY:
|
| 37 |
+
# raise ValueError("API_KEY environment variable is required")
|
| 38 |
|
| 39 |
|
|
|
|
| 40 |
API_BASE_URL = os.environ.get("API_BASE_URL")
|
| 41 |
API_KEY = os.environ.get("API_KEY")
|
| 42 |
MODEL_NAME = os.environ.get("MODEL_NAME")
|
| 43 |
+
ENV_BASE_URL = os.environ.get("ENV_BASE_URL", "http://localhost:7860")
|
| 44 |
|
| 45 |
if not API_BASE_URL:
|
| 46 |
raise ValueError("API_BASE_URL must be set")
|
| 47 |
+
|
| 48 |
if not API_KEY:
|
| 49 |
raise ValueError("API_KEY must be set")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
+
MODEL_NAME = os.getenv("MODEL_NAME", "Qwen/Qwen2.5-72B-Instruct")
|
| 52 |
+
ENV_BASE_URL = os.getenv("ENV_BASE_URL", "http://localhost:7860")
|
| 53 |
|
|
|
|
| 54 |
TASK_NAME = "schedule-optimization"
|
| 55 |
BENCHMARK = "cognitive-load-manager"
|
| 56 |
SUCCESS_SCORE_THRESHOLD = 0.5
|
| 57 |
MAX_STEPS = 50
|
| 58 |
|
| 59 |
+
def log_start(task: str, env: str, model: str) -> None:
|
|
|
|
|
|
|
| 60 |
print(f"[START] task={task} env={env} model={model}", flush=True)
|
| 61 |
|
| 62 |
+
def log_step(step: int, action: str, reward: float, done: bool, error: Optional[str]) -> None:
|
|
|
|
| 63 |
error_val = error if error else "null"
|
| 64 |
+
done_val = str(done).lower()
|
| 65 |
+
print(
|
| 66 |
+
f"[STEP] step={step} action={action} reward={reward:.2f} done={done_val} error={error_val}",
|
| 67 |
+
flush=True,
|
| 68 |
+
)
|
| 69 |
|
| 70 |
+
def log_end(success: bool, steps: int, score: float, rewards: List[float]) -> None:
|
| 71 |
rewards_str = ",".join(f"{r:.2f}" for r in rewards)
|
| 72 |
print(f"[END] success={str(success).lower()} steps={steps} score={score:.3f} rewards={rewards_str}", flush=True)
|
| 73 |
|
|
|
|
|
|
|
| 74 |
def main():
|
| 75 |
+
# Always initialise the OpenAI client using the proxy URL and API key.
|
| 76 |
+
# The hackathon validator requires ALL LLM calls to go through API_BASE_URL
|
| 77 |
+
# with the provided API_KEY — never bypass this with hardcoded credentials.
|
| 78 |
client = OpenAI(base_url=API_BASE_URL, api_key=API_KEY)
|
| 79 |
|
| 80 |
+
task_id = os.getenv("CLM_LEVEL", "hard")
|
| 81 |
+
|
| 82 |
+
log_start(task=TASK_NAME, env=BENCHMARK, model=MODEL_NAME)
|
| 83 |
|
| 84 |
+
# 1. Reset Environment
|
| 85 |
try:
|
| 86 |
+
data = post_json(f"{ENV_BASE_URL}/reset", {"task_id": task_id})
|
| 87 |
except Exception as e:
|
| 88 |
+
log_step(step=0, action="reset", reward=0.0, done=True, error=str(e)[:50])
|
| 89 |
+
log_end(success=False, steps=0, score=0.0, rewards=[])
|
| 90 |
return
|
| 91 |
|
| 92 |
session_id = data["session_id"]
|
| 93 |
observation = data["observation"]
|
| 94 |
|
|
|
|
| 95 |
done = False
|
| 96 |
step = 0
|
| 97 |
+
rewards = []
|
| 98 |
+
history = []
|
| 99 |
info = {}
|
| 100 |
|
| 101 |
while not done and step < MAX_STEPS:
|
| 102 |
step += 1
|
| 103 |
|
| 104 |
+
# 2. Get next action from LLM via the hackathon proxy
|
| 105 |
+
history_str = "\n".join(history[-5:]) if history else "No previous actions."
|
| 106 |
+
system_prompt = """
|
| 107 |
+
You are an AI task scheduler managing cognitive load.
|
| 108 |
+
CRITICAL RULES:
|
| 109 |
+
1. If "fatigue_level" is "high" or "medium", output {"type": "break"}. Do NOT work until fatigue is "low".
|
| 110 |
+
2. If "stress_warning" is true, {"type": "break"} reduces stress safely.
|
| 111 |
+
3. Find tasks where "progress" < 1.0. Output {"type": "work", "task_id": "<id>"}. Do NOT work on 1.0 tasks.
|
| 112 |
+
4. Respond ONLY with raw JSON format. No markdown blocks.
|
| 113 |
+
Valid actions: {"type": "work", "task_id": "id"}, {"type": "break"}, {"type": "delay"}, {"type": "switch", "task_id": "id"}
|
| 114 |
+
"""
|
| 115 |
+
user_prompt = f"""
|
| 116 |
+
Previous 5 Steps History:
|
| 117 |
+
{history_str}
|
| 118 |
+
|
| 119 |
+
Current Observation:
|
| 120 |
+
{json.dumps(observation, indent=2)}
|
| 121 |
+
|
| 122 |
+
What is your next action JSON?
|
| 123 |
+
"""
|
| 124 |
action = None
|
| 125 |
error_msg = None
|
| 126 |
|
|
|
|
| 127 |
try:
|
| 128 |
+
completion = client.chat.completions.create(
|
| 129 |
model=MODEL_NAME,
|
| 130 |
+
messages=[
|
| 131 |
+
{"role": "system", "content": system_prompt.strip()},
|
| 132 |
+
{"role": "user", "content": user_prompt.strip()}
|
| 133 |
+
],
|
| 134 |
+
temperature=0.1,
|
| 135 |
+
max_tokens=150
|
| 136 |
)
|
| 137 |
+
action_text = (completion.choices[0].message.content or "").strip()
|
| 138 |
+
|
| 139 |
+
# Strip accidental markdown code fences
|
| 140 |
+
if action_text.startswith("```json"):
|
| 141 |
+
action_text = action_text[7:]
|
| 142 |
+
if action_text.startswith("```"):
|
| 143 |
+
action_text = action_text[3:]
|
| 144 |
+
if action_text.endswith("```"):
|
| 145 |
+
action_text = action_text[:-3]
|
| 146 |
+
|
| 147 |
+
start_idx = action_text.find("{")
|
| 148 |
+
end_idx = action_text.rfind("}")
|
| 149 |
+
if start_idx != -1 and end_idx != -1:
|
| 150 |
+
action = json.loads(action_text[start_idx:end_idx + 1])
|
|
|
|
|
|
|
| 151 |
except Exception as e:
|
| 152 |
error_msg = str(e)[:50]
|
| 153 |
|
| 154 |
+
# Fallback heuristic only if LLM call failed / returned unparseable output
|
| 155 |
if not action:
|
| 156 |
tasks = observation.get("tasks", [])
|
| 157 |
+
incomp = [t for t in tasks if t.get("progress", 0.0) < 1.0]
|
| 158 |
+
if observation.get("visible_state", {}).get("fatigue_level") in ("high", "medium"):
|
|
|
|
| 159 |
action = {"type": "break"}
|
| 160 |
+
elif incomp:
|
| 161 |
+
action = {"type": "work", "task_id": incomp[0]["id"]}
|
| 162 |
+
else:
|
| 163 |
+
action = {"type": "delay"}
|
| 164 |
|
| 165 |
action_str = json.dumps(action).replace(" ", "")
|
| 166 |
|
| 167 |
+
# 3. Step the environment
|
| 168 |
try:
|
| 169 |
+
step_data = post_json(f"{ENV_BASE_URL}/step", {
|
| 170 |
+
"session_id": session_id,
|
| 171 |
+
"action": action
|
| 172 |
+
})
|
| 173 |
observation = step_data["observation"]
|
| 174 |
reward = step_data.get("reward", 0.0)
|
| 175 |
done = step_data.get("done", False)
|
|
|
|
| 180 |
error_msg = error_msg or str(e)[:50]
|
| 181 |
|
| 182 |
rewards.append(reward)
|
| 183 |
+
history.append(f"Step {step} Action: {action_str} -> Reward: {reward}")
|
| 184 |
+
log_step(step=step, action=action_str, reward=reward, done=done, error=error_msg)
|
| 185 |
|
| 186 |
score = info.get("final_score", 0.0)
|
| 187 |
success = score >= SUCCESS_SCORE_THRESHOLD
|
| 188 |
+
log_end(success=success, steps=step, score=score, rewards=rewards)
|
|
|
|
|
|
|
| 189 |
|
| 190 |
if __name__ == "__main__":
|
| 191 |
main()
|
requirements.txt
CHANGED
|
@@ -1,327 +1,327 @@
|
|
| 1 |
-
absl-py
|
| 2 |
-
accelerate
|
| 3 |
-
acres
|
| 4 |
-
aiofiles
|
| 5 |
-
aiohttp
|
| 6 |
-
aioresponses
|
| 7 |
-
aiosignal
|
| 8 |
-
altair
|
| 9 |
-
annotated-types
|
| 10 |
-
anyio
|
| 11 |
-
argon2-cffi
|
| 12 |
-
argon2-cffi-bindings
|
| 13 |
-
arrow
|
| 14 |
-
asgiref
|
| 15 |
-
asttokens
|
| 16 |
-
astunparse
|
| 17 |
-
async-lru
|
| 18 |
-
attrs
|
| 19 |
-
av
|
| 20 |
-
babel
|
| 21 |
-
beautifulsoup4
|
| 22 |
-
bidict
|
| 23 |
-
bleach
|
| 24 |
-
blinker
|
| 25 |
-
branca
|
| 26 |
-
cachetools
|
| 27 |
-
certifi
|
| 28 |
-
cffi
|
| 29 |
-
charset-normalizer
|
| 30 |
-
ci-info
|
| 31 |
-
click
|
| 32 |
-
cloudpickle
|
| 33 |
-
colorama
|
| 34 |
-
coloredlogs
|
| 35 |
-
comm
|
| 36 |
-
comtypes
|
| 37 |
-
configobj
|
| 38 |
-
configparser
|
| 39 |
-
contourpy
|
| 40 |
-
cryptography
|
| 41 |
-
ctranslate2
|
| 42 |
-
cycler
|
| 43 |
-
debugpy
|
| 44 |
-
decorator
|
| 45 |
-
deep-translator
|
| 46 |
-
deepface
|
| 47 |
-
defusedxml
|
| 48 |
-
distlib
|
| 49 |
-
distro
|
| 50 |
-
Django
|
| 51 |
-
django-background-tasks
|
| 52 |
-
django-compat
|
| 53 |
-
djangorestframework
|
| 54 |
-
dnspython
|
| 55 |
-
docx
|
| 56 |
-
ecdsa
|
| 57 |
-
et-xmlfile
|
| 58 |
-
etelemetry
|
| 59 |
-
executing
|
| 60 |
-
faiss-cpu
|
| 61 |
-
fastapi
|
| 62 |
-
faster-whisper
|
| 63 |
-
fastjsonschema
|
| 64 |
-
ffmpeg-python
|
| 65 |
-
filelock
|
| 66 |
-
fire
|
| 67 |
-
fitz
|
| 68 |
-
Flask
|
| 69 |
-
flask-cors
|
| 70 |
-
Flask-Login
|
| 71 |
-
Flask-SocketIO
|
| 72 |
-
Flask-SQLAlchemy
|
| 73 |
-
flatbuffers
|
| 74 |
-
folium
|
| 75 |
-
fonttools
|
| 76 |
-
fpdf
|
| 77 |
-
fqdn
|
| 78 |
-
frozenlist
|
| 79 |
-
fsspec
|
| 80 |
-
future
|
| 81 |
-
fuzzywuzzy
|
| 82 |
-
gast
|
| 83 |
-
gdown
|
| 84 |
-
geographiclib
|
| 85 |
-
geopy
|
| 86 |
-
git-filter-repo
|
| 87 |
-
gitdb
|
| 88 |
-
GitPython
|
| 89 |
-
google-ai-generativelanguage
|
| 90 |
-
google-api-core
|
| 91 |
-
google-api-python-client
|
| 92 |
-
google-auth
|
| 93 |
-
google-auth-httplib2
|
| 94 |
-
google-generativeai
|
| 95 |
-
google-pasta
|
| 96 |
-
googleapis-common-protos
|
| 97 |
-
greenlet
|
| 98 |
-
grpcio
|
| 99 |
-
grpcio-status
|
| 100 |
-
gTTS
|
| 101 |
-
gunicorn
|
| 102 |
-
h11
|
| 103 |
-
h5py
|
| 104 |
-
httpcore
|
| 105 |
-
httplib2
|
| 106 |
-
httpretty
|
| 107 |
-
httpx
|
| 108 |
-
huggingface-hub
|
| 109 |
-
humanfriendly
|
| 110 |
-
idna
|
| 111 |
-
imageio
|
| 112 |
-
imageio-ffmpeg
|
| 113 |
-
intel-openmp
|
| 114 |
-
ipykernel
|
| 115 |
-
ipython
|
| 116 |
-
ipython_pygments_lexers
|
| 117 |
-
ipywidgets
|
| 118 |
-
isoduration
|
| 119 |
-
itsdangerous
|
| 120 |
-
jax
|
| 121 |
-
jaxlib
|
| 122 |
-
jedi
|
| 123 |
-
Jinja2
|
| 124 |
-
jiter
|
| 125 |
-
joblib
|
| 126 |
-
json5
|
| 127 |
-
jsonpointer
|
| 128 |
-
jsonschema
|
| 129 |
-
jsonschema-specifications
|
| 130 |
-
jupyter
|
| 131 |
-
jupyter-console
|
| 132 |
-
jupyter-events
|
| 133 |
-
jupyter-lsp
|
| 134 |
-
jupyter_client
|
| 135 |
-
jupyter_core
|
| 136 |
-
jupyter_server
|
| 137 |
-
jupyter_server_terminals
|
| 138 |
-
jupyterlab
|
| 139 |
-
jupyterlab_pygments
|
| 140 |
-
jupyterlab_server
|
| 141 |
-
jupyterlab_widgets
|
| 142 |
-
keras
|
| 143 |
-
kiwisolver
|
| 144 |
-
langdetect
|
| 145 |
-
libclang
|
| 146 |
-
llamaapi
|
| 147 |
-
llvmlite
|
| 148 |
-
looseversion
|
| 149 |
-
lxml
|
| 150 |
-
lz4
|
| 151 |
-
Markdown
|
| 152 |
-
markdown-it-py
|
| 153 |
-
MarkupSafe
|
| 154 |
-
matplotlib
|
| 155 |
-
matplotlib-inline
|
| 156 |
-
mdurl
|
| 157 |
-
mistune
|
| 158 |
-
mkl
|
| 159 |
-
ml_dtypes
|
| 160 |
-
more-itertools
|
| 161 |
-
moviepy
|
| 162 |
-
mpmath
|
| 163 |
-
mtcnn
|
| 164 |
-
multidict
|
| 165 |
-
namex
|
| 166 |
-
narwhals
|
| 167 |
-
nbclient
|
| 168 |
-
nbconvert
|
| 169 |
-
nbformat
|
| 170 |
-
nest-asyncio
|
| 171 |
-
networkx
|
| 172 |
-
nibabel
|
| 173 |
-
nipype
|
| 174 |
-
notebook
|
| 175 |
-
notebook_shim
|
| 176 |
-
numba
|
| 177 |
-
numpy
|
| 178 |
-
ollama
|
| 179 |
-
onnxruntime
|
| 180 |
-
openai
|
| 181 |
-
openai-whisper
|
| 182 |
-
opencv-contrib-python
|
| 183 |
-
opencv-python
|
| 184 |
-
openpyxl
|
| 185 |
-
opt_einsum
|
| 186 |
-
optree
|
| 187 |
-
packaging
|
| 188 |
-
panda
|
| 189 |
-
pandas
|
| 190 |
-
pandocfilters
|
| 191 |
-
parso
|
| 192 |
-
pathlib
|
| 193 |
-
pdf2image
|
| 194 |
-
pillow
|
| 195 |
-
platformdirs
|
| 196 |
-
playsound
|
| 197 |
-
prettytable
|
| 198 |
-
proglog
|
| 199 |
-
prometheus_client
|
| 200 |
-
prompt_toolkit
|
| 201 |
-
proto-plus
|
| 202 |
-
protobuf
|
| 203 |
-
prov
|
| 204 |
-
psutil
|
| 205 |
-
psycopg2
|
| 206 |
-
pure_eval
|
| 207 |
-
puremagic
|
| 208 |
-
pyarrow
|
| 209 |
-
pyasn1
|
| 210 |
-
pyasn1_modules
|
| 211 |
-
PyAudio
|
| 212 |
-
pycparser
|
| 213 |
-
pycryptodome
|
| 214 |
-
pydantic
|
| 215 |
-
pydantic_core
|
| 216 |
-
pydeck
|
| 217 |
-
pydot
|
| 218 |
-
pydub
|
| 219 |
-
Pygments
|
| 220 |
-
pymongo
|
| 221 |
-
PyMuPDF
|
| 222 |
-
pyparsing
|
| 223 |
-
PyPDF2
|
| 224 |
-
pypiwin32
|
| 225 |
-
pyreadline3
|
| 226 |
-
PySocks
|
| 227 |
-
python-dateutil
|
| 228 |
-
python-docx
|
| 229 |
-
python-dotenv
|
| 230 |
-
python-engineio
|
| 231 |
-
python-jose
|
| 232 |
-
python-json-logger
|
| 233 |
-
python-multipart
|
| 234 |
-
python-socketio
|
| 235 |
-
python-Wappalyzer
|
| 236 |
-
pyttsx3
|
| 237 |
-
pytube
|
| 238 |
-
pytz
|
| 239 |
-
pywin32
|
| 240 |
-
pywinpty
|
| 241 |
-
pyxnat
|
| 242 |
-
PyYAML
|
| 243 |
-
pyzmq
|
| 244 |
-
rdflib
|
| 245 |
-
referencing
|
| 246 |
-
regex
|
| 247 |
-
reportlab
|
| 248 |
-
requests
|
| 249 |
-
retina-face
|
| 250 |
-
rfc3339-validator
|
| 251 |
-
rfc3986-validator
|
| 252 |
-
rich
|
| 253 |
-
rpds-py
|
| 254 |
-
rsa
|
| 255 |
-
safetensors
|
| 256 |
-
scikit-learn
|
| 257 |
-
scipy
|
| 258 |
-
seaborn
|
| 259 |
-
Send2Trash
|
| 260 |
-
sentence-transformers
|
| 261 |
-
sentencepiece
|
| 262 |
-
setuptools
|
| 263 |
-
shap
|
| 264 |
-
simple-websocket
|
| 265 |
-
simplejson
|
| 266 |
-
six
|
| 267 |
-
slicer
|
| 268 |
-
smmap
|
| 269 |
-
sniffio
|
| 270 |
-
sounddevice
|
| 271 |
-
soupsieve
|
| 272 |
-
SpeechRecognition
|
| 273 |
-
SQLAlchemy
|
| 274 |
-
sqlparse
|
| 275 |
-
stack-data
|
| 276 |
-
starlette
|
| 277 |
-
streamlit
|
| 278 |
-
streamlit-folium
|
| 279 |
-
sympy
|
| 280 |
-
tbb
|
| 281 |
-
tenacity
|
| 282 |
-
tensorboard
|
| 283 |
-
tensorboard-data-server
|
| 284 |
-
tensorflow
|
| 285 |
-
tensorflow-intel
|
| 286 |
-
termcolor
|
| 287 |
-
terminado
|
| 288 |
-
tf_keras
|
| 289 |
-
threadpoolctl
|
| 290 |
-
tiktoken
|
| 291 |
-
tinycss2
|
| 292 |
-
tokenizers
|
| 293 |
-
toml
|
| 294 |
-
torch
|
| 295 |
-
torchaudio
|
| 296 |
-
torchvision
|
| 297 |
-
tornado
|
| 298 |
-
tqdm
|
| 299 |
-
traitlets
|
| 300 |
-
traits
|
| 301 |
-
transformers
|
| 302 |
-
typing-inspection
|
| 303 |
-
typing_extensions
|
| 304 |
-
tzdata
|
| 305 |
-
uri-template
|
| 306 |
-
uritemplate
|
| 307 |
-
urllib3
|
| 308 |
-
uv
|
| 309 |
-
uvicorn
|
| 310 |
-
virtualenv
|
| 311 |
-
virtualenvwrapper-win
|
| 312 |
-
virustotal-python
|
| 313 |
-
watchdog
|
| 314 |
-
wcwidth
|
| 315 |
-
webcolors
|
| 316 |
-
webencodings
|
| 317 |
-
websocket-client
|
| 318 |
-
Werkzeug
|
| 319 |
-
wheel
|
| 320 |
-
widgetsnbextension
|
| 321 |
-
wrapt
|
| 322 |
-
wsproto
|
| 323 |
-
xgboost
|
| 324 |
-
xyzservices
|
| 325 |
-
yarl
|
| 326 |
-
youtube-transcript-api
|
| 327 |
-
yt-dlp
|
|
|
|
| 1 |
+
absl-py
|
| 2 |
+
accelerate
|
| 3 |
+
acres
|
| 4 |
+
aiofiles
|
| 5 |
+
aiohttp
|
| 6 |
+
aioresponses
|
| 7 |
+
aiosignal
|
| 8 |
+
altair
|
| 9 |
+
annotated-types
|
| 10 |
+
anyio
|
| 11 |
+
argon2-cffi
|
| 12 |
+
argon2-cffi-bindings
|
| 13 |
+
arrow
|
| 14 |
+
asgiref
|
| 15 |
+
asttokens
|
| 16 |
+
astunparse
|
| 17 |
+
async-lru
|
| 18 |
+
attrs
|
| 19 |
+
av
|
| 20 |
+
babel
|
| 21 |
+
beautifulsoup4
|
| 22 |
+
bidict
|
| 23 |
+
bleach
|
| 24 |
+
blinker
|
| 25 |
+
branca
|
| 26 |
+
cachetools
|
| 27 |
+
certifi
|
| 28 |
+
cffi
|
| 29 |
+
charset-normalizer
|
| 30 |
+
ci-info
|
| 31 |
+
click
|
| 32 |
+
cloudpickle
|
| 33 |
+
colorama
|
| 34 |
+
coloredlogs
|
| 35 |
+
comm
|
| 36 |
+
comtypes
|
| 37 |
+
configobj
|
| 38 |
+
configparser
|
| 39 |
+
contourpy
|
| 40 |
+
cryptography
|
| 41 |
+
ctranslate2
|
| 42 |
+
cycler
|
| 43 |
+
debugpy
|
| 44 |
+
decorator
|
| 45 |
+
deep-translator
|
| 46 |
+
deepface
|
| 47 |
+
defusedxml
|
| 48 |
+
distlib
|
| 49 |
+
distro
|
| 50 |
+
Django
|
| 51 |
+
django-background-tasks
|
| 52 |
+
django-compat
|
| 53 |
+
djangorestframework
|
| 54 |
+
dnspython
|
| 55 |
+
docx
|
| 56 |
+
ecdsa
|
| 57 |
+
et-xmlfile
|
| 58 |
+
etelemetry
|
| 59 |
+
executing
|
| 60 |
+
faiss-cpu
|
| 61 |
+
fastapi
|
| 62 |
+
faster-whisper
|
| 63 |
+
fastjsonschema
|
| 64 |
+
ffmpeg-python
|
| 65 |
+
filelock
|
| 66 |
+
fire
|
| 67 |
+
fitz
|
| 68 |
+
Flask
|
| 69 |
+
flask-cors
|
| 70 |
+
Flask-Login
|
| 71 |
+
Flask-SocketIO
|
| 72 |
+
Flask-SQLAlchemy
|
| 73 |
+
flatbuffers
|
| 74 |
+
folium
|
| 75 |
+
fonttools
|
| 76 |
+
fpdf
|
| 77 |
+
fqdn
|
| 78 |
+
frozenlist
|
| 79 |
+
fsspec
|
| 80 |
+
future
|
| 81 |
+
fuzzywuzzy
|
| 82 |
+
gast
|
| 83 |
+
gdown
|
| 84 |
+
geographiclib
|
| 85 |
+
geopy
|
| 86 |
+
git-filter-repo
|
| 87 |
+
gitdb
|
| 88 |
+
GitPython
|
| 89 |
+
google-ai-generativelanguage
|
| 90 |
+
google-api-core
|
| 91 |
+
google-api-python-client
|
| 92 |
+
google-auth
|
| 93 |
+
google-auth-httplib2
|
| 94 |
+
google-generativeai
|
| 95 |
+
google-pasta
|
| 96 |
+
googleapis-common-protos
|
| 97 |
+
greenlet
|
| 98 |
+
grpcio
|
| 99 |
+
grpcio-status
|
| 100 |
+
gTTS
|
| 101 |
+
gunicorn
|
| 102 |
+
h11
|
| 103 |
+
h5py
|
| 104 |
+
httpcore
|
| 105 |
+
httplib2
|
| 106 |
+
httpretty
|
| 107 |
+
httpx
|
| 108 |
+
huggingface-hub
|
| 109 |
+
humanfriendly
|
| 110 |
+
idna
|
| 111 |
+
imageio
|
| 112 |
+
imageio-ffmpeg
|
| 113 |
+
intel-openmp
|
| 114 |
+
ipykernel
|
| 115 |
+
ipython
|
| 116 |
+
ipython_pygments_lexers
|
| 117 |
+
ipywidgets
|
| 118 |
+
isoduration
|
| 119 |
+
itsdangerous
|
| 120 |
+
jax
|
| 121 |
+
jaxlib
|
| 122 |
+
jedi
|
| 123 |
+
Jinja2
|
| 124 |
+
jiter
|
| 125 |
+
joblib
|
| 126 |
+
json5
|
| 127 |
+
jsonpointer
|
| 128 |
+
jsonschema
|
| 129 |
+
jsonschema-specifications
|
| 130 |
+
jupyter
|
| 131 |
+
jupyter-console
|
| 132 |
+
jupyter-events
|
| 133 |
+
jupyter-lsp
|
| 134 |
+
jupyter_client
|
| 135 |
+
jupyter_core
|
| 136 |
+
jupyter_server
|
| 137 |
+
jupyter_server_terminals
|
| 138 |
+
jupyterlab
|
| 139 |
+
jupyterlab_pygments
|
| 140 |
+
jupyterlab_server
|
| 141 |
+
jupyterlab_widgets
|
| 142 |
+
keras
|
| 143 |
+
kiwisolver
|
| 144 |
+
langdetect
|
| 145 |
+
libclang
|
| 146 |
+
llamaapi
|
| 147 |
+
llvmlite
|
| 148 |
+
looseversion
|
| 149 |
+
lxml
|
| 150 |
+
lz4
|
| 151 |
+
Markdown
|
| 152 |
+
markdown-it-py
|
| 153 |
+
MarkupSafe
|
| 154 |
+
matplotlib
|
| 155 |
+
matplotlib-inline
|
| 156 |
+
mdurl
|
| 157 |
+
mistune
|
| 158 |
+
mkl
|
| 159 |
+
ml_dtypes
|
| 160 |
+
more-itertools
|
| 161 |
+
moviepy
|
| 162 |
+
mpmath
|
| 163 |
+
mtcnn
|
| 164 |
+
multidict
|
| 165 |
+
namex
|
| 166 |
+
narwhals
|
| 167 |
+
nbclient
|
| 168 |
+
nbconvert
|
| 169 |
+
nbformat
|
| 170 |
+
nest-asyncio
|
| 171 |
+
networkx
|
| 172 |
+
nibabel
|
| 173 |
+
nipype
|
| 174 |
+
notebook
|
| 175 |
+
notebook_shim
|
| 176 |
+
numba
|
| 177 |
+
numpy
|
| 178 |
+
ollama
|
| 179 |
+
onnxruntime
|
| 180 |
+
openai
|
| 181 |
+
openai-whisper
|
| 182 |
+
opencv-contrib-python
|
| 183 |
+
opencv-python
|
| 184 |
+
openpyxl
|
| 185 |
+
opt_einsum
|
| 186 |
+
optree
|
| 187 |
+
packaging
|
| 188 |
+
panda
|
| 189 |
+
pandas
|
| 190 |
+
pandocfilters
|
| 191 |
+
parso
|
| 192 |
+
pathlib
|
| 193 |
+
pdf2image
|
| 194 |
+
pillow
|
| 195 |
+
platformdirs
|
| 196 |
+
playsound
|
| 197 |
+
prettytable
|
| 198 |
+
proglog
|
| 199 |
+
prometheus_client
|
| 200 |
+
prompt_toolkit
|
| 201 |
+
proto-plus
|
| 202 |
+
protobuf
|
| 203 |
+
prov
|
| 204 |
+
psutil
|
| 205 |
+
psycopg2
|
| 206 |
+
pure_eval
|
| 207 |
+
puremagic
|
| 208 |
+
pyarrow
|
| 209 |
+
pyasn1
|
| 210 |
+
pyasn1_modules
|
| 211 |
+
PyAudio
|
| 212 |
+
pycparser
|
| 213 |
+
pycryptodome
|
| 214 |
+
pydantic
|
| 215 |
+
pydantic_core
|
| 216 |
+
pydeck
|
| 217 |
+
pydot
|
| 218 |
+
pydub
|
| 219 |
+
Pygments
|
| 220 |
+
pymongo
|
| 221 |
+
PyMuPDF
|
| 222 |
+
pyparsing
|
| 223 |
+
PyPDF2
|
| 224 |
+
pypiwin32
|
| 225 |
+
pyreadline3
|
| 226 |
+
PySocks
|
| 227 |
+
python-dateutil
|
| 228 |
+
python-docx
|
| 229 |
+
python-dotenv
|
| 230 |
+
python-engineio
|
| 231 |
+
python-jose
|
| 232 |
+
python-json-logger
|
| 233 |
+
python-multipart
|
| 234 |
+
python-socketio
|
| 235 |
+
python-Wappalyzer
|
| 236 |
+
pyttsx3
|
| 237 |
+
pytube
|
| 238 |
+
pytz
|
| 239 |
+
pywin32
|
| 240 |
+
pywinpty
|
| 241 |
+
pyxnat
|
| 242 |
+
PyYAML
|
| 243 |
+
pyzmq
|
| 244 |
+
rdflib
|
| 245 |
+
referencing
|
| 246 |
+
regex
|
| 247 |
+
reportlab
|
| 248 |
+
requests
|
| 249 |
+
retina-face
|
| 250 |
+
rfc3339-validator
|
| 251 |
+
rfc3986-validator
|
| 252 |
+
rich
|
| 253 |
+
rpds-py
|
| 254 |
+
rsa
|
| 255 |
+
safetensors
|
| 256 |
+
scikit-learn
|
| 257 |
+
scipy
|
| 258 |
+
seaborn
|
| 259 |
+
Send2Trash
|
| 260 |
+
sentence-transformers
|
| 261 |
+
sentencepiece
|
| 262 |
+
setuptools
|
| 263 |
+
shap
|
| 264 |
+
simple-websocket
|
| 265 |
+
simplejson
|
| 266 |
+
six
|
| 267 |
+
slicer
|
| 268 |
+
smmap
|
| 269 |
+
sniffio
|
| 270 |
+
sounddevice
|
| 271 |
+
soupsieve
|
| 272 |
+
SpeechRecognition
|
| 273 |
+
SQLAlchemy
|
| 274 |
+
sqlparse
|
| 275 |
+
stack-data
|
| 276 |
+
starlette
|
| 277 |
+
streamlit
|
| 278 |
+
streamlit-folium
|
| 279 |
+
sympy
|
| 280 |
+
tbb
|
| 281 |
+
tenacity
|
| 282 |
+
tensorboard
|
| 283 |
+
tensorboard-data-server
|
| 284 |
+
tensorflow
|
| 285 |
+
tensorflow-intel
|
| 286 |
+
termcolor
|
| 287 |
+
terminado
|
| 288 |
+
tf_keras
|
| 289 |
+
threadpoolctl
|
| 290 |
+
tiktoken
|
| 291 |
+
tinycss2
|
| 292 |
+
tokenizers
|
| 293 |
+
toml
|
| 294 |
+
torch
|
| 295 |
+
torchaudio
|
| 296 |
+
torchvision
|
| 297 |
+
tornado
|
| 298 |
+
tqdm
|
| 299 |
+
traitlets
|
| 300 |
+
traits
|
| 301 |
+
transformers
|
| 302 |
+
typing-inspection
|
| 303 |
+
typing_extensions
|
| 304 |
+
tzdata
|
| 305 |
+
uri-template
|
| 306 |
+
uritemplate
|
| 307 |
+
urllib3
|
| 308 |
+
uv
|
| 309 |
+
uvicorn
|
| 310 |
+
virtualenv
|
| 311 |
+
virtualenvwrapper-win
|
| 312 |
+
virustotal-python
|
| 313 |
+
watchdog
|
| 314 |
+
wcwidth
|
| 315 |
+
webcolors
|
| 316 |
+
webencodings
|
| 317 |
+
websocket-client
|
| 318 |
+
Werkzeug
|
| 319 |
+
wheel
|
| 320 |
+
widgetsnbextension
|
| 321 |
+
wrapt
|
| 322 |
+
wsproto
|
| 323 |
+
xgboost
|
| 324 |
+
xyzservices
|
| 325 |
+
yarl
|
| 326 |
+
youtube-transcript-api
|
| 327 |
+
yt-dlp
|