Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

配置layout_parser时在config中传入root在方法中报错 #116

Closed
AILock opened this issue Jun 13, 2024 · 3 comments
Closed

配置layout_parser时在config中传入root在方法中报错 #116

AILock opened this issue Jun 13, 2024 · 3 comments

Comments

@AILock
Copy link

AILock commented Jun 13, 2024

pix_to_text.py 第57行 layout_parser = DocXLayoutParser.from_config(None, device=device)

@classmethod
def from_config(cls, configs: Optional[dict] = None, device: str = None, **kwargs):
configs = configs or {}
device = select_device(device)
# configs['device'] = device if device != 'mps' else 'cpu'

    return cls(
        device=device,
        model_fp=configs.get('model_fp', None),
        root=configs.get('root', data_dir()),
        **configs,
    )

在return时configs存在root初始化会报错,希望修改下
@classmethod
def from_config(cls, configs: Optional[dict] = None, device: str = None, **kwargs):
configs = configs or {}
device = select_device(device)
# configs['device'] = device if device != 'mps' else 'cpu'
configs["root"] = configs.get('root', data_dir())
configs["model_fp"] = configs.get('model_fp', None)
return cls(
device=device,
**configs,
)

@breezedeus
Copy link
Owner

看看你的版本是否是最新版

@AILock AILock changed the title 配置layout_parser时在config中传入root在方法中报错,提不了merge代码贴 配置layout_parser时在config中传入root在方法中报错 Jun 14, 2024
@AILock
Copy link
Author

AILock commented Jun 14, 2024

看看你的版本是否是最新版

main分支代码路径是pix2text.doc_xl_layout.doc_xl_layout_parser.DocXLayoutParser.from_config

@breezedeus
Copy link
Owner

v1.1.1.2 已修复,感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants