-
Notifications
You must be signed in to change notification settings - Fork 291
Update MLXChatExample for iOS Sandboxing #285
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
Conversation
On second thoughts, would you prefer a OS dependent approach? Keep desired behavior of downloads folder on macOS, while documents for the rest OSes. |
I’ve added this because my Documents directory syncs with iCloud, which caused all Hugging Face models to sync to my iCloud account. I didn’t test this on iOS, so I didn’t notice the issue earlier. For now, using this workaround might be a better approach: #if(os(macOS))
static let `default` = HubApi(
downloadBase: URL.downloadsDirectory.appending(path: "huggingface"))
#elseif(os(iOS))
static let `default` = HubApi()
#endif Later, we can improve the handling of this in HubApi for a more robust solution. |
Let's do it #else only so it takes care of visionOS as well |
Thank you. I think |
I think the |
Oh yeah, having |
Has anyone tested the current proposed changes on iOS? I get a new error now:
|
I did test the proposed changes and seeing this error for the first time. The default |
I have updated the changes as you mentioned @davidkoski, and tested it on iPad. Let me know what you think! |
I just tested the version with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you for setting this up!
On iOS, due to sandboxing, using the
default
hub gives an error along the line because it cannot store in the downloads directory:We can directly use the default parameter of
HubApi()
that stores under the documents directory, accessible on both iOS and macOS.Also, I wonder the need for the
default
static value then?Thank you creating this example @ibrahimcetin!