Skip to content

Specify file open permissions needed as read only. #943

Merged
martindevans merged 1 commit into
SciSharp:masterfrom
scritch1sm:v0.16.0_patches
Oct 8, 2024
Merged

Specify file open permissions needed as read only. #943
martindevans merged 1 commit into
SciSharp:masterfrom
scritch1sm:v0.16.0_patches

Conversation

@scritch1sm

Copy link
Copy Markdown
Contributor

Default open behavior looks to be read/write. Resulting in failed file open of model in environments with strict read-only file system settings)

…iled in environments with strict read-only file system settings)
@martindevans

martindevans commented Oct 8, 2024

Copy link
Copy Markdown
Member

This is a good idea, and I'll merge it after the tests have run. Thanks!

However, I'm not sure if it will entirely fix the problem. The FileStream there is not actually used to read the model, all we're doing is opening and immediately closing the file. This acts as a sanity check that the file exists and is readable before we pass off to llama.cpp to do the actual work of reading the file.

The model is really loaded with llama_load_model_from_file (a couple of lines down). I don't know whether or not that loads the file with read-only permissions.

@martindevans martindevans merged commit e3fbb21 into SciSharp:master Oct 8, 2024
@scritch1sm

scritch1sm commented Oct 8, 2024 via email

Copy link
Copy Markdown
Contributor Author

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

Successfully merging this pull request may close these issues.

3 participants