mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-15 00:29:52 +00:00
fix(ci): skip HF log in (and tests) in forks and community PRs (#3097)
* fix(ci): skip HF log in (and tests) in forks and community PRs * chore(test): remove comment about test meant to be only run locally * fix(tests): no hf log in decorator for xvla * fix(test): no decorator in yield
This commit is contained in:
@@ -108,6 +108,22 @@ def require_cuda(func):
|
||||
return wrapper
|
||||
|
||||
|
||||
def require_hf_token(func):
|
||||
"""
|
||||
Decorator that skips the test if no Hugging Face Hub token is available.
|
||||
"""
|
||||
|
||||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
from huggingface_hub import get_token
|
||||
|
||||
if get_token() is None:
|
||||
pytest.skip("requires HF token for gated model access")
|
||||
return func(*args, **kwargs)
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
def require_env(func):
|
||||
"""
|
||||
Decorator that skips the test if the required environment package is not installed.
|
||||
|
||||
Reference in New Issue
Block a user