kitjesen commited on
Commit
d282272
1 Parent(s): 8afa9a1

Upload 9 files

Browse files
Files changed (5) hide show
  1. .gitattributes +4 -41
  2. app.py +25 -1
  3. metadata.json +7 -1
  4. model_index.json +7 -0
  5. tokenizer_config.json +6 -0
.gitattributes CHANGED
@@ -1,41 +1,4 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
36
- models/TabRec/TableMaster/ch_PP-OCRv3_det_infer/inference.pdiparams filter=lfs diff=lfs merge=lfs -text
37
- models/TabRec/TableMaster/ch_PP-OCRv3_det_infer/inference.pdmodel filter=lfs diff=lfs merge=lfs -text
38
- models/TabRec/TableMaster/ch_PP-OCRv3_rec_infer/inference.pdiparams filter=lfs diff=lfs merge=lfs -text
39
- models/TabRec/TableMaster/ch_PP-OCRv3_rec_infer/inference.pdmodel filter=lfs diff=lfs merge=lfs -text
40
- models/TabRec/TableMaster/table_structure_tablemaster_infer/inference.pdiparams filter=lfs diff=lfs merge=lfs -text
41
- models/TabRec/TableMaster/table_structure_tablemaster_infer/inference.pdmodel filter=lfs diff=lfs merge=lfs -text
 
1
+ *.bin filter=lfs diff=lfs merge=lfs -text
2
+ *.pt filter=lfs diff=lfs merge=lfs -text
3
+ *.pth filter=lfs diff=lfs merge=lfs -text
4
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -1 +1,25 @@
1
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import PreTrainedModel
2
+ from typing import Optional
3
+ import torch
4
+
5
+ class MinerUModel(PreTrainedModel):
6
+ def __init__(self, config):
7
+ super().__init__(config)
8
+ self.config = config
9
+
10
+ @staticmethod
11
+ def load_model():
12
+ from model_loader import MinerUModelLoader
13
+ return MinerUModelLoader.load_models("./")
14
+
15
+ def forward(self, input_data):
16
+ # 实现前向传播逻辑
17
+ pass
18
+
19
+ def load_model():
20
+ model = MinerUModel.from_pretrained("./")
21
+ return model
22
+
23
+ def inference(pdf_content):
24
+ model = load_model()
25
+ return model(pdf_content)
metadata.json CHANGED
@@ -2,5 +2,11 @@
2
  "language": ["zh", "en"],
3
  "license": "apache-2.0",
4
  "tags": ["document-conversion", "pdf-to-markdown"],
5
- "pipeline_tag": "document-conversion"
 
 
 
 
 
 
6
  }
 
2
  "language": ["zh", "en"],
3
  "license": "apache-2.0",
4
  "tags": ["document-conversion", "pdf-to-markdown"],
5
+ "pipeline_tag": "document-conversion",
6
+ "library_name": "transformers",
7
+ "task_specific_params": {
8
+ "pdf-to-markdown": {
9
+ "max_length": 1024
10
+ }
11
+ }
12
  }
model_index.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "kitjesen/MinerU",
3
+ "architectures": ["MinerUModel"],
4
+ "model_type": "mineru",
5
+ "transformers_version": "4.28.0",
6
+ "framework": "pytorch"
7
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "mineru",
3
+ "pad_token": "[PAD]",
4
+ "unk_token": "[UNK]",
5
+ "do_lower_case": false
6
+ }