Skip to content

Commit

Permalink
add header
Browse files Browse the repository at this point in the history
Signed-off-by: Yu Chin Fabian Lim <[email protected]>
  • Loading branch information
fabianlim committed Jun 21, 2024
1 parent e7cf860 commit 797c1e4
Show file tree
Hide file tree
Showing 45 changed files with 135 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/instructlab/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Local
from .hf_models import GPTDolomiteConfig, GPTDolomiteModel
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/enums.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from enum import Enum

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/gradient_checkpointing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
import torch

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/gradient_checkpointing/block.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from functools import partial

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Local
from .model_conversion import export_to_huggingface, import_from_huggingface
from .models import GPTDolomiteConfig, GPTDolomiteForCausalLM, GPTDolomiteModel
Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
from transformers import PretrainedConfig

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/defaults.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
DEFAULT_NORMALIZATION_IMPLEMENTATION = "torch"
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/enums.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from enum import Enum

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
from transformers import AutoConfig

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
import shutil

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/model_conversion/llama.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
from transformers import AutoConfig, AutoTokenizer, GenerationConfig, LlamaConfig

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/modeling_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Local
from .activations import get_activation_function, is_glu
from .attention import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
import torch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# pylint: disable=consider-using-from-import
# Third Party
from transformers.activations import ACT2CLS, ClassInstantier
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
import torch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
import torch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import Tuple
import inspect
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import Tuple

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
from transformers import DynamicCache
import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import Tuple

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
from transformers import DynamicCache
import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import Tuple

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# pylint: disable=unused-import
# Third Party
from torch.nn import Embedding
Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/modeling_utils/linear.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# pylint: disable=unused-import
# Third Party
from torch.nn import Linear
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
import torch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
import torch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
import torch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
import numbers

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Local
from .alibi import Alibi
from .rope import RoPE, YaRNScaledRoPE, apply_rotary_pos_emb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
"""copied from BLOOM's code with some minor changes"""

# Standard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
"""Logic is copied from transformers.models.llama.modeling_utils with slight modifications"""

# Standard
Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Local
from .gpt_dolomite import GPTDolomiteConfig, GPTDolomiteForCausalLM, GPTDolomiteModel
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Local
from .base import GPTDolomiteModel, GPTDolomitePreTrainedModel
from .config import GPTDolomiteConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import List, Tuple, Union
import warnings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Local
from ...config import CommonConfig

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import Tuple, Union

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import List, Optional, Tuple, Union

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/models/gpt_dolomite/mlp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import Tuple

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/register_hf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Third Party
from transformers import AutoConfig, AutoModel, AutoModelForCausalLM

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/hf_models/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import List, Union

Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Local
from .hf_hub import download_repo
from .safetensors import SafeTensorsWeightsManager
Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/utils/hf_hub.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import Tuple
import os
Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/utils/safetensors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
import json
import os
Expand Down
3 changes: 3 additions & 0 deletions src/instructlab/dolomite/utils/wrapper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#------------------------------------------------------------------------------
# This code has been extracted from https://github.com/ibm-granite/dolomite-engine
#------------------------------------------------------------------------------
# Standard
from typing import List, Type

Expand Down

0 comments on commit 797c1e4

Please sign in to comment.