Commit 4f340c44 authored by myhloli's avatar myhloli
Browse files

refactor(pdf_extract_kit): update model config and weight paths for UniMERNet-0.2.0

Update the paths to model weights and configuration files for the UniMERNet architecture
in both the demo.yaml and model_configs.yaml files. Adjust the mfr_model_init function toreflect the new weight and configuration paths. The changes include specifying more detailed
paths to the unimernet_base directory and changing the weight file extension to .pth.
parent 58a00317
...@@ -58,7 +58,7 @@ def mfd_model_init(weight): ...@@ -58,7 +58,7 @@ def mfd_model_init(weight):
def mfr_model_init(weight_dir, cfg_path, _device_='cpu'): def mfr_model_init(weight_dir, cfg_path, _device_='cpu'):
args = argparse.Namespace(cfg_path=cfg_path, options=None) args = argparse.Namespace(cfg_path=cfg_path, options=None)
cfg = Config(args) cfg = Config(args)
cfg.config.model.pretrained = os.path.join(weight_dir, "pytorch_model.bin") cfg.config.model.pretrained = os.path.join(weight_dir, "pytorch_model.pth")
cfg.config.model.model_config.model_name = weight_dir cfg.config.model.model_config.model_name = weight_dir
cfg.config.model.tokenizer_config.path = weight_dir cfg.config.model.tokenizer_config.path = weight_dir
task = tasks.setup_task(cfg) task = tasks.setup_task(cfg)
......
...@@ -2,13 +2,13 @@ model: ...@@ -2,13 +2,13 @@ model:
arch: unimernet arch: unimernet
model_type: unimernet model_type: unimernet
model_config: model_config:
model_name: ./models model_name: ./models/unimernet_base
max_seq_len: 1024 max_seq_len: 1536
length_aware: False
load_pretrained: True load_pretrained: True
pretrained: ./models/pytorch_model.bin pretrained: './models/unimernet_base/pytorch_model.pth'
tokenizer_config: tokenizer_config:
path: ./models path: ./models/unimernet_base
datasets: datasets:
formula_rec_eval: formula_rec_eval:
...@@ -18,7 +18,7 @@ datasets: ...@@ -18,7 +18,7 @@ datasets:
image_size: image_size:
- 192 - 192
- 672 - 672
run: run:
runner: runner_iter runner: runner_iter
task: unimernet_train task: unimernet_train
...@@ -43,4 +43,4 @@ run: ...@@ -43,4 +43,4 @@ run:
distributed_type: ddp # or fsdp when train llm distributed_type: ddp # or fsdp when train llm
generate_cfg: generate_cfg:
temperature: 0.0 temperature: 0.0
\ No newline at end of file
...@@ -10,6 +10,6 @@ config: ...@@ -10,6 +10,6 @@ config:
weights: weights:
layout: Layout/model_final.pth layout: Layout/model_final.pth
mfd: MFD/weights.pt mfd: MFD/weights.pt
mfr: MFR/UniMERNet mfr: MFR/unimernet_base
struct_eqtable: TabRec/StructEqTable struct_eqtable: TabRec/StructEqTable
TableMaster: TabRec/TableMaster TableMaster: TabRec/TableMaster
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment