diff --git a/examples/huggingface/pytorch/question-answering/pruning/group_lasso/modeling.py b/examples/huggingface/pytorch/question-answering/pruning/group_lasso/modeling.py index ff0397a2368e..8731dcd2184c 100644 --- a/examples/huggingface/pytorch/question-answering/pruning/group_lasso/modeling.py +++ b/examples/huggingface/pytorch/question-answering/pruning/group_lasso/modeling.py @@ -601,7 +601,7 @@ def forward(self, sequence_output, pooled_output): class BertPreTrainedModel(nn.Module): """ An abstract class to handle weights initialization and - a simple interface for dowloading and loading pretrained models. + a simple interface for downloading and loading pretrained models. """ def __init__(self, config, *inputs, **kwargs): super(BertPreTrainedModel, self).__init__() @@ -663,7 +663,7 @@ def from_pretrained(cls, pretrained_model_name_or_path, state_dict=None, cache_d . `model.chkpt` a TensorFlow checkpoint from_tf: should we load the weights from a locally saved TensorFlow checkpoint cache_dir: an optional path to a folder in which the pre-trained models will be cached. - state_dict: an optional state dictionnary (collections.OrderedDict object) to use instead of Google pre-trained models + state_dict: an optional state dictionary (collections.OrderedDict object) to use instead of Google pre-trained models *inputs, **kwargs: additional input for the specific Bert class (ex: num_labels for BertForSequenceClassification) """ diff --git a/intel_extension_for_transformers/llm/runtime/graph/__init__.py b/intel_extension_for_transformers/llm/runtime/graph/__init__.py index af3c79e47fdb..85ba32b911e7 100644 --- a/intel_extension_for_transformers/llm/runtime/graph/__init__.py +++ b/intel_extension_for_transformers/llm/runtime/graph/__init__.py @@ -65,7 +65,7 @@ def __import_package(self, model_type): elif model_type == "mistral": import intel_extension_for_transformers.llm.runtime.graph.mistral_cpp as cpp_model else: - raise TypeError("Unspported model type {}!".format(model_type)) + raise TypeError("Unsupported model type {}!".format(model_type)) self.module = cpp_model @staticmethod @@ -212,7 +212,7 @@ def eos_token_id(self): if self.model_type == 'qwen': return self.tokenizer.special_tokens['<|endoftext|>'] return self.tokenizer.eos_token_id - + def pad_token_id(self): if self.tokenizer.pad_token_id == None: if self.batch_size == 1: diff --git a/intel_extension_for_transformers/llm/runtime/graph/developer_document.md b/intel_extension_for_transformers/llm/runtime/graph/developer_document.md index fef2fc4702b0..628437f8e14f 100644 --- a/intel_extension_for_transformers/llm/runtime/graph/developer_document.md +++ b/intel_extension_for_transformers/llm/runtime/graph/developer_document.md @@ -79,8 +79,8 @@ graph LR; We need to implement corresponding serialization methods from pytorch format, which is mainly divided into the following three steps. -## 1.1. Hyperparamters -The term **"hyperparamters"** describes a value that is used to configure the behavior of a large language model; this is in contrast to the model's parameters, which are the weight that were derived in the training process that was used to create the model. Each model defines its own hyperparameter structure that defines the hyperparameter values accepted by that model. Valid ITREX graph files must list these values in the correct order, and each value must be represented using the correct data type. Although hyperparameters are different across models, some attributes appear in the hyperparameters for most models: +## 1.1. Hyperparameters +The term **"hyperparameters"** describes a value that is used to configure the behavior of a large language model; this is in contrast to the model's parameters, which are the weight that were derived in the training process that was used to create the model. Each model defines its own hyperparameter structure that defines the hyperparameter values accepted by that model. Valid ITREX graph files must list these values in the correct order, and each value must be represented using the correct data type. Although hyperparameters are different across models, some attributes appear in the hyperparameters for most models: - n_vocab: the size of the model's vocabulary - n_embd: the size of the model's " embedding layer", which is used during prompt ingestion. - n_layer: the number of layers in the model; each layer represents a set of weights. @@ -328,7 +328,7 @@ Most of our model examples only support single prompt processing. You need to ad +set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON) +target_link_libraries(${TARGET} PUBLIC ne_layers jblas::jblas) ``` - and and new_model to [models_CMakeLists.txt](https://github.com/intel/intel-extension-for-transformers/blob/main/intel_extension_for_transformers/llm/runtime/graph/models/CMakeLists.txt). + and new_model to [models_CMakeLists.txt](https://github.com/intel/intel-extension-for-transformers/blob/main/intel_extension_for_transformers/llm/runtime/graph/models/CMakeLists.txt). ```diff add_subdirectory(opt) add_subdirectory(bloom)