From b923ad94f63bd1de23d643671a9578386d73dec5 Mon Sep 17 00:00:00 2001 From: buhe Date: Mon, 22 Jan 2024 20:26:38 +0800 Subject: [PATCH 01/16] "Add llmfarm_core.swift package and create Local.swift file for LangChain module." --- Package.swift | 2 ++ Sources/LangChain/llms/Local.swift | 51 ++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 Sources/LangChain/llms/Local.swift diff --git a/Package.swift b/Package.swift index e0def42..ae72d87 100644 --- a/Package.swift +++ b/Package.swift @@ -26,6 +26,7 @@ let package = Package( .package(url: "https://github.com/juyan/swift-filestore", .upToNextMajor(from: "0.5.0")), .package(url: "https://github.com/ZachNagengast/similarity-search-kit.git", from: "0.0.11"), .package(url: "https://github.com/google/generative-ai-swift", .upToNextMajor(from: "0.4.4")), + .package(path: "/Users/guyanhua/code/github/LLMFarm/llmfarm_core.swift/") ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. @@ -41,6 +42,7 @@ let package = Package( .product(name: "SwiftFileStore", package: "swift-filestore"), .product(name: "SimilaritySearchKit", package: "similarity-search-kit", condition: .when(platforms: [.macOS, .iOS, .visionOS])), .product(name: "GoogleGenerativeAI", package: "generative-ai-swift"), + .product(name: "llmfarm_core", package: "llmfarm_core.swift") ] ), diff --git a/Sources/LangChain/llms/Local.swift b/Sources/LangChain/llms/Local.swift new file mode 100644 index 0000000..44b6aaf --- /dev/null +++ b/Sources/LangChain/llms/Local.swift @@ -0,0 +1,51 @@ +// +// File.swift +// +// +// Created by 顾艳华 on 1/22/24. +// + +import Foundation +import llmfarm_core +import llmfarm_core_cpp + +public class Local { + + public init() { + } + + public func _send(text: String, stops: [String] = []) async throws -> LLMResult { + print("Hello.") + var input_text = "State the meaning of life." + var modelInference:ModelInference + var ai = AI(_modelPath: "/Users/guyanhua/llama-2-7b-chat.Q3_K_S.gguf",_chatName: "chat") + modelInference = ModelInference.LLama_gguf + var params:ModelAndContextParams = .default + params.context = 4095 + params.n_threads = 14 + // + params.use_metal = false + + do{ + try ai.loadModel(modelInference,contextParams: params) + var output="" + try ExceptionCather.catchException { + output = try! ai.model.predict(input_text, mainCallback) + } + // llama_save_session_file(ai.model.context,"/Users/guinmoon/dev/alpaca_llama_etc/dump_state.bin",ai.model.session_tokens, ai.model.session_tokens.count) + // llama_save_state(ai.model.context,"/Users/guinmoon/dev/alpaca_llama_etc/dump_state_.bin") + // + print(output) + }catch { + print (error) + } + return LLMResult() + } + + func mainCallback(_ str: String, _ time: Double) -> Bool { + print("\(str)",terminator: "") + + return false + } +} + From 3095a06dc223f97f17ae426c4ab2b46e13a648e6 Mon Sep 17 00:00:00 2001 From: buhe Date: Tue, 23 Jan 2024 12:04:37 +0800 Subject: [PATCH 02/16] "Add llmfarm_core.swift as a remote source control dependency with version 0.8.1." --- Package.resolved | 9 +++++++++ Package.swift | 2 +- Sources/LangChain/llms/Local.swift | 28 +--------------------------- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/Package.resolved b/Package.resolved index b5382dd..d353cb0 100644 --- a/Package.resolved +++ b/Package.resolved @@ -63,6 +63,15 @@ "version" : "4.2.2" } }, + { + "identity" : "llmfarm_core.swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/guinmoon/llmfarm_core.swift", + "state" : { + "revision" : "7226a84a69361c312c997453827c609e613585fd", + "version" : "0.8.1" + } + }, { "identity" : "openai-kit", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index ae72d87..2883fb5 100644 --- a/Package.swift +++ b/Package.swift @@ -26,7 +26,7 @@ let package = Package( .package(url: "https://github.com/juyan/swift-filestore", .upToNextMajor(from: "0.5.0")), .package(url: "https://github.com/ZachNagengast/similarity-search-kit.git", from: "0.0.11"), .package(url: "https://github.com/google/generative-ai-swift", .upToNextMajor(from: "0.4.4")), - .package(path: "/Users/guyanhua/code/github/LLMFarm/llmfarm_core.swift/") + .package(url: "https://github.com/guinmoon/llmfarm_core.swift", .upToNextMajor(from: "0.8.1")), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/Sources/LangChain/llms/Local.swift b/Sources/LangChain/llms/Local.swift index 44b6aaf..13f8965 100644 --- a/Sources/LangChain/llms/Local.swift +++ b/Sources/LangChain/llms/Local.swift @@ -6,39 +6,13 @@ // import Foundation -import llmfarm_core -import llmfarm_core_cpp - public class Local { public init() { } public func _send(text: String, stops: [String] = []) async throws -> LLMResult { - print("Hello.") - var input_text = "State the meaning of life." - var modelInference:ModelInference - var ai = AI(_modelPath: "/Users/guyanhua/llama-2-7b-chat.Q3_K_S.gguf",_chatName: "chat") - modelInference = ModelInference.LLama_gguf - var params:ModelAndContextParams = .default - params.context = 4095 - params.n_threads = 14 - // - params.use_metal = false - - do{ - try ai.loadModel(modelInference,contextParams: params) - var output="" - try ExceptionCather.catchException { - output = try! ai.model.predict(input_text, mainCallback) - } - // llama_save_session_file(ai.model.context,"/Users/guinmoon/dev/alpaca_llama_etc/dump_state.bin",ai.model.session_tokens, ai.model.session_tokens.count) - // llama_save_state(ai.model.context,"/Users/guinmoon/dev/alpaca_llama_etc/dump_state_.bin") - // - print(output) - }catch { - print (error) - } + return LLMResult() } From 6b4e77528184b139022805ef00ba0fd082f68d6e Mon Sep 17 00:00:00 2001 From: buhe Date: Wed, 24 Jan 2024 11:19:09 +0800 Subject: [PATCH 03/16] "Update llmfarm_core.swift package to revision 3c5720e45d17198a434f766da5c3a7fd150eddab in Package.swift and Package.resolved." --- Package.resolved | 3 +-- Package.swift | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Package.resolved b/Package.resolved index d353cb0..03e1806 100644 --- a/Package.resolved +++ b/Package.resolved @@ -68,8 +68,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/guinmoon/llmfarm_core.swift", "state" : { - "revision" : "7226a84a69361c312c997453827c609e613585fd", - "version" : "0.8.1" + "revision" : "3c5720e45d17198a434f766da5c3a7fd150eddab" } }, { diff --git a/Package.swift b/Package.swift index 2883fb5..2bef338 100644 --- a/Package.swift +++ b/Package.swift @@ -26,7 +26,7 @@ let package = Package( .package(url: "https://github.com/juyan/swift-filestore", .upToNextMajor(from: "0.5.0")), .package(url: "https://github.com/ZachNagengast/similarity-search-kit.git", from: "0.0.11"), .package(url: "https://github.com/google/generative-ai-swift", .upToNextMajor(from: "0.4.4")), - .package(url: "https://github.com/guinmoon/llmfarm_core.swift", .upToNextMajor(from: "0.8.1")), + .package(url: "https://github.com/guinmoon/llmfarm_core.swift", .revision("3c5720e45d17198a434f766da5c3a7fd150eddab")), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. @@ -42,7 +42,7 @@ let package = Package( .product(name: "SwiftFileStore", package: "swift-filestore"), .product(name: "SimilaritySearchKit", package: "similarity-search-kit", condition: .when(platforms: [.macOS, .iOS, .visionOS])), .product(name: "GoogleGenerativeAI", package: "generative-ai-swift"), - .product(name: "llmfarm_core", package: "llmfarm_core.swift") + .product(name: "llmfarm_core", package: "llmfarm_core.swift"), ] ), From a3a63ed33a21c573a7b7f4b21dd7d4f24247a154 Mon Sep 17 00:00:00 2001 From: buhe Date: Wed, 24 Jan 2024 11:56:15 +0800 Subject: [PATCH 04/16] "Refactor Local.swift to extend LLM and add modelPath and useMetal properties, and override _send method to load model and predict output." --- Sources/LangChain/llms/Local.swift | 38 +++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/Sources/LangChain/llms/Local.swift b/Sources/LangChain/llms/Local.swift index 13f8965..d7b84f8 100644 --- a/Sources/LangChain/llms/Local.swift +++ b/Sources/LangChain/llms/Local.swift @@ -4,21 +4,41 @@ // // Created by 顾艳华 on 1/22/24. // - +import llmfarm_core import Foundation -public class Local { - - public init() { + +public class Local: LLM { + let modelPath: String + let useMetal: Bool + public init(modelPath: String, useMetal: Bool = false, callbacks: [BaseCallbackHandler] = [], cache: BaseCache? = nil) { + self.modelPath = modelPath + self.useMetal = useMetal + super.init(callbacks: callbacks, cache: cache) } - - public func _send(text: String, stops: [String] = []) async throws -> LLMResult { - - return LLMResult() + public override func _send(text: String, stops: [String] = []) async throws -> LLMResult { + let ai = AI(_modelPath: self.modelPath, _chatName: "chat") + var params:ModelAndContextParams = .default + params.use_metal = useMetal + params.promptFormat = .Custom + params.custom_prompt_format = "### Instruction:{{prompt}}### Response:" + + try? ai.loadModel(ModelInference.LLama_gguf,contextParams: params) + + let output = try? ai.model.predict(text, mainCallback) + print("🚗\(output)") + total_output = 0 + return LLMResult(llm_output: output) } + let maxOutputLength = 256 + var total_output = 0 + func mainCallback(_ str: String, _ time: Double) -> Bool { print("\(str)",terminator: "") - + total_output += str.count + if(total_output>maxOutputLength){ + return true + } return false } } From 7d18bb035c05f7ceaf82e467138a3d7a1618af35 Mon Sep 17 00:00:00 2001 From: buhe Date: Wed, 24 Jan 2024 12:21:28 +0800 Subject: [PATCH 05/16] "Remove unnecessary print statement and comment in Local.swift file." --- Sources/LangChain/llms/Local.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/LangChain/llms/Local.swift b/Sources/LangChain/llms/Local.swift index d7b84f8..627c8c4 100644 --- a/Sources/LangChain/llms/Local.swift +++ b/Sources/LangChain/llms/Local.swift @@ -25,7 +25,7 @@ public class Local: LLM { try? ai.loadModel(ModelInference.LLama_gguf,contextParams: params) let output = try? ai.model.predict(text, mainCallback) - print("🚗\(output)") +// print("🚗\(output)") total_output = 0 return LLMResult(llm_output: output) } From fb899dcaacdcee9538cd9a43c056c741b0f8a9d4 Mon Sep 17 00:00:00 2001 From: buhe Date: Thu, 25 Jan 2024 11:37:20 +0800 Subject: [PATCH 06/16] "Update Package.resolved and Package.swift to use the latest revision of llmfarm_core.swift library. Also, modify the Local.swift file to use the provided ModelInference and update the prompt format." --- Package.resolved | 2 +- Package.swift | 2 +- Sources/LangChain/llms/Local.swift | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Package.resolved b/Package.resolved index 03e1806..29877e6 100644 --- a/Package.resolved +++ b/Package.resolved @@ -68,7 +68,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/guinmoon/llmfarm_core.swift", "state" : { - "revision" : "3c5720e45d17198a434f766da5c3a7fd150eddab" + "revision" : "7226a84a69361c312c997453827c609e613585fd" } }, { diff --git a/Package.swift b/Package.swift index 2bef338..88dd235 100644 --- a/Package.swift +++ b/Package.swift @@ -26,7 +26,7 @@ let package = Package( .package(url: "https://github.com/juyan/swift-filestore", .upToNextMajor(from: "0.5.0")), .package(url: "https://github.com/ZachNagengast/similarity-search-kit.git", from: "0.0.11"), .package(url: "https://github.com/google/generative-ai-swift", .upToNextMajor(from: "0.4.4")), - .package(url: "https://github.com/guinmoon/llmfarm_core.swift", .revision("3c5720e45d17198a434f766da5c3a7fd150eddab")), + .package(url: "https://github.com/guinmoon/llmfarm_core.swift", .revision("7226a84a69361c312c997453827c609e613585fd")), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. diff --git a/Sources/LangChain/llms/Local.swift b/Sources/LangChain/llms/Local.swift index 627c8c4..3e55cef 100644 --- a/Sources/LangChain/llms/Local.swift +++ b/Sources/LangChain/llms/Local.swift @@ -10,7 +10,10 @@ import Foundation public class Local: LLM { let modelPath: String let useMetal: Bool - public init(modelPath: String, useMetal: Bool = false, callbacks: [BaseCallbackHandler] = [], cache: BaseCache? = nil) { + let inference: ModelInference + + public init(inference: ModelInference, modelPath: String, useMetal: Bool = false, callbacks: [BaseCallbackHandler] = [], cache: BaseCache? = nil) { + self.inference = inference self.modelPath = modelPath self.useMetal = useMetal super.init(callbacks: callbacks, cache: cache) @@ -20,10 +23,8 @@ public class Local: LLM { var params:ModelAndContextParams = .default params.use_metal = useMetal params.promptFormat = .Custom - params.custom_prompt_format = "### Instruction:{{prompt}}### Response:" - - try? ai.loadModel(ModelInference.LLama_gguf,contextParams: params) - + params.custom_prompt_format = "{{prompt}}" + try? ai.loadModel(inference, contextParams: params) let output = try? ai.model.predict(text, mainCallback) // print("🚗\(output)") total_output = 0 From 36e577826b2852d23fcbd97ef8accd072e2f6451 Mon Sep 17 00:00:00 2001 From: buhe Date: Thu, 25 Jan 2024 11:58:37 +0800 Subject: [PATCH 07/16] "Update macOS version to \"macos-latest-large\" in the GitHub Actions workflow for Swift." --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 5b80bbf..d51cd1c 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: macos-13 + runs-on: macos-latest-large steps: - uses: actions/checkout@v4 From 6083ccfbd62c35e319950acf61de2c131d224c95 Mon Sep 17 00:00:00 2001 From: buhe Date: Thu, 25 Jan 2024 12:02:04 +0800 Subject: [PATCH 08/16] "Update runs-on value in swift.yml to macos-14." --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index d51cd1c..75fa20c 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: macos-latest-large + runs-on: macos-14 steps: - uses: actions/checkout@v4 From 143da553e0c3c27c11e57ad31c59f2f87ebc49d8 Mon Sep 17 00:00:00 2001 From: buhe Date: Thu, 25 Jan 2024 12:45:29 +0800 Subject: [PATCH 09/16] "Update macOS version in GitHub Actions workflow to macos-13." --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 75fa20c..5b80bbf 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: macos-14 + runs-on: macos-13 steps: - uses: actions/checkout@v4 From d8ef992e1bc117dd5f60ed238b8607b08124f2d9 Mon Sep 17 00:00:00 2001 From: buhe Date: Thu, 25 Jan 2024 14:54:36 +0800 Subject: [PATCH 10/16] "Update runs-on value in swift.yml to macOS-latest." --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 5b80bbf..f8b34ed 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -12,7 +12,7 @@ on: jobs: build: - runs-on: macos-13 + runs-on: macOS-latest steps: - uses: actions/checkout@v4 From 3d14215a4120658792b345481ade1b04ee5e7055 Mon Sep 17 00:00:00 2001 From: buhe Date: Fri, 26 Jan 2024 16:27:47 +0800 Subject: [PATCH 11/16] "Update Package.resolved and Package.swift to use the \"langchain\" branch of \"https://github.com/buhe/llmfarm_core.swift\" instead of the previous revision." --- Package.resolved | 5 +++-- Package.swift | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 29877e6..c7e0485 100644 --- a/Package.resolved +++ b/Package.resolved @@ -66,9 +66,10 @@ { "identity" : "llmfarm_core.swift", "kind" : "remoteSourceControl", - "location" : "https://github.com/guinmoon/llmfarm_core.swift", + "location" : "https://github.com/buhe/llmfarm_core.swift", "state" : { - "revision" : "7226a84a69361c312c997453827c609e613585fd" + "branch" : "langchain", + "revision" : "927d670751bc8aebbc5eb845afd36fe1eeef4f5a" } }, { diff --git a/Package.swift b/Package.swift index 88dd235..be04c96 100644 --- a/Package.swift +++ b/Package.swift @@ -26,7 +26,7 @@ let package = Package( .package(url: "https://github.com/juyan/swift-filestore", .upToNextMajor(from: "0.5.0")), .package(url: "https://github.com/ZachNagengast/similarity-search-kit.git", from: "0.0.11"), .package(url: "https://github.com/google/generative-ai-swift", .upToNextMajor(from: "0.4.4")), - .package(url: "https://github.com/guinmoon/llmfarm_core.swift", .revision("7226a84a69361c312c997453827c609e613585fd")), + .package(url: "https://github.com/buhe/llmfarm_core.swift", .branch("langchain")), ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. From fc3cff778288e56cbbcbff8b7a8d381e42533fd2 Mon Sep 17 00:00:00 2001 From: buhe Date: Fri, 26 Jan 2024 16:52:09 +0800 Subject: [PATCH 12/16] "Refactor BilibiliLoader.swift and langchain_swiftTests.swift to use updated BilibiliClient credentials." --- Sources/LangChain/document_loaders/BilibiliLoader.swift | 2 +- Tests/LangChainTests/langchain_swiftTests.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/LangChain/document_loaders/BilibiliLoader.swift b/Sources/LangChain/document_loaders/BilibiliLoader.swift index e2c9001..34efac2 100644 --- a/Sources/LangChain/document_loaders/BilibiliLoader.swift +++ b/Sources/LangChain/document_loaders/BilibiliLoader.swift @@ -16,7 +16,7 @@ public class BilibiliLoader: BaseLoader { } public override func _load() async throws -> [Document] { - let client = BilibiliClient(credential: BilibiliCredential(sessin: "6376fa3e%2C1705926902%2C0b561%2A71gvy_TPyZMWhUweKjYGT502_5FVZdcv8bfjvwtqdlqm8UjyEiUrkPq1AodolcSjIgBXatNwAAEgA", jct: "330aaac577464e453ea1b070fd1281ea")) + let client = BilibiliClient(credential: BilibiliCredential(sessin: "f3fd16e8%2C1721810527%2C531af%2A12CjAJT4BNVd9Zbd9uAhx99W1XsX6gbi1Js0uHqHKZPGWzS8xLuGdX7kE5x2-DQUFacJYSVnJlYXVwbm9KY2dfS1BENHN5SzZ2NE1wQ2dKLWxqUEMwQVBVN1JiQnh3NjltTDVoM3FURjUwRWt5TDNkdXVQUzFraWVLSnJUdVdMMVhyc25ZcXhFZW53IIEC", jct: "20601a72b51f0448ada0babc5740dc90")) let info = await client.fetchVideoInfo(bvid: videoId) if info == nil { throw LangChainError.LoaderError("Subtitle not exist") diff --git a/Tests/LangChainTests/langchain_swiftTests.swift b/Tests/LangChainTests/langchain_swiftTests.swift index d3efe80..470248b 100644 --- a/Tests/LangChainTests/langchain_swiftTests.swift +++ b/Tests/LangChainTests/langchain_swiftTests.swift @@ -74,7 +74,7 @@ Thought: dog } func testBilibilClient() async throws { - let client = BilibiliClient(credential: BilibiliCredential(sessin: "6376fa3e%2C1705926902%2C0b561%2A71gvy_TPyZMWhUweKjYGT502_5FVZdcv8bfjvwtqdlqm8UjyEiUrkPq1AodolcSjIgBXatNwAAEgA", jct: "330aaac577464e453ea1b070fd1281ea")) + let client = BilibiliClient(credential: BilibiliCredential(sessin: "f3fd16e8%2C1721810527%2C531af%2A12CjAJT4BNVd9Zbd9uAhx99W1XsX6gbi1Js0uHqHKZPGWzS8xLuGdX7kE5x2-DQUFacJYSVnJlYXVwbm9KY2dfS1BENHN5SzZ2NE1wQ2dKLWxqUEMwQVBVN1JiQnh3NjltTDVoM3FURjUwRWt5TDNkdXVQUzFraWVLSnJUdVdMMVhyc25ZcXhFZW53IIEC", jct: "20601a72b51f0448ada0babc5740dc90")) let info = await client.fetchVideoInfo(bvid: "BV1iP411y7Vs") XCTAssertNotNil(info) XCTAssertNotEqual(info?.subtitle, "") From ee07b5bbe3c31f31c21192f5c97a8d7dcc276bb8 Mon Sep 17 00:00:00 2001 From: buhe Date: Fri, 26 Jan 2024 17:12:21 +0800 Subject: [PATCH 13/16] "\"Add code for local model in README.md\"" --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index e2d6633..b3c5b26 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,23 @@ LMSTUDIO_URL=xxx ``` ## Get stated + +
+💬 Local Model +Code +``` + Task { + if let envPath = Bundle.main.path(forResource: "stablelm-3b-4e1t-Q4_K_M", ofType: "txt") { + let local = Local(inference: .GPTNeox_gguf, modelPath: envPath, useMetal: true) + let r = await local.generate(text: "hi") + print("🥰\(r!.llm_output!)") + } else { + print("⚠️ loss model") + } + + } +``` +
💬 Chatbots From a0b0ccbb6cb85d93bc4d28549e3a7011dd3926f8 Mon Sep 17 00:00:00 2001 From: buhe Date: Fri, 26 Jan 2024 17:19:53 +0800 Subject: [PATCH 14/16] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b3c5b26..0f7c75e 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,10 @@ LMSTUDIO_URL=xxx
💬 Local Model + Code -``` + +```swift Task { if let envPath = Bundle.main.path(forResource: "stablelm-3b-4e1t-Q4_K_M", ofType: "txt") { let local = Local(inference: .GPTNeox_gguf, modelPath: envPath, useMetal: true) From d86499e121024a5077fb88cdf063587169352abb Mon Sep 17 00:00:00 2001 From: buhe Date: Fri, 26 Jan 2024 17:23:24 +0800 Subject: [PATCH 15/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f7c75e..3cf33af 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ LMSTUDIO_URL=xxx ## Get stated
-💬 Local Model +🔥 Local Model Code From 78f804c3b2dcfb579138518eb0be4f3978d95ef9 Mon Sep 17 00:00:00 2001 From: buhe Date: Fri, 26 Jan 2024 17:24:28 +0800 Subject: [PATCH 16/16] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cf33af..c968773 100644 --- a/README.md +++ b/README.md @@ -383,7 +383,8 @@ Task(priority: .background) { - [x] Baidu - [x] Llama 2 - [x] Gemini - - [x] LMStudio API + - [x] LMStudio API + - [x] Local Model - Vectorstore - [x] Supabase - [x] SimilaritySearchKit