Spaces:
Running
Running
Update update_docx_with_pdf.py
Browse files- update_docx_with_pdf.py +13 -0
update_docx_with_pdf.py
CHANGED
|
@@ -337,6 +337,19 @@ if __name__ == "__main__":
|
|
| 337 |
update_json_with_pdf(sys.argv[1], sys.argv[2], sys.argv[3])
|
| 338 |
except Exception as e:
|
| 339 |
print(f"Unexpected exception: {e}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
try:
|
| 341 |
with open(sys.argv[1], "r", encoding="utf-8") as inf, open(sys.argv[3], "w", encoding="utf-8") as outf:
|
| 342 |
outf.write(inf.read())
|
|
|
|
| 337 |
update_json_with_pdf(sys.argv[1], sys.argv[2], sys.argv[3])
|
| 338 |
except Exception as e:
|
| 339 |
print(f"Unexpected exception: {e}")
|
| 340 |
+
try:
|
| 341 |
+
with open(sys.argv[1], "r", encoding="utf-8") as inf, open(sys.argv[3], "w", encoding="utf-8") as outf:
|
| 342 |
+
outf.write(inf.read())
|
| 343 |
+
print("Wrote original input JSON to output due to exception.")
|
| 344 |
+
except Exception:
|
| 345 |
+
pass
|
| 346 |
+
sys.exit(0)
|
| 347 |
+
|
| 348 |
+
# ADD THIS LINE:
|
| 349 |
+
with open(sys.argv[3], 'r') as f: print(f"\n📄 LLM_UPDATE OUTPUT:\n{f.read()}")
|
| 350 |
+
|
| 351 |
+
except Exception as e:
|
| 352 |
+
print(f"Unexpected exception in update_docx_with_pdf.py: {e}")
|
| 353 |
try:
|
| 354 |
with open(sys.argv[1], "r", encoding="utf-8") as inf, open(sys.argv[3], "w", encoding="utf-8") as outf:
|
| 355 |
outf.write(inf.read())
|