suraj-01 commited on
Commit
7ea5307
·
unverified ·
1 Parent(s): 952f039

Update server.py

Browse files
src/adaptive_alert_triage/server.py CHANGED
@@ -550,7 +550,6 @@ async def root():
550
  ],
551
  }
552
 
553
-
554
  import threading
555
  import subprocess
556
 
@@ -561,6 +560,9 @@ def _run_training(episodes: int):
561
  global _training_proc, _training_logs, _ppo_agents
562
  _training_logs = [f"Starting training with --episodes {episodes}..."]
563
  try:
 
 
 
564
  _training_proc = subprocess.Popen(
565
  [sys.executable, "train_rl.py", "--episodes", str(episodes)],
566
  stdout=subprocess.PIPE,
@@ -568,7 +570,7 @@ def _run_training(episodes: int):
568
  text=True,
569
  bufsize=1,
570
  cwd=_project_root if _project_root else os.getcwd(),
571
- env=dict(os.environ)
572
  )
573
  for line in iter(_training_proc.stdout.readline, ''):
574
  if line:
 
550
  ],
551
  }
552
 
 
553
  import threading
554
  import subprocess
555
 
 
560
  global _training_proc, _training_logs, _ppo_agents
561
  _training_logs = [f"Starting training with --episodes {episodes}..."]
562
  try:
563
+ env_vars = dict(os.environ)
564
+ env_vars["HF_TOKEN"] = os.environ.get("HF_TOKEN", "")
565
+ env_vars["HF_REPO_ID"] = os.environ.get("HF_REPO_ID", "")
566
  _training_proc = subprocess.Popen(
567
  [sys.executable, "train_rl.py", "--episodes", str(episodes)],
568
  stdout=subprocess.PIPE,
 
570
  text=True,
571
  bufsize=1,
572
  cwd=_project_root if _project_root else os.getcwd(),
573
+ env=env_vars
574
  )
575
  for line in iter(_training_proc.stdout.readline, ''):
576
  if line: