From 98aa18478670a54073f3dd0597437a91b322778a Mon Sep 17 00:00:00 2001 From: Zhenzhong1 Date: Tue, 12 Mar 2024 04:00:39 -0700 Subject: [PATCH] cleancode --- neural_speed/__init__.py | 4 +--- neural_speed/application/pybind_gptj.cpp | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/neural_speed/__init__.py b/neural_speed/__init__.py index 13ca02430..dda41c270 100644 --- a/neural_speed/__init__.py +++ b/neural_speed/__init__.py @@ -234,9 +234,7 @@ def get_scratch_size_ratio(size): ctx_size = generate_kwargs.get("ctx_size") if ctx_size > max_seq_length: - print( - f'max_seq_length is {max_seq_length}, but ctx_size is {ctx_size}. Please reduce ctx_size in model.generate' - ) + print(f'max_seq_length is {max_seq_length}, but ctx_size is {ctx_size}. Please reduce ctx_size.') exit(0) if max_seq_length > 2048 and max_seq_length <= 4096: diff --git a/neural_speed/application/pybind_gptj.cpp b/neural_speed/application/pybind_gptj.cpp index 101a14e4a..f98dc7a0a 100644 --- a/neural_speed/application/pybind_gptj.cpp +++ b/neural_speed/application/pybind_gptj.cpp @@ -36,8 +36,7 @@ static model_context** g_ctx; bool gptj_model_eval_ids(model_context* ctx, model_token* tokens, size_t n_eval, size_t n_past, size_t n_threads) { const int n_ctx = model_n_ctx(ctx); if (static_cast(n_eval) > n_ctx) { - fprintf(stderr, "%s: error: prompt is too long (%d tokens, max %d)\n", __func__, static_cast(n_eval), - n_ctx); + fprintf(stderr, "%s: error: prompt is too long (%d tokens, max %d)\n", __func__, static_cast(n_eval), n_ctx); return true; }