Jayant-Kernel commited on
Commit
ea54c9d
·
unverified ·
1 Parent(s): 7937a1a

fix: remove dead import, skip sleep when api unavailable

Browse files
Files changed (1) hide show
  1. scripts/generate_pressure.py +2 -2
scripts/generate_pressure.py CHANGED
@@ -93,7 +93,6 @@ def main() -> None:
93
  api_available = False
94
  client = None
95
  try:
96
- import openai
97
  from openai import OpenAI
98
  api_key = os.environ.get("OPENAI_API_KEY", "")
99
  if api_key and "your-openai-key" not in api_key:
@@ -135,7 +134,8 @@ def main() -> None:
135
  _save_rows(output_rows, LEVEL3_PATH)
136
  print(f" Progress: {iteration_count} seen / {new_count} new / {fallback_count} fallback")
137
 
138
- time.sleep(0.5)
 
139
 
140
  _save_rows(output_rows, LEVEL3_PATH)
141
  print(f"\nDone!")
 
93
  api_available = False
94
  client = None
95
  try:
 
96
  from openai import OpenAI
97
  api_key = os.environ.get("OPENAI_API_KEY", "")
98
  if api_key and "your-openai-key" not in api_key:
 
134
  _save_rows(output_rows, LEVEL3_PATH)
135
  print(f" Progress: {iteration_count} seen / {new_count} new / {fallback_count} fallback")
136
 
137
+ if api_available:
138
+ time.sleep(0.5)
139
 
140
  _save_rows(output_rows, LEVEL3_PATH)
141
  print(f"\nDone!")