Skip to content

Commit a174eed

Browse files
authored
Upgrade huggingface-hub to 1.3.1 and transformers to 5.0 (#580)
* Upgrade huggingface-hub to 1.3.1 and transformers to 5.0 Update dependency versions to resolve conflicts for users with packages requiring huggingface-hub>=1.0. The transformers 4.x series pins huggingface-hub<1.0, so upgrading to transformers 5.0 (rc2) is required. Changes: - huggingface-hub: ==0.36.0 -> >=1.3.1 - transformers: >=4.57.1 -> >=5.0.0rc2 - Fix test_push_to_hub_repository_not_found for new RepositoryNotFoundError constructor signature (now requires response kwarg) Signed-off-by: Luke Hinds <lukehinds@gmail.com> * Pin transformers for now --------- Signed-off-by: Luke Hinds <lukehinds@gmail.com>
1 parent be24c3d commit a174eed

4 files changed

Lines changed: 84 additions & 36 deletions

File tree

deepfabric/prompts.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,18 @@ class GraphPromptBuilder:
282282

283283
MAX_PROMPT_EXAMPLES = 3
284284

285-
SECURITY_KEYWORDS = frozenset({
286-
"security",
287-
"attack",
288-
"credential",
289-
"exfiltration",
290-
"injection",
291-
"malicious",
292-
"adversarial",
293-
"threat",
294-
})
285+
SECURITY_KEYWORDS = frozenset(
286+
{
287+
"security",
288+
"attack",
289+
"credential",
290+
"exfiltration",
291+
"injection",
292+
"malicious",
293+
"adversarial",
294+
"threat",
295+
}
296+
)
295297

296298
# Domain-specific expansion examples - formatted to match GraphSubtopics schema
297299
EXAMPLES = {

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[project]
22
name = "DeepFabric"
3-
version = "4.8.3"
3+
version = "4.9.0"
44
description = "Curate High Quality Datasets, Train, Evaluate and Ship"
55
authors = [{name = "DeepFabric Team", email = "oss@alwaysfurther.ai"}]
66
readme = "README.md"
77
requires-python = ">=3.10"
88
dependencies = [
9-
"huggingface-hub==0.36.0",
9+
"huggingface-hub>=1.3.1",
1010
"datasets>=3.0,<5.0",
1111
"kagglehub>=0.3.0",
1212
"outlines==1.2.9",
@@ -21,7 +21,7 @@ dependencies = [
2121
"google-api-core>=2.0.0",
2222
"posthog>=3.0.0",
2323
"packaging>=25.0",
24-
"transformers>=4.57.1",
24+
"transformers==5.0.0rc2",
2525
"protobuf>=3.20.0",
2626
"sentencepiece>=0.1.99",
2727
"ollama>=0.6.1",

tests/unit/test_hf_hub.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,14 @@ def test_push_to_hub_file_not_found(uploader):
139139
@patch("deepfabric.hf_hub.login")
140140
def test_push_to_hub_repository_not_found(mock_login, uploader):
141141
"""Test push to hub with non-existent repository."""
142-
mock_login.side_effect = RepositoryNotFoundError("Repository not found")
142+
# Create a mock response object with all required attributes
143+
mock_response = Mock(spec=Response)
144+
mock_response.headers = {"x-request-id": "test-id"}
145+
mock_response.request = Mock(spec=Request)
146+
mock_response.status_code = 404
147+
mock_response.text = "Repository not found"
148+
149+
mock_login.side_effect = RepositoryNotFoundError("Repository not found", response=mock_response)
143150

144151
result = uploader.push_to_hub("nonexistent/repo", "test.jsonl")
145152
assert result["status"] == "error"

uv.lock

Lines changed: 61 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)