Spaces:
Sleeping
Sleeping
fixed hardcoded api key :)
Browse filesI am just typing this bcz i am free rn, This hardcoded API key was in old version of inference.py , recently I removed it and maintained in .env , but when I push this to HF space, the file was'nt updating, same old line of exposed API key.. so took the matter into own hands and reached HF space to directly edit code here, hope it changes this time :)"
- inference.py +1 -1
inference.py
CHANGED
|
@@ -19,7 +19,7 @@ HF_TOKEN = os.environ.get("HF_TOKEN","")
|
|
| 19 |
client = OpenAI(
|
| 20 |
base_url=API_BASE_URL,
|
| 21 |
|
| 22 |
-
api_key="
|
| 23 |
)
|
| 24 |
|
| 25 |
def env_reset(task_id: int) -> dict:
|
|
|
|
| 19 |
client = OpenAI(
|
| 20 |
base_url=API_BASE_URL,
|
| 21 |
|
| 22 |
+
api_key=HF_TOKEN if HF_TOKEN else "no-key-needed",
|
| 23 |
)
|
| 24 |
|
| 25 |
def env_reset(task_id: int) -> dict:
|