Skip to content

Commit

Permalink
config update - owerwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefbaranec committed Nov 6, 2024
1 parent 0a65e74 commit ead66b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
14 changes: 8 additions & 6 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@
"category": "Tags",
"configurations": [
{
"program": "docker run --platform linux/amd64 -v \"${working_directory}:/data\" -w /data --rm pdfix/alt-text-openai:latest --name \"${license_name}\" --key \"${license_key}\" detect -i \"${input_pdf}\" -o \"${output_pdf}\" --tags \"$(tag_name)\" --openai \"${openai_key}\" --lang \"${lang}\"",
"name": "Generate Alt Text for all specified Tags with missing alternate description",
"desc": "Generate Alt Text for all specified Tags with missing alternate description"
},
{
"program": "docker run --platform linux/amd64 -v \"${working_directory}:/data\" -w /data --rm pdfix/alt-text-openai:latest --name \"${license_name}\" --key \"${license_key}\" detect -i \"${input_pdf}\" -o \"${output_pdf}\" --tags \"$(tag_name)\" --openai \"${openai_key}\" --lang \"${lang}\" --overwrite",
"program": "docker run --platform linux/amd64 -v \"${working_directory}:/data\" -w /data --rm pdfix/alt-text-openai:latest --name \"${license_name}\" --key \"${license_key}\" detect -i \"${input_pdf}\" -o \"${output_pdf}\" --tags \"$(tag_name)\" --openai \"${openai_key}\" --lang \"${lang}\" --overwrite \"$(overwrite)\"",
"name": "Generate Alt Text for all specified Tags",
"desc": "Generate Alt Text for all specified Tags"
}
Expand Down Expand Up @@ -58,6 +53,13 @@
"desc": "Alternate description language",
"type": "string",
"value": ""
},
{
"title": "Overwrite",
"desc": "Replace the alternate text if it exists",
"name": "overwrite",
"type": "bool",
"value": false
}
]
}
Expand Down
13 changes: 9 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,18 @@ def main():
)

pars_detect.add_argument("--openai", type=str, required=True, help="OpenAI API key")
pars_detect.add_argument("--tags", type=str, required=True, help="Regular expression defining the tag name")
pars_detect.add_argument(
"--tags",
type=str,
required=True,
default="Figure",
help="Regular expression defining the tag name",
)
pars_detect.add_argument(
"--overwrite",
action="store_true",
required=False,
type=bool,
default=False,
help="Overwrite alternate text if already present in the tag",
help="Overwrite the alt text if it exists",
)
pars_detect.add_argument(
"--lang",
Expand Down

0 comments on commit ead66b6

Please sign in to comment.