How to use the ctranslate2.specs.common_spec.EmbeddingsSpec function in ctranslate2

To help you get started, we’ve selected a few ctranslate2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenNMT / CTranslate2 / python / ctranslate2 / specs / transformer_spec.py View on Github external
def __init__(self, num_layers):
        self.embeddings = common_spec.EmbeddingsSpec()
        self.position_encodings = PositionEncoderSpec()
        self.layer_norm = common_spec.LayerNormSpec()
        self.layer = [TransformerEncoderLayerSpec() for _ in range(num_layers)]
github OpenNMT / CTranslate2 / python / ctranslate2 / specs / transformer_spec.py View on Github external
def __init__(self, num_layers):
        self.embeddings = common_spec.EmbeddingsSpec()
        self.position_encodings = PositionEncoderSpec()
        self.layer_norm = common_spec.LayerNormSpec()
        self.projection = common_spec.LinearSpec()
        self.layer = [
            TransformerDecoderLayerSpec() for _ in range(num_layers)]