ps2181 Claude Sonnet 4.6 commited on
Commit
430e615
·
1 Parent(s): 59a05a5

Fix inference.py env var pattern to match submission checklist

Browse files

Use os.getenv("KEY", default) for API_BASE_URL and MODEL_NAME,
and os.getenv("HF_TOKEN") with no default, as required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. inference.py +4 -3
inference.py CHANGED
@@ -25,9 +25,10 @@ load_dotenv()
25
  # Configuration
26
  # ---------------------------------------------------------------------------
27
 
28
- API_KEY = os.getenv("HF_TOKEN") or os.getenv("API_KEY")
29
- API_BASE_URL = os.getenv("API_BASE_URL") or "https://router.huggingface.co/v1"
30
- MODEL_NAME = os.getenv("MODEL_NAME") or "Qwen/Qwen2.5-72B-Instruct"
 
31
 
32
  ENV_URL = os.getenv("ENV_URL", "http://localhost:7860")
33
  BENCHMARK = "invoice_processing_pipeline"
 
25
  # Configuration
26
  # ---------------------------------------------------------------------------
27
 
28
+ API_BASE_URL = os.getenv("API_BASE_URL", "https://router.huggingface.co/v1")
29
+ MODEL_NAME = os.getenv("MODEL_NAME", "Qwen/Qwen2.5-72B-Instruct")
30
+ HF_TOKEN = os.getenv("HF_TOKEN")
31
+ API_KEY = HF_TOKEN or os.getenv("API_KEY")
32
 
33
  ENV_URL = os.getenv("ENV_URL", "http://localhost:7860")
34
  BENCHMARK = "invoice_processing_pipeline"