Skip to content

Commit 900f47f

Browse files
committed
Silence warning when using cog.current_scope()
1 parent e8acdb2 commit 900f47f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

replicate/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,11 @@ def _get_api_token_from_environment() -> Optional[str]:
352352
"""Get API token from cog current scope if available, otherwise from environment."""
353353
try:
354354
import cog # noqa: I001 # pyright: ignore [reportMissingImports]
355+
import warnings
356+
357+
warnings.filterwarnings(
358+
"ignore", message="current_scope", category=cog.ExperimentalFeatureWarning
359+
)
355360

356361
for key, value in cog.current_scope().context.items():
357362
if key.upper() == "REPLICATE_API_TOKEN":

0 commit comments

Comments
 (0)