Skip to content

Commit 9d9e38f

Browse files
teejaeiThalay
authored andcommitted
server : use OS-generated temp file name for converted files (ggml-org#2419)
1 parent 6a62717 commit 9d9e38f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/server/server.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ int main(int argc, char ** argv) {
677677
if (sparams.ffmpeg_converter) {
678678
// if file is not wav, convert to wav
679679
// write to temporary file
680-
const std::string temp_filename = "whisper_server_temp_file.wav";
680+
const std::string temp_filename_base = std::tmpnam(nullptr);
681+
const std::string temp_filename = temp_filename_base + ".wav";
681682
std::ofstream temp_file{temp_filename, std::ios::binary};
682683
temp_file << audio_file.content;
683684
temp_file.close();

0 commit comments

Comments
 (0)