Skip to content

etils.configs

get_config(model_type, struct)

The get_config function takes in a model_type and struct, and returns the corresponding config.

Parameters:

Name Type Description Default
model_type str

str: Determine which model to use

required
struct str

str: Specify the structure of the model

required

Returns:

Type Description

A dictionary of hyperparameters

Source code in src/python/easydel/etils/configs.py
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
def get_config(model_type: str, struct: str):
    """
    The get_config function takes in a model_type and struct, and returns the corresponding config.

    :param model_type: str: Determine which model to use
    :param struct: str: Specify the structure of the model
    :return: A dictionary of hyperparameters

    """
    if model_type == "llama":
        return llama_configs[struct]
    elif model_type == "llama2":
        return llama_2_configs[struct]
    elif model_type == "opt":
        return opt_configs[struct]
    elif model_type == "gptj":
        return gptj_configs[struct]
    elif model_type == "falcon":
        return falcon_configs[struct]
    elif model_type == "mpt":
        return mpt_configs[struct]
    else:
        raise ValueError(f"Unknown ModelType : {model_type}")