Skip to content

Commit

Permalink
"Update GitHub workflow and package dependencies."
Browse files Browse the repository at this point in the history
  • Loading branch information
buhe committed Feb 12, 2024
1 parent af82b58 commit 5a22d3a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
build:

runs-on: macOS-12
runs-on: macOS-latest

steps:
- uses: actions/checkout@v4
Expand Down
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
40 changes: 20 additions & 20 deletions Sources/LangChain/embeddings/Distilbert.swift
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
////
//// File.swift
////
////
//// Created by 顾艳华 on 2/11/24.
////
//
// File.swift
//
//import Foundation
//import SimilaritySearchKitDistilbert
//
// 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)!
}
}
//@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)!
// }
//}

0 comments on commit 5a22d3a

Please sign in to comment.