Skip to content

Commit 196afc1

Browse files
committed
fix(decoder): remove unused methods and members in wrapper
1 parent 1b4d3ac commit 196afc1

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

optimum/neuron/models/inference/backend/modules/decoder/decoder_wrapper.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
import logging
16-
import os
1716

1817
import torch
1918
import torch.nn.functional as F
@@ -98,15 +97,6 @@ def __init__(
9897

9998
self.model_cls = model_cls
10099
self.model = None
101-
self.is_compiled = False
102-
self.serialize_base_path = None
103-
104-
base_compile_work_dir = os.environ.get("BASE_COMPILE_WORK_DIR", "/tmp/nxd_model/")
105-
self.compiler_workdir = os.path.join(base_compile_work_dir, self.tag)
106-
107-
def load_state_dict(self, state_dict, strict: bool = True, assign: bool = False):
108-
self.model = self.model_cls(self.config, self.neuron_config)
109-
self.model.load_state_dict(state_dict, strict=strict, assign=assign)
110100

111101
def input_generator(
112102
self,
@@ -226,10 +216,6 @@ def pad_to_max_compiled_seq(self, *args):
226216

227217
return args
228218

229-
def _get_async_output(self, ranked_async_tensor):
230-
outputs = [[async_tensor[0].cpu()] for async_tensor in ranked_async_tensor]
231-
return outputs[0][0]
232-
233219
def forward(self, input_ids, attention_mask, position_ids, seq_ids, sampling_params):
234220
input_ids, attention_mask, position_ids, seq_ids = self.convert_int64_to_int32(
235221
input_ids, attention_mask, position_ids, seq_ids

0 commit comments

Comments
 (0)