ethix commited on
Commit
3393101
·
1 Parent(s): 6f9c8ad

chore: require transformers >= 5.4.0 for shortest_edge resize support

Browse files

The preprocessor_config uses shortest_edge: 440 which requires
transformers >= 5.4.0. Older versions will crash with a ValueError
demanding height/width keys instead.

Files changed (3) hide show
  1. AGENTS.md +3 -2
  2. README.md +5 -1
  3. config.json +1 -1
AGENTS.md CHANGED
@@ -23,9 +23,10 @@ processor = ViTImageProcessor.from_pretrained("buildborderless/CommunityForensic
23
  The custom wrapper (`modeling_vit_classifier.py`) uses `timm.create_model` with a sigmoid output and `pretrained_weights/model_v11_ViT_384_base_ckpt.pt`. This is for standalone (non-HF-pipeline) inference requiring both `timm` and `transformers`.
24
 
25
  ## Dependencies
26
- - `transformers` >= 4.50.0
27
- - `timm` (for the custom ViTClassifier wrapper only)
28
  - `torch`, `torchvision`, `Pillow`
 
29
 
30
  ## Scripts (in `scripts/`)
31
  Data processing utilities for the eval dataset — not needed for inference:
 
23
  The custom wrapper (`modeling_vit_classifier.py`) uses `timm.create_model` with a sigmoid output and `pretrained_weights/model_v11_ViT_384_base_ckpt.pt`. This is for standalone (non-HF-pipeline) inference requiring both `timm` and `transformers`.
24
 
25
  ## Dependencies
26
+ - `transformers >= 5.4.0` (required — older versions lack `shortest_edge` resize and will squash images)
27
+ - `timm` (for the deprecated ViTClassifier wrapper only)
28
  - `torch`, `torchvision`, `Pillow`
29
+ - `onnxruntime >= 1.27` (for ONNX models)
30
 
31
  ## Scripts (in `scripts/`)
32
  Data processing utilities for the eval dataset — not needed for inference:
README.md CHANGED
@@ -66,7 +66,11 @@ The separate [`buildborderless/CommunityForensics-DeepfakeDet-ViT-ONNX`](https:/
66
 
67
  ---
68
 
69
- ## Quick Start
 
 
 
 
70
 
71
  ```python
72
  from transformers import ViTForImageClassification, ViTImageProcessor
 
66
 
67
  ---
68
 
69
+ ## Dependencies
70
+
71
+ - `transformers >= 5.4.0` (required for correct image resize — versions < 5.4.0 will squash non-square images)
72
+ - `torch`, `torchvision`, `Pillow`
73
+ - `onnxruntime >= 1.27` (for ONNX models)
74
 
75
  ```python
76
  from transformers import ViTForImageClassification, ViTImageProcessor
config.json CHANGED
@@ -25,5 +25,5 @@
25
  "patch_size": 16,
26
  "qkv_bias": true,
27
  "torch_dtype": "float32",
28
- "transformers_version": "4.50.0"
29
  }
 
25
  "patch_size": 16,
26
  "qkv_bias": true,
27
  "torch_dtype": "float32",
28
+ "transformers_version": "5.4.0"
29
  }