Skip to content

Commit

Permalink
Enhance Config Parsing by Allowing Direct Input of Additional Paramet…
Browse files Browse the repository at this point in the history
…ers via cli_options

The purpose of this PR is to enhance the flexibility of parsing input parameters. In the current case match logic, if users need to pass additional parameters, they must first create a JSON file and provide its file path as the value of the config_json key. This PR modifies the case match logic to allow users to directly pass additional configuration parameters (e.g., layout model parameters, OCR model parameters, etc.) through cli_options, without relying on an external JSON file.
  • Loading branch information
ZeyuTeng96 authored Jan 2, 2025
1 parent a922bf2 commit 6ad38c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions marker/config/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def generate_config_dict(self) -> Dict[str, any]:
case "disable_image_extraction":
if v:
config["extract_images"] = False
case _:
if v:
config[k] = v
return config

def get_renderer(self):
Expand Down

0 comments on commit 6ad38c2

Please sign in to comment.