Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
cleancode
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhenzhong1 committed Mar 12, 2024
1 parent 0d79450 commit 98aa184
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions neural_speed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions neural_speed/application/pybind_gptj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(n_eval) > n_ctx) {
fprintf(stderr, "%s: error: prompt is too long (%d tokens, max %d)\n", __func__, static_cast<int>(n_eval),
n_ctx);
fprintf(stderr, "%s: error: prompt is too long (%d tokens, max %d)\n", __func__, static_cast<int>(n_eval), n_ctx);
return true;
}

Expand Down

0 comments on commit 98aa184

Please sign in to comment.