mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-08-25 22:21:14 +02:00
setenv return int
This commit is contained in:
+4
-3
@@ -403,12 +403,13 @@ extern "C"
|
||||
return gpttype_clear_state_kv(true);
|
||||
}
|
||||
|
||||
void set_environment_variable(const char * identifier, const char * value)
|
||||
int set_environment_variable(const char * identifier, const char * value)
|
||||
{
|
||||
if (!identifier || !value) return -1;
|
||||
#ifdef _WIN32
|
||||
_putenv_s(identifier, value);
|
||||
return _putenv_s(identifier, value);
|
||||
#else
|
||||
setenv(identifier, value, 1);
|
||||
return setenv(identifier, value, 1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,6 +949,8 @@ def init_library():
|
||||
handle.last_logprobs.restype = last_logprobs_outputs
|
||||
handle.detokenize.argtypes = [token_count_outputs]
|
||||
handle.detokenize.restype = ctypes.c_char_p
|
||||
handle.set_environment_variable.restype = ctypes.c_int
|
||||
handle.set_environment_variable.argtypes = [ctypes.c_char_p, ctypes.c_char_p]
|
||||
|
||||
def set_backend_props(inputs):
|
||||
# we must force an explicit tensor split
|
||||
|
||||
Reference in New Issue
Block a user