Fix build with RPC not enabled (#1025)

Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
This commit is contained in:
Kawrakow
2025-11-30 19:04:54 +01:00
committed by GitHub
parent 15771072c7
commit 02b717c8c6

View File

@@ -272,6 +272,7 @@ static std::string parse_device_list(const std::string& value) {
static std::string add_rpc_devices(std::string& servers) {
std::string rpc_devices;
#ifdef GGML_USE_RPC
std::vector<std::string> rpc_servers = string_split(servers, ",");
if (rpc_servers.empty()) {
throw std::invalid_argument("no RPC servers specified");
@@ -290,6 +291,7 @@ static std::string add_rpc_devices(std::string& servers) {
if (!rpc_devices.empty()) {
rpc_devices = rpc_devices.substr(0, rpc_devices.size() - 1); // remove trailing comma
}
#endif
return rpc_devices;
}