shayan5422 commited on
Commit
6f8b839
·
verified ·
1 Parent(s): 1ea9b6e

Upload daily_update.py

Browse files
Files changed (1) hide show
  1. daily_update.py +9 -1
daily_update.py CHANGED
@@ -1,6 +1,7 @@
1
  import logging
2
  import sys
3
  import traceback
 
4
 
5
  # Configure basic logging for the orchestration script
6
  logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
@@ -21,6 +22,14 @@ def run_step(step_func, step_name):
21
 
22
  def main():
23
  """Runs the daily update sequence."""
 
 
 
 
 
 
 
 
24
  logging.info("=== Starting Daily Model Update Process ===")
25
 
26
  all_steps_succeeded = True
@@ -52,7 +61,6 @@ def main():
52
  try:
53
  from add_model_explanations import main as add_explanations_main
54
  # Check for API key *before* running the step
55
- import os
56
  if not os.getenv("GEMINI_API_KEY"):
57
  logging.warning("GEMINI_API_KEY environment variable not set. Explanation step will fail or do nothing.")
58
  # Optionally, you could skip this step entirely if the key is missing:
 
1
  import logging
2
  import sys
3
  import traceback
4
+ import os
5
 
6
  # Configure basic logging for the orchestration script
7
  logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
 
22
 
23
  def main():
24
  """Runs the daily update sequence."""
25
+
26
+ # --- Add script directory to Python path ---
27
+ script_dir = os.path.dirname(os.path.abspath(__file__))
28
+ if script_dir not in sys.path:
29
+ sys.path.append(script_dir)
30
+ logging.info(f"Added {script_dir} to sys.path for local imports.")
31
+ # ---
32
+
33
  logging.info("=== Starting Daily Model Update Process ===")
34
 
35
  all_steps_succeeded = True
 
61
  try:
62
  from add_model_explanations import main as add_explanations_main
63
  # Check for API key *before* running the step
 
64
  if not os.getenv("GEMINI_API_KEY"):
65
  logging.warning("GEMINI_API_KEY environment variable not set. Explanation step will fail or do nothing.")
66
  # Optionally, you could skip this step entirely if the key is missing: