adaptai / platform /dbops /projects /dto /tests /test_hf_client.py
ADAPT-Chase's picture
Add files using upload-large-folder tool
fd357f4 verified
import os
import pytest
from integrations.huggingface_client import HuggingFaceClient
@pytest.mark.parametrize(
"path,expected",
[
("/.cache/model.safetensors", None),
("/home/user/.local/file.bin", None),
("data/experiments/run1/model.bin", "model.bin"),
("tmp/something/file.parquet", "file.parquet"),
("models/checkpoint-1/weights.safetensors", "models/checkpoint-1/weights.safetensors"),
],
)
def test_clean_repo_path(path, expected):
client = HuggingFaceClient(repo_id="dummy/repo")
assert client._clean_repo_path(path) == expected