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

Feat/add support for numpy datatypes in tokensloader #401

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented Oct 27, 2024

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

Fixes #400.

  • Feature: Add support for numpy datatypes in TokensLoader

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@bhimrazy bhimrazy added the enhancement New feature or request label Oct 27, 2024
@bhimrazy bhimrazy self-assigned this Oct 27, 2024
@bhimrazy bhimrazy marked this pull request as draft October 27, 2024 19:33
Copy link

codecov bot commented Oct 27, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 78%. Comparing base (a9cf751) to head (c5d6f03).

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #401   +/-   ##
===================================
  Coverage    78%    78%           
===================================
  Files        34     34           
  Lines      5045   5052    +7     
===================================
+ Hits       3954   3960    +6     
- Misses     1091   1092    +1     

data = torch.frombuffer(buffer, dtype=self._dtype, count=self._block_size, offset=offset)
else:
data = np.frombuffer(buffer, dtype=self._dtype, count=self._block_size, offset=offset)
data = torch.from_numpy(data)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to return numpy as this is the format the user provided.

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

Successfully merging this pull request may close these issues.

Feature: Add support for numpy datatypes in TokensLoader
2 participants