Skip to content

Conversation

scritch1sm
Copy link
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
Copy link
Member

martindevans commented Oct 8, 2024

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
6 checks passed
@scritch1sm
Copy link
Contributor Author

scritch1sm commented Oct 8, 2024 via email

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