Skip to content

Conversation

@mattt
Copy link
Collaborator

@mattt mattt commented Sep 19, 2025

Related to #176

The Hub module and other products of the swift-transformers package could theoretically be used on Linux, Window, Wasm, or other platforms. As a prerequisite, this PR conditionalizes imports of CoreML and Accelerate, which are specific to macOS and iOS.

@mattt mattt requested a review from pcuenca September 19, 2025 07:19
@FL33TW00D
Copy link
Contributor

LGTM!

@FL33TW00D FL33TW00D merged commit 48f08fb into main Sep 19, 2025
2 checks passed
@pcuenca
Copy link
Member

pcuenca commented Sep 19, 2025

Can we potentially restrict Generation to Apple platforms?

@mattt
Copy link
Collaborator Author

mattt commented Sep 20, 2025

Can we potentially restrict Generation to Apple platforms?

I think that's possible, but I don't think I've ever seen that in the wild. I'm familiar with how errors are communicated when APIs aren't available due to conditional compilation. If we wanted to make that experience nicer, we could add an #else condition that either 1) stubs non-extended declarations, like GenerationMode, with @deprecated notice or 2) emits a `#warning".

@pcuenca
Copy link
Member

pcuenca commented Sep 20, 2025

Ok, no need to spend more time on it then. Thank you!

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.

4 participants