Skip to content

Commit

Permalink
"Remove commented out code and unused import statements in Package.sw…
Browse files Browse the repository at this point in the history
…ift and Distilbert.swift."
  • Loading branch information
buhe committed Feb 11, 2024
1 parent 796b3d8 commit 1c9b45e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let package = Package(
.product(name: "SwiftSoup", package: "SwiftSoup"),
.product(name: "SwiftFileStore", package: "swift-filestore"),
.product(name: "SimilaritySearchKit", package: "similarity-search-kit", condition: .when(platforms: [.macOS, .iOS, .visionOS])),
.product(name: "SimilaritySearchKitDistilbert", package: "similarity-search-kit", condition: .when(platforms: [.macOS, .iOS, .visionOS])),
// .product(name: "SimilaritySearchKitDistilbert", package: "similarity-search-kit", condition: .when(platforms: [.macOS, .iOS, .visionOS])),
.product(name: "GoogleGenerativeAI", package: "generative-ai-swift"),
.product(name: "SwiftyNotion", package: "SwiftyNotion"),
.product(name: "FeedKit", package: "FeedKit"),
Expand Down
38 changes: 19 additions & 19 deletions Sources/LangChain/embeddings/Distilbert.swift
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
////
//// File.swift
////
////
//// Created by 顾艳华 on 2/11/24.
////
//
// File.swift
//
//import Foundation
//import SimilaritySearchKitDistilbert
//
// Created by 顾艳华 on 2/11/24.
//

import Foundation
import SimilaritySearchKitDistilbert

public struct Distilbert: Embeddings {
let n = DistilbertEmbeddings()
public init() {

}


public func embedQuery(text: String) async -> [Float] {
await n.encode(sentence: text)!
}
}
//public struct Distilbert: Embeddings {
// let n = DistilbertEmbeddings()
// public init() {
//
// }
//
//
// public func embedQuery(text: String) async -> [Float] {
// await n.encode(sentence: text)!
// }
//}

0 comments on commit 1c9b45e

Please sign in to comment.