Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ErisMik committed Jun 4, 2024
1 parent c58d966 commit 7b565d1
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ You can download directly to your device or airdrop from a Mac.
"</s>", // Llama-2, Mistral, and Mixtral
"<end_of_turn>", // Gemma
"<|endoftext|>", // Phi-2
"<|eot_id|>", // Llama-3
"<|eot_id|>" // Llama-3
]

private func streamCallback(completion: String) {
Expand Down Expand Up @@ -248,20 +248,20 @@ You can download directly to your device or airdrop from a Mac.
if warmup {
pcmBuffer.append(contentsOf: pcm!)
if pcmBuffer.count >= (1 * orca!.sampleRate!) {
audioStream!.playStreamPCM(pcmBuffer, completion: {isPlaying in })
audioStream!.playStreamPCM(pcmBuffer, completion: {_ in })
pcmBuffer.removeAll()
warmup = false
}
} else {
audioStream!.playStreamPCM(pcm!, completion: {isPlaying in })
audioStream!.playStreamPCM(pcm!, completion: {_ in })
}
}
}
}

let pcm = try orcaStream.flush()
if pcm != nil {
audioStream!.playStreamPCM(pcm!, completion: {isPlaying in })
audioStream!.playStreamPCM(pcm!, completion: {_ in })
}

orcaStream.close()
Expand Down Expand Up @@ -292,8 +292,7 @@ You can download directly to your device or airdrop from a Mac.
chatState = .STT
}
}
}
else if chatState == .STT {
} else if chatState == .STT {
var (transcription, endpoint) = try self.cheetah!.process(frame)
if endpoint {
transcription += "\(try self.cheetah!.flush())"
Expand Down

0 comments on commit 7b565d1

Please sign in to comment.