formatting

(requested in codereview)
This commit is contained in:
divinity76 2024-01-29 10:06:12 +01:00 committed by GitHub
parent 6c348978c7
commit 0fcdefc346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -237,21 +237,15 @@ int main(int argc, char ** argv) {
if (!path_session.empty()) { if (!path_session.empty()) {
LOG_TEE("%s: attempting to load saved session from '%s'\n", __func__, path_session.c_str()); LOG_TEE("%s: attempting to load saved session from '%s'\n", __func__, path_session.c_str());
if (!file_exists(path_session)) if (!file_exists(path_session)) {
{
LOG_TEE("%s: session file does not exist, will create.\n", __func__); LOG_TEE("%s: session file does not exist, will create.\n", __func__);
} } else if (file_size(path_session) == 0) {
else if (file_size(path_session) == 0)
{
LOG_TEE("%s: The session file is empty. A new session will be initialized.\n", __func__); LOG_TEE("%s: The session file is empty. A new session will be initialized.\n", __func__);
} } else {
else
{
// The file exists and is not empty // The file exists and is not empty
session_tokens.resize(n_ctx); session_tokens.resize(n_ctx);
size_t n_token_count_out = 0; size_t n_token_count_out = 0;
if (!llama_load_session_file(ctx, path_session.c_str(), session_tokens.data(), session_tokens.capacity(), &n_token_count_out)) if (!llama_load_session_file(ctx, path_session.c_str(), session_tokens.data(), session_tokens.capacity(), &n_token_count_out)) {
{
LOG_TEE("%s: error: failed to load session file '%s'\n", __func__, path_session.c_str()); LOG_TEE("%s: error: failed to load session file '%s'\n", __func__, path_session.c_str());
return 1; return 1;
} }