Skip to content

Commit 91db569

Browse files
committed
fixed config
1 parent 7400026 commit 91db569

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ts/torch_handler/distributed/base_neuronx_microbatching_handler.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def preprocess(self, requests):
151151
)
152152

153153
# Pad input to match compiled model batch size
154-
inputs.extend([""] * (self.handle.micro_batch_size - len(inputs)))
154+
inputs.extend(
155+
[""] * (self.micro_batching_handle.micro_batch_size - len(inputs))
156+
)
155157

156158
return self.tokenizer(inputs, return_tensors="pt", padding=True)
157159

@@ -165,7 +167,7 @@ def inference(self, inputs):
165167
thread = Thread(target=self.model.generate, kwargs=generation_kwargs)
166168
thread.start()
167169

168-
micro_batch_idx = self.handle.get_micro_batch_idx()
170+
micro_batch_idx = self.micro_batching_handle.get_micro_batch_idx()
169171
micro_batch_req_id_map = self.get_micro_batch_req_id_map(micro_batch_idx)
170172
for new_text in self.output_streamer:
171173
send_intermediate_predict_response(

0 commit comments

Comments
 (0)