| import Foundation |
|
|
| |
| |
| enum PlapreConfig { |
| |
| static let sampleRate = 24_000 |
| static let audioTokensPerSecond = 25 |
|
|
| |
| static let vocabSize = 20_802 |
| static let maxContextLength = 512 |
| static let prefillSequenceLength = 512 |
| static let hiddenDimension = 576 |
| static let headDimension = 64 |
| static let numKVHeads = 3 |
| static let speakerEmbeddingDimension = 128 |
|
|
| |
| static let eosToken: Int32 = 0 |
| static let textMarkerToken: Int32 = 8_000 |
| static let audioMarkerToken: Int32 = 8_001 |
| static let audioTokenOffset = 8_002 |
| static let audioTokenMax = 20_801 |
|
|
| |
| static let defaultTemperature: Float = 0.8 |
| static let defaultTopK = 50 |
| static let maxGenerationTokens = 500 |
| static let nonAudioStopThreshold = 10 |
|
|
| |
| static let kanadeChunkSize = 100 |
|
|
| |
| |
| |
| static var repoRoot: URL { |
| URL(fileURLWithPath: #filePath) |
| .deletingLastPathComponent() |
| .deletingLastPathComponent() |
| .deletingLastPathComponent() |
| } |
|
|
| |
| static func modelURL(for name: String, useInt8: Bool) -> URL { |
| if name == "PlaprePico" && useInt8 { |
| return repoRoot.appendingPathComponent("PlaprePico_int8.mlpackage") |
| } |
| return repoRoot.appendingPathComponent("\(name).mlpackage") |
| } |
| } |
|
|