Skip to content

Commit

Permalink
Add: Initial Swift support
Browse files Browse the repository at this point in the history
  • Loading branch information
ashvardanian committed Apr 11, 2024
1 parent 346ca27 commit 00bd84c
Show file tree
Hide file tree
Showing 8 changed files with 1,152 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ build/
package-lock.json
*.egg-info
*.onnx
__pycache__
__pycache__
.build
.swiftpm
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
{
"cSpell.words": [
"coreml",
"dtype",
"embs",
"huggingface",
"keepdim",
"linalg",
"logits",
"Matryoshka",
"mlmodel",
"mlpackage",
"mlprogram",
"multimodal",
"ndarray",
"numpy",
"ONNX",
"onnxruntime",
"packbits",
"preprocess",
"pretrained",
"probs",
"pypi",
"rerank",
"reranker",
"reranking",
"SIMD",
"softmax",
"transfromers",
"uform",
"unimodal",
"unsqueeze"
"unsqueeze",
"Vardanian"
],
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
Expand Down
22 changes: 22 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"pins" : [
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41",
"version" : "1.3.0"
}
},
{
"identity" : "swift-transformers",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ashvardanian/swift-transformers",
"state" : {
"revision" : "4060e8ff7c959b89afa7f672cb0a479e87add284"
}
}
],
"version" : 2
}
38 changes: 38 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// swift-tools-version:5.9
import PackageDescription

let package = Package(
name: "UForm",
platforms: [
// Linux doesn't have to be explicitly listed
.iOS(.v16), // For iOS, version 13 and later
.tvOS(.v16), // For tvOS, version 13 and later
.macOS(.v13), // For macOS, version 10.15 (Catalina) and later
.watchOS(.v6) // For watchOS, version 6 and later
],
products: [
.library(
name: "UForm",
targets: ["UForm"]
)
],
dependencies: [
.package(url: "https://github.com/ashvardanian/swift-transformers", revision: "4060e8ff7c959b89afa7f672cb0a479e87add284")
],
targets: [
.target(
name: "UForm",
dependencies: [
.product(name: "Transformers", package: "swift-transformers")
],
path: "swift",
exclude: ["EmbeddingsTests.swift"]
),
.testTarget(
name: "UFormTests",
dependencies: ["UForm"],
path: "swift",
sources: ["EmbeddingsTests.swift"]
)
]
)
Loading

0 comments on commit 00bd84c

Please sign in to comment.