getomni-ai / zerox

PDF to Markdown with vision models
https://getomni.ai/ocr-demo
MIT License
6.58k stars 358 forks source link

Fix ENAMETOOLONG error by truncating file names #61

Closed mefengl closed 1 month ago

mefengl commented 1 month ago

Fixes #60


For more details, open the Copilot Workspace session.

tylermaran commented 1 month ago

amazing! For consistency, would you mind adding a similar update to the python version? Should be another one liner.

raw_file_name = os.path.splitext(os.path.basename(local_path))[0]
file_name = ''.join(c.lower() if c.isalnum() else '_' for c in raw_file_name)[:255] 
mefengl commented 1 month ago

@tylermaran done

tylermaran commented 1 month ago

Oh hey @mefengl this was your first contribution too. Congrats! And thanks for the quick work on this one.