We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68551cf commit 48acf51Copy full SHA for 48acf51
replicate/client.py
@@ -353,12 +353,9 @@ def _get_api_token_from_environment() -> Optional[str]:
353
try:
354
import cog
355
356
- if hasattr(cog, "current_scope"):
357
- scope = cog.current_scope()
358
- if scope and hasattr(scope, "context") and isinstance(scope.context, dict):
359
- for key, value in scope.context.items():
360
- if key.upper() == "REPLICATE_API_TOKEN":
361
- return scope.context[key]
+ for key, value in cog.current_scope().context.items():
+ if key.upper() == "REPLICATE_API_TOKEN":
+ return value
362
except: # noqa: S110,E722,BLE001 we don't want this code to cause clients to fail
363
pass
364
0 commit comments