Skip to content

Commit

Permalink
fix malloc
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaarbonel committed Nov 4, 2024
1 parent bfad042 commit 4dd2d66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ namespace whisper_server {
size_t available_memory = 0;
size_t total_memory = 0;
cudaMemGetInfo( & available_memory, & total_memory);
return std::max(1, static_cast < int > (available_memory / MODEL_MEMORY_USAGE));
int calculated_instances = static_cast<int>(available_memory / MODEL_MEMORY_USAGE);
return std::max(1, std::min(17, calculated_instances));
#elif defined(__APPLE__)
// Fixed number for Apple devices
return 8;
Expand Down

0 comments on commit 4dd2d66

Please sign in to comment.