Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'device' #19

Open
WindChimeRan opened this issue May 9, 2024 · 0 comments
Open

AttributeError: 'NoneType' object has no attribute 'device' #19

WindChimeRan opened this issue May 9, 2024 · 0 comments

Comments

@WindChimeRan
Copy link

I tried to finetune GoLLIE-7b on crossner-ai.

bash bash_scripts/generate_data.sh
bash bash_scripts/GoLLIE-7B_CodeLLaMA.sh 

I only trimmed the yaml to below:

train_tasks:
  - crossner.crossner_ai
validation_tasks:
  - crossner.crossner_ai
test_tasks:
  - crossner.crossner_ai

I got this error:

GoLLIE/src/model/patch_models/modeling_flash_llama.py", line 178, in _update_cos_sin_cache
    or self._cos_cached.device != device
AttributeError: 'NoneType' object has no attribute 'device'

self._cos_cached = None
self._sin_cached = None
self._cos_k_cached = None
self._sin_k_cached = None
def _compute_inv_freq(self, device=None):
return 1 / (self.base ** (torch.arange(0, self.dim, 2, device=device, dtype=torch.float32) / self.dim))
def _update_cos_sin_cache(self, seqlen, device=None, dtype=None):
# Reset the tables if the sequence length has changed,
# if we're on a new device (possibly due to tracing for instance),
# or if we're switching from inference mode to training
if (
seqlen > self._seq_len_cached
or self._cos_cached.device != device
or self._cos_cached.dtype != dtype
or (self.training and self._cos_cached.is_inference())
):

I checked the code, and the self._cos_cached is indeed None in the init ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant