File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -364,11 +364,6 @@ inline void signal_handler(int signal) {
364
364
shutdown_handler (signal);
365
365
}
366
366
367
- std::string format_model_id (std::filesystem::path path) {
368
- std::string stem = path.stem ();
369
- return stem;
370
- }
371
-
372
367
int main (int argc, const char ** argv) {
373
368
int default_n_threads = std::max ((int )std::thread::hardware_concurrency (), 1 );
374
369
int default_http_threads = std::max ((int )std::thread::hardware_concurrency () - 1 , 3 );
@@ -451,7 +446,7 @@ int main(int argc, const char ** argv) {
451
446
if (std::filesystem::is_directory (model_path)) {
452
447
for (auto const &entry : std::filesystem::directory_iterator (model_path)) {
453
448
if (!entry.is_directory ()) {
454
- const std::string id = format_model_id ( entry.path ());
449
+ const std::string id = entry.path (). stem ( );
455
450
model_map[id] = entry.path ().string ();
456
451
}
457
452
}
@@ -461,7 +456,7 @@ int main(int argc, const char ** argv) {
461
456
}
462
457
} else {
463
458
const std::filesystem::path path = model_path;
464
- model_map[format_model_id ( path)] = path;
459
+ model_map[path. stem ( )] = path;
465
460
}
466
461
auto model_creation = std::chrono::duration_cast<std::chrono::seconds>(
467
462
std::chrono::system_clock::now ().time_since_epoch ())
You can’t perform that action at this time.
0 commit comments