NanduKondreddy commited on
Commit
0c3bdac
·
1 Parent(s): 4b57735

Fix: use strict os.environ[] for API_KEY and API_BASE_URL to match validator requirements

Browse files
Files changed (1) hide show
  1. inference.py +4 -3
inference.py CHANGED
@@ -124,9 +124,10 @@ def get_model_message(client: OpenAI, obs: dict, step: int, history: List[str],
124
 
125
 
126
  async def main() -> None:
127
- # Re-read env vars at runtime (evaluator may inject after module import)
128
- api_key = os.getenv("API_KEY") or os.getenv("HF_TOKEN")
129
- api_base_url = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
 
130
  model_name = os.getenv("MODEL_NAME", "gpt-4o-mini")
131
  task_name = os.getenv("CONFIG_DEBUG_TASK", "config-debug")
132
  benchmark = os.getenv("CONFIG_DEBUG_BENCHMARK", "config_debug_env")
 
124
 
125
 
126
  async def main() -> None:
127
+ # Use strict os.environ[] reads for API credentials (validator requirement)
128
+ # This ensures no fallback paths or proxy bypass
129
+ api_key = os.environ["API_KEY"]
130
+ api_base_url = os.environ["API_BASE_URL"]
131
  model_name = os.getenv("MODEL_NAME", "gpt-4o-mini")
132
  task_name = os.getenv("CONFIG_DEBUG_TASK", "config-debug")
133
  benchmark = os.getenv("CONFIG_DEBUG_BENCHMARK", "config_debug_env")