-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"\"Update Package.swift, README.md, Distilbert.swift, and SimilarityS…
…earchKit.swift: Fix Distilbert embedding and vector store loading/saving.\""
- Loading branch information
Showing
4 changed files
with
24 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,21 +1,22 @@ | ||
//// | ||
//// File.swift | ||
//// | ||
//// | ||
//// Created by 顾艳华 on 2/11/24. | ||
//// | ||
// | ||
//import Foundation | ||
//import SimilaritySearchKitDistilbert | ||
// File.swift | ||
// | ||
// | ||
//public struct Distilbert: Embeddings { | ||
// let n = DistilbertEmbeddings() | ||
// public init() { | ||
// | ||
// } | ||
// | ||
// | ||
// public func embedQuery(text: String) async -> [Float] { | ||
// await n.encode(sentence: text)! | ||
// } | ||
//} | ||
// Created by 顾艳华 on 2/11/24. | ||
// | ||
|
||
import Foundation | ||
import SimilaritySearchKitDistilbert | ||
|
||
@available(macOS 13.0, *) | ||
public struct Distilbert: Embeddings { | ||
let n = DistilbertEmbeddings() | ||
public init() { | ||
|
||
} | ||
|
||
|
||
public func embedQuery(text: String) async -> [Float] { | ||
await n.encode(sentence: text)! | ||
} | ||
} |
This file contains 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