Text Generation
English
Eval Results
zifei9 commited on
Commit
7f21a5e
1 Parent(s): c056808

absolute imports

Browse files
Files changed (2) hide show
  1. configuration_gpt2.py +4 -4
  2. modeling_gpt2.py +6 -6
configuration_gpt2.py CHANGED
@@ -17,10 +17,10 @@
17
  from collections import OrderedDict
18
  from typing import Any, List, Mapping, Optional
19
 
20
- from ... import PreTrainedTokenizer, TensorType, is_torch_available
21
- from ...configuration_utils import PretrainedConfig
22
- from ...onnx import OnnxConfigWithPast, PatchingSpec
23
- from ...utils import logging
24
 
25
 
26
  logger = logging.get_logger(__name__)
 
17
  from collections import OrderedDict
18
  from typing import Any, List, Mapping, Optional
19
 
20
+ from transformers import PreTrainedTokenizer, TensorType, is_torch_available
21
+ from transformers.configuration_utils import PretrainedConfig
22
+ from transformers.onnx import OnnxConfigWithPast, PatchingSpec
23
+ from transformers.utils import logging
24
 
25
 
26
  logger = logging.get_logger(__name__)
modeling_gpt2.py CHANGED
@@ -27,17 +27,17 @@ from torch import nn
27
  from torch.cuda.amp import autocast
28
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
29
 
30
- from ...activations import ACT2FN
31
- from ...modeling_outputs import (
32
  BaseModelOutputWithPastAndCrossAttentions,
33
  CausalLMOutputWithCrossAttentions,
34
  QuestionAnsweringModelOutput,
35
  SequenceClassifierOutputWithPast,
36
  TokenClassifierOutput,
37
  )
38
- from ...modeling_utils import PreTrainedModel, SequenceSummary
39
- from ...pytorch_utils import Conv1D, find_pruneable_heads_and_indices, prune_conv1d_layer
40
- from ...utils import (
41
  ModelOutput,
42
  add_code_sample_docstrings,
43
  add_start_docstrings,
@@ -45,7 +45,7 @@ from ...utils import (
45
  logging,
46
  replace_return_docstrings,
47
  )
48
- from ...utils.model_parallel_utils import assert_device_map, get_device_map
49
  from .configuration_gpt2 import GPT2Config
50
 
51
 
 
27
  from torch.cuda.amp import autocast
28
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
29
 
30
+ from transformers.activations import ACT2FN
31
+ from transformers.modeling_outputs import (
32
  BaseModelOutputWithPastAndCrossAttentions,
33
  CausalLMOutputWithCrossAttentions,
34
  QuestionAnsweringModelOutput,
35
  SequenceClassifierOutputWithPast,
36
  TokenClassifierOutput,
37
  )
38
+ from transformers.modeling_utils import PreTrainedModel, SequenceSummary
39
+ from transformers.pytorch_utils import Conv1D, find_pruneable_heads_and_indices, prune_conv1d_layer
40
+ from transformers.utils import (
41
  ModelOutput,
42
  add_code_sample_docstrings,
43
  add_start_docstrings,
 
45
  logging,
46
  replace_return_docstrings,
47
  )
48
+ from transformers.utils.model_parallel_utils import assert_device_map, get_device_map
49
  from .configuration_gpt2 import GPT2Config
50
 
51