I have setup the docker container to run the model evaluation.
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
Run find . -name "*.pdf" -exec python3 process.py {} txt/{}.txt \; but don't rewrite files that already exist. Instead of .pdf.txt make it just .txt
To achieve this, you can modify the command to check if the output file already exists before running the `process.py` script. Here's how you can do it:
1 | find . -name "*.pdf" -exec bash -c 'output="txt/$(basename "{}" .pdf).txt"; if [ ! -f "$output" ]; then python3 process.py "{}" "$output"; fi' \; |
I extracted the following code from that output:
1 | find . -name "*.pdf" -exec bash -c 'output="txt/$(basename "{}" .pdf).txt"; if [ ! -f "$output" ]; then python3 process.py "{}" "$output"; fi' \; |
Running the following program:
1 | find . -name "*.pdf" -exec bash -c 'output="txt/$(basename "{}" .pdf).txt"; if [ ! -f "$output" ]; then python3 process.py "{}" "$output"; fi' \; |
final: True Resulting in output: True