Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add an API for readonly files #18

Open
xnorai opened this issue Nov 15, 2024 · 1 comment
Open

Please add an API for readonly files #18

xnorai opened this issue Nov 15, 2024 · 1 comment

Comments

@xnorai
Copy link

xnorai commented Nov 15, 2024

Currently gguf-tools (as used in e.g. MLX - a popular choice on Apple platforms) cannot open *.gguf files on iOS, if those gguf files are in the app bundle. The root cause is it always seems to open files in read/write mode, and then it also mmaps writable regions, both of which fail on iOS because bundled data is very much read-only by design. I imagine there could be other circumstances where read-only access is desirable.

It'd be great if there was a readonly mode for read-only access.

@xnorai
Copy link
Author

xnorai commented Nov 16, 2024

Here's what I mean. This, obviously, is not a complete fix because it permanently switches things into read-only mode, which is not suitable for all circumstances. That is how we patched it for our own specific needs.

0001-Open-files-in-readonly-mode.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant