mlnomad commited on
Commit
df539cd
·
verified ·
1 Parent(s): e955e90

Fix HF dynamic_module_utils: replace `from ..X` with `from torch_port.X` (try) + bare `from X` (except)

Browse files
Files changed (1) hide show
  1. modeling_gelu_gpt.py +3 -3
modeling_gelu_gpt.py CHANGED
@@ -25,10 +25,10 @@ from transformers.generation import GenerationMixin
25
 
26
  try:
27
  from .configuration_gelu_gpt import GeluGPTConfig
 
 
 
28
  from torch_port.torch_gpt import GELU_GPT, GPTConfig, rms_norm, apply_rotary_emb, has_ve, compute_window_sizes
29
- except ImportError: # when loaded as flat files via trust_remote_code
30
- from configuration_gelu_gpt import GeluGPTConfig
31
- from torch_gpt import GELU_GPT, GPTConfig, rms_norm, apply_rotary_emb, has_ve, compute_window_sizes
32
 
33
 
34
  def _kvcache_attn(
 
25
 
26
  try:
27
  from .configuration_gelu_gpt import GeluGPTConfig
28
+ from .torch_gpt import GELU_GPT, GPTConfig, rms_norm, apply_rotary_emb, has_ve, compute_window_sizes
29
+ except ImportError:
30
+ from torch_port.gelu.configuration_gelu_gpt import GeluGPTConfig
31
  from torch_port.torch_gpt import GELU_GPT, GPTConfig, rms_norm, apply_rotary_emb, has_ve, compute_window_sizes
 
 
 
32
 
33
 
34
  def _kvcache_attn(