File tree Expand file tree Collapse file tree 4 files changed +5
-3
lines changed Expand file tree Collapse file tree 4 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -1187,6 +1187,7 @@ def create_predictor(
1187
1187
1188
1188
tensor_parallel_rank , tensor_parallel_degree = init_dist_env ()
1189
1189
if not predictor_args .inference_model :
1190
+ tokenizer .padding_side = "left"
1190
1191
if predictor_args .mode == "dynamic" :
1191
1192
if model_args .model_type == "gpt-3" :
1192
1193
sys .path .append ("./gpt-3" )
Original file line number Diff line number Diff line change @@ -1059,10 +1059,8 @@ def greedy_search(
1059
1059
1060
1060
# pre-process distribution
1061
1061
next_token_logits = self .adjust_logits_during_generation (next_token_logits )
1062
- next_tokens_scores = logits_processors (input_ids , next_token_logits )
1062
+ probs = logits_processors (input_ids , next_token_logits )
1063
1063
# greedy
1064
- probs = F .softmax (next_tokens_scores )
1065
- probs = paddle .log (probs )
1066
1064
next_tokens = paddle .argmax (probs , axis = - 1 ).unsqueeze (- 1 )
1067
1065
next_scores = paddle .index_sample (probs , next_tokens )
1068
1066
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ def __init__(
70
70
self ,
71
71
vocab_file ,
72
72
errors = "replace" ,
73
+ padding_side = "left" ,
73
74
** kwargs ,
74
75
):
75
76
super ().__init__ (** kwargs )
Original file line number Diff line number Diff line change 26
26
ChatGLMForCausalLM ,
27
27
ChatGLMv2ForCausalLM ,
28
28
LlamaForCausalLM ,
29
+ QWenForCausalLM ,
29
30
)
30
31
from paddlenlp .utils .downloader import (
31
32
COMMUNITY_MODEL_PREFIX ,
43
44
["__internal_testing__/tiny-fused-bloom" , BloomForCausalLM ],
44
45
["__internal_testing__/tiny-fused-chatglm" , ChatGLMForCausalLM ],
45
46
["__internal_testing__/tiny-fused-chatglm2" , ChatGLMv2ForCausalLM ],
47
+ ["__internal_testing__/tiny-fused-qwen" , QWenForCausalLM ],
46
48
],
47
49
)
48
50
class PredictorTest (LLMTest , unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments