pymllm.convertor.model_file_v2¶
Attributes¶
Classes¶
Module Contents¶
- pymllm.convertor.model_file_v2.MLLM_MODEL_FILE_V2_MAGIC_NUMBER = 20890¶
- pymllm.convertor.model_file_v2.MLLM_MODEL_FILE_V2_VERSION = 2¶
- pymllm.convertor.model_file_v2.MLLM_MODEL_FILE_V2_MODEL_NAME_LENGTH = 512¶
- pymllm.convertor.model_file_v2.MLLM_MODEL_FILE_V2_PARAMS_NAME_LENGTH = 256¶
- pymllm.convertor.model_file_v2.MLLM_MODEL_FILE_V2_TENSOR_SHAPE_LENGTH = 16¶
- class pymllm.convertor.model_file_v2.ModelFileV2Descriptor(model_name, num_params)¶
- Parameters:
model_name (str)
num_params (int)
- SIZE = 532¶
- magic = 20890¶
- version = 2¶
- model_name¶
- num_params¶
- params_desc_offset = 0¶
- class pymllm.convertor.model_file_v2.ModelFileV2ParamsDescriptor(param_id, param_type, param_size, param_offset, shape, name)¶
- Parameters:
param_id (int)
param_type (int)
param_size (int)
param_offset (int)
shape (List[int])
name (str)
- SIZE = 352¶
- param_id¶
- param_type¶
- param_size¶
- param_offset¶
- shape_len¶
- shape¶
- name¶
- class pymllm.convertor.model_file_v2.ModelFileV2(file_path, model_name, update_mode='Static', **kwargs)¶
- file_path¶
- model_name¶
- update_mode = 'Static'¶
- v2_param_descriptor: List[ModelFileV2ParamsDescriptor] = []¶
- v2_file_header¶
- file_handler¶
- streaming_write(tensor_name, tensor_obj)¶
- static_write(tensor_obj)¶
- finalize()¶