浏览代码

build(dependencies): update PyMuPDF, pydantic and transformers

- Update PyMuPDF to version <1.25.0
- Update pydantic to version <2.11
- Update transformers to version < 5.0.0
- Remove always_apply parameter from alb.ToGray in image processing
myhloli 7 月之前
父节点
当前提交
9032185553

+ 3 - 1
docker/ascend_npu/requirements.txt

@@ -1,7 +1,7 @@
 boto3>=1.28.43
 Brotli>=1.1.0
 click>=8.1.7
-PyMuPDF>=1.24.9,<=1.24.14
+PyMuPDF>=1.24.9,<1.25.0
 loguru>=0.6.0
 numpy>=1.21.6,<2.0.0
 fast-langdetect>=0.2.3,<0.3.0
@@ -15,3 +15,5 @@ rapid-table>=1.0.3,<2.0.0
 doclayout-yolo==0.0.2b1
 ftfy
 openai
+pydantic>=2.7.2,<2.11
+transformers>=4.49.0,<5.0.0

+ 3 - 1
docker/china/requirements.txt

@@ -1,7 +1,7 @@
 boto3>=1.28.43
 Brotli>=1.1.0
 click>=8.1.7
-PyMuPDF>=1.24.9,<=1.24.14
+PyMuPDF>=1.24.9,<1.25.0
 loguru>=0.6.0
 numpy>=1.21.6,<2.0.0
 fast-langdetect>=0.2.3,<0.3.0
@@ -15,3 +15,5 @@ rapid-table>=1.0.3,<2.0.0
 doclayout-yolo==0.0.2b1
 ftfy
 openai
+pydantic>=2.7.2,<2.11
+transformers>=4.49.0,<5.0.0

+ 3 - 1
docker/global/requirements.txt

@@ -1,7 +1,7 @@
 boto3>=1.28.43
 Brotli>=1.1.0
 click>=8.1.7
-PyMuPDF>=1.24.9,<=1.24.14
+PyMuPDF>=1.24.9,<1.25.0
 loguru>=0.6.0
 numpy>=1.21.6,<2.0.0
 fast-langdetect>=0.2.3,<0.3.0
@@ -15,3 +15,5 @@ rapid-table>=1.0.3,<2.0.0
 doclayout-yolo==0.0.2b1
 ftfy
 openai
+pydantic>=2.7.2,<2.11
+transformers>=4.49.0,<5.0.0

+ 1 - 1
magic_pdf/model/sub_modules/mfr/unimernet/unimernet_hf/unimer_swin/image_processing_unimer_swin.py

@@ -16,7 +16,7 @@ class UnimerSwinImageProcessor(BaseImageProcessor):
     
         self.transform = alb.Compose(
             [
-                alb.ToGray(always_apply=True),
+                alb.ToGray(),
                 alb.Normalize((0.7931, 0.7931, 0.7931), (0.1738, 0.1738, 0.1738)),
                 # alb.Sharpen()
                 ToTensorV2(),

+ 3 - 3
requirements.txt

@@ -4,11 +4,11 @@ click>=8.1.7
 fast-langdetect>=0.2.3,<0.3.0
 loguru>=0.6.0
 numpy>=1.21.6
-pydantic>=2.7.2
-PyMuPDF>=1.24.9,<=1.24.14
+pydantic>=2.7.2,<2.11
+PyMuPDF>=1.24.9,<1.25.0
 scikit-learn>=1.0.2
 torch>=2.2.2,!=2.5.0,!=2.5.1,<=2.6.0
 torchvision
-transformers>=4.49.0
+transformers>=4.49.0,<5.0.0
 pdfminer.six==20231228
 # The requirements.txt must ensure that only necessary external dependencies are introduced. If there are new dependencies to add, please contact the project administrator.