Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrilvallez committed Dec 20, 2024
1 parent 2464914 commit 5ab34ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/transformers/models/phi3/modeling_phi3.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.


from typing import Callable, List, Optional, Tuple, Union

import torch
Expand Down
19 changes: 11 additions & 8 deletions src/transformers/models/phi3/modular_phi3.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# limitations under the License.

"""PyTorch Phi-3 model."""
from typing import Callable, List, Optional, Tuple

from typing import Callable, Optional, Tuple

import torch
import torch.utils.checkpoint
Expand All @@ -26,12 +27,17 @@
from ...modeling_utils import ALL_ATTENTION_FUNCTIONS
from ...processing_utils import Unpack
from ...utils import logging

from ...utils import logging
from ..mistral.modeling_mistral import (
MistralDecoderLayer,
MistralForCausalLM,
MistralForSequenceClassification,
MistralForTokenClassification,
MistralPreTrainedModel,
apply_rotary_pos_emb,
eager_attention_forward,
)
from .configuration_phi3 import Phi3Config

from ..mistral.modeling_mistral import MistralDecoderLayer, MistralPreTrainedModel, MistralForCausalLM, MistralForSequenceClassification, MistralForTokenClassification, eager_attention_forward, apply_rotary_pos_emb


logger = logging.get_logger(__name__)

Expand Down Expand Up @@ -209,7 +215,6 @@ class Phi3PreTrainedModel(MistralPreTrainedModel):
_version = "0.0.5"



class Phi3ForCausalLM(MistralForCausalLM, Phi3PreTrainedModel):
def prepare_inputs_for_generation(
self,
Expand Down Expand Up @@ -257,5 +262,3 @@ class Phi3ForSequenceClassification(MistralForSequenceClassification):

class Phi3ForTokenClassification(MistralForTokenClassification):
pass


0 comments on commit 5ab34ba

Please sign in to comment.