-
Notifications
You must be signed in to change notification settings - Fork 173
Add Swift 6.1 manifest to forward Xet trait to swift-huggingface dependency
#334
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
77b6b23
Add Swift 6.1 manifest to forward Xet trait to swift-huggingface
mattt ecb6e7d
Update CI workflow to test with/without Xet trait
mattt 67b74a6
Attempt to fix build cache contamination for different traits
mattt 514260b
Enable default traits in Xet dependency
mattt 4293913
Configure swiftLanguageMode v5
mattt 7542339
Fix cache key
mattt 14d5986
Add explicit dependency on swift-xet package
mattt 10d94d5
Resolve warning about unused swift-xet dependency
mattt 29695ea
Attempt to resolve hashFiles issue
mattt 3fab35d
Update README
mattt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| // swift-tools-version: 6.1 | ||
| // The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
|
||
| import PackageDescription | ||
|
|
||
| /// Define the strict concurrency settings to be applied to all targets. | ||
| let swiftSettings: [SwiftSetting] = [ | ||
| .enableExperimentalFeature("StrictConcurrency") | ||
| ] | ||
|
|
||
| let package = Package( | ||
| name: "swift-transformers", | ||
| platforms: [.iOS(.v16), .macOS(.v13)], | ||
| products: [ | ||
| .library(name: "Hub", targets: ["Hub"]), | ||
| .library(name: "Tokenizers", targets: ["Tokenizers"]), | ||
| .library(name: "Transformers", targets: ["Tokenizers", "Generation", "Models"]), | ||
| ], | ||
| traits: [ | ||
| .trait( | ||
| name: "Xet", | ||
| description: "Enable Xet transport support in swift-huggingface." | ||
| ) | ||
| ], | ||
| dependencies: [ | ||
| .package(url: "https://github.com/huggingface/swift-jinja.git", from: "2.0.0"), | ||
| // Work around SwiftPM trait resolution issue for transitive Xet dependency. | ||
| .package(url: "https://github.com/huggingface/swift-xet.git", from: "0.2.0"), | ||
| .package( | ||
| url: "https://github.com/huggingface/swift-huggingface.git", | ||
| from: "0.9.0", | ||
| traits: [ | ||
| .defaults, | ||
| .trait(name: "Xet", condition: .when(traits: ["Xet"])), | ||
| ] | ||
| ), | ||
| .package(url: "https://github.com/apple/swift-collections.git", from: "1.0.0"), | ||
| .package(url: "https://github.com/apple/swift-crypto.git", "3.0.0"..<"5.0.0"), | ||
| .package(url: "https://github.com/ibireme/yyjson.git", exact: "0.12.0"), | ||
| ], | ||
| targets: [ | ||
| .target(name: "Generation", dependencies: ["Tokenizers"]), | ||
| .target( | ||
| name: "Hub", | ||
| dependencies: [ | ||
| .product(name: "Jinja", package: "swift-jinja"), | ||
| .product(name: "HuggingFace", package: "swift-huggingface"), | ||
| .product(name: "Xet", package: "swift-xet", condition: .when(traits: ["Xet"])), | ||
| .product(name: "OrderedCollections", package: "swift-collections"), | ||
| .product(name: "Crypto", package: "swift-crypto"), | ||
| .product(name: "yyjson", package: "yyjson"), | ||
| ], | ||
| resources: [ | ||
| .process("Resources") | ||
| ], | ||
| swiftSettings: swiftSettings | ||
| ), | ||
| .target(name: "Models", dependencies: ["Tokenizers", "Generation"]), | ||
| .target(name: "Tokenizers", dependencies: ["Hub", .product(name: "Jinja", package: "swift-jinja")]), | ||
| .testTarget(name: "Benchmarks", dependencies: ["Hub", "Tokenizers", .product(name: "yyjson", package: "yyjson")]), | ||
| .testTarget(name: "GenerationTests", dependencies: ["Generation"]), | ||
| .testTarget(name: "HubTests", dependencies: ["Hub", .product(name: "Jinja", package: "swift-jinja")], swiftSettings: swiftSettings), | ||
| .testTarget(name: "ModelsTests", dependencies: ["Models", "Hub"], resources: [.process("Resources")]), | ||
| .testTarget(name: "TokenizersTests", dependencies: ["Tokenizers", "Models", "Hub"], resources: [.process("Resources")]), | ||
| ], | ||
| swiftLanguageModes: [.v5] | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
oh nice