2023-04-12 01:05:07 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-04-17 14:57:44 -07:00
|
|
|
set -e
|
|
|
|
|
2023-04-12 01:05:07 -04:00
|
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
|
|
|
cd "$SCRIPT_DIR"/.. || exit 1
|
|
|
|
|
|
|
|
PYTHONPATH=. ./unstructured/ingest/main.py \
|
|
|
|
--local-input-path example-docs \
|
|
|
|
--local-file-glob "*.pdf" \
|
|
|
|
--structured-output-dir api-ingest-output \
|
|
|
|
--partition-by-api \
|
|
|
|
--verbose \
|
|
|
|
--reprocess
|
|
|
|
|
2023-04-17 14:57:44 -07:00
|
|
|
set +e
|
|
|
|
|
2023-05-03 18:33:24 -04:00
|
|
|
if [ "$(find 'api-ingest-output' -type f -printf '.' | wc -c)" != 4 ]; then
|
2023-04-12 01:05:07 -04:00
|
|
|
echo
|
2023-05-03 18:33:24 -04:00
|
|
|
echo "4 files should have been created."
|
2023-04-12 01:05:07 -04:00
|
|
|
exit 1
|
|
|
|
fi
|