@@ -26,7 +26,7 @@ enum ModelSelect: String, CaseIterable, Identifiable {
2626 case helium
2727
2828 var id : Self { return self }
29-
29+
3030 var name : String {
3131 switch self {
3232 case . hibiki:
@@ -35,11 +35,12 @@ enum ModelSelect: String, CaseIterable, Identifiable {
3535 return rawValue. capitalized
3636 }
3737 }
38-
38+
3939 var description : String {
4040 switch self {
4141 case . hibiki:
42- return " A French to English simultaneous translation model designed for real-time speech translation. "
42+ return
43+ " A French to English simultaneous translation model designed for real-time speech translation. "
4344 default :
4445 return " "
4546 }
@@ -51,7 +52,7 @@ struct ContentView: View {
5152 @State var selectedModel : ModelSelect = . mimi
5253 @State var sendToSpeaker = false
5354 @Environment ( DeviceStat . self) private var deviceStat
54-
55+
5556 // Currently available models
5657 private let availableModels : [ ModelSelect ] = [ . hibiki]
5758 var body : some View {
@@ -300,7 +301,7 @@ class Evaluator {
300301 if currentStep % 5 == 0 {
301302 self . bufferedDuration =
302303 ap. bufferedDuration ( ) + microphoneCapture. bufferedDuration ( )
303- self . totalDuration = CFAbsoluteTimeGetCurrent ( ) - startTime
304+ self . totalDuration = CFAbsoluteTimeGetCurrent ( ) - startTime
304305 }
305306 if currentStep % 20 == 0 {
306307 self . statsSummary = self . cb. getSummary ( maxEvents: 100 )
@@ -315,13 +316,19 @@ class Evaluator {
315316 " moshi-codes.safetensors " )
316317 do {
317318 let timestamp = Int ( Date ( ) . timeIntervalSince1970)
318- guard let documentsDirectory = FileManager . default. urls ( for: . documentDirectory, in: . userDomainMask) . first else {
319- throw NSError ( domain: " FileManagerError " , code: 1 , userInfo: [ NSLocalizedDescriptionKey: " Documents directory not found " ] )
319+ guard
320+ let documentsDirectory = FileManager . default. urls (
321+ for: . documentDirectory, in: . userDomainMask
322+ ) . first
323+ else {
324+ throw NSError (
325+ domain: " FileManagerError " , code: 1 ,
326+ userInfo: [ NSLocalizedDescriptionKey: " Documents directory not found " ] )
320327 }
321328 let docURL = documentsDirectory. appendingPathComponent (
322329 " moshi-codes- \( timestamp) .safetensors " )
323330 let fileManager = FileManager . default
324- try fileManager. copyItem ( at: codesURL, to: docURL)
331+ try fileManager. copyItem ( at: codesURL, to: docURL)
325332 } catch {
326333 print ( " Error copying file: \( error) " )
327334 }
0 commit comments