Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ensan-hcl committed Mar 9, 2024
1 parent 69033bd commit e973b44
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Sources/CliTool/Subcommands/RunCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ extension Subcommands {
var composingText = ComposingText()
composingText.insertAtCursorPosition(input, inputStyle: .direct)
let result = await converter.requestCandidates(composingText, options: requestOptions())
for candidate in result.mainResults.prefix(self.displayTopN) {
print(candidate.text)
for (i, candidate) in zip(0 ..< self.displayTopN, result.mainResults.prefix(self.displayTopN)) {
print(i, candidate.text)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/KanaKanjiConverterModule/GPT2/LlamaState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LlamaState {
private var llamaContext: LlamaContext?
private var modelUrl: URL? {
#if os(macOS)
Bundle.module.url(forResource: "llama_models/rinna_Q2_K", withExtension: "gguf")
Bundle.module.url(forResource: "llama_models/naoki_Q2_K", withExtension: "gguf")
#elseif os(iOS)
Bundle.module.url(forResource: "llama_models/rinna", withExtension: "gguf")
#endif
Expand Down
4 changes: 2 additions & 2 deletions Sources/KanaKanjiConverterModule/LOUDS/LOUDS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ struct LOUDS: Sendable {
}
return flatChar2nodeIndices
}
self.flatChar2nodeIndicesIndex = consume flatChar2nodeIndicesIndex
self.flatChar2nodeIndicesIndex = flatChar2nodeIndicesIndex

var rankLarge: [UInt32] = .init(repeating: 0, count: bytes.count + 1)
rankLarge.withUnsafeMutableBufferPointer { buffer in
for (i, byte) in zip(bytes.indices, bytes) {
buffer[i + 1] = buffer[i] &+ UInt32(Self.unit &- byte.nonzeroBitCount)
}
}
self.rankLarge = consume rankLarge
self.rankLarge = rankLarge
}

/// parentNodeIndex個の0を探索し、その次から1個増えるまでのIndexを返す。
Expand Down

0 comments on commit e973b44

Please sign in to comment.