Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
version: 0.11.7
version: 0.11.19
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install the project
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
version: 0.11.7
version: 0.11.19

- name: Change Package Version
run: |
Expand Down
13 changes: 13 additions & 0 deletions tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import pytest
import torch
from sklearn.preprocessing import LabelEncoder
from urllib.error import URLError
from urllib.request import urlopen

from torchTextClassifiers import ModelConfig, TrainingConfig, torchTextClassifiers
from torchTextClassifiers.dataset import TextClassificationDataset
Expand Down Expand Up @@ -32,6 +34,14 @@
)


def _is_huggingface_reachable() -> bool:
try:
with urlopen("https://huggingface.co", timeout=3):
return True
except URLError:
return False


@pytest.fixture
def sample_data():
"""Fixture providing sample data for all tests."""
Expand Down Expand Up @@ -292,6 +302,9 @@ def test_huggingface_tokenizer(sample_data, model_params):
"""Test the full pipeline with HuggingFaceTokenizer."""
sample_text_data, categorical_data, labels = sample_data

if not _is_huggingface_reachable():
pytest.skip("Hugging Face is unreachable in this environment")

tokenizer = HuggingFaceTokenizer.load_from_pretrained(
"google-bert/bert-base-uncased", output_dim=50
)
Expand Down