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

Fix Concatenate Compatibility #1781

Merged
merged 1 commit into from
Oct 19, 2023
Merged

Fix Concatenate Compatibility #1781

merged 1 commit into from
Oct 19, 2023

Conversation

Satrat
Copy link
Contributor

@Satrat Satrat commented Oct 19, 2023

Replacing torch.concatenate calls with torch.cat, they are the same function but concatenate is an alias that doesn't exist in earlier versions of pytorch.

Before on torch 1.12.0

Traceback (most recent call last):
  File "src/sparseml/transformers/sparsification/obcq/obcq.py", line 167, in <module>
    one_shot(
  File "src/sparseml/transformers/sparsification/obcq/obcq.py", line 89, in one_shot
    dataset = TransformersDataset.load_from_registry(
  File "/home/michael/sml/lib/python3.8/site-packages/sparsezoo/utils/registry.py", line 120, in load_from_registry
    return constructor(**constructor_kwargs)
  File "/home/michael/code/sparseml/src/sparseml/transformers/data/open_platypus.py", line 68, in __init__
    self.create_dataloader(processed_data)
  File "/home/michael/code/sparseml/src/sparseml/transformers/data/base_llm.py", line 94, in create_dataloader
    tokenized_sample = self._add_end_token(tokenized_sample)
  File "/home/michael/code/sparseml/src/sparseml/transformers/data/base_llm.py", line 103, in _add_end_token
    tokenized_sample = torch.concatenate(
AttributeError: module 'torch' has no attribute 'concatenate'

After

OBCQ script runs successfully

@Satrat Satrat merged commit 05a300f into main Oct 19, 2023
11 checks passed
@Satrat Satrat deleted the fix_cat branch October 19, 2023 20:15
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

Successfully merging this pull request may close these issues.

None yet

3 participants