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

Bug fixes, Runtime & Performance optimization #332

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Jul 1, 2024

  1. Bug fixes

    Constructor (__init__ method):
    
    Added type checks and proper exception handling.
    Simplified repeated block creation using loops.
    Forward Method:
    
    Simplified the forward pass to ensure all operations are clear and efficient.
    General Code Clean-up:
    
    Removed redundant checks and code.
    Ensured all methods and attributes are clear and logically ordered.
    DrHazemAli authored Jul 1, 2024
    Configuration menu
    Copy the full SHA
    a73b02c View commit details
    Browse the repository at this point in the history
  2. Fix runtime crashes.

    Initialization:
    
    Added error handling for the init(mergesAt:vocabularyAt:) initializer.
    Removed force unwrapping to avoid runtime crashes.
    Tokenization:
    
    Simplified the tokenization process and ensured that padding is handled efficiently.
    Optimized the encode function for better performance by reducing redundant operations.
    Pair and Update Functions:
    
    Optimized pairs(for:) to use zip for creating pairs.
    Improved update(_:merging:) to handle edge cases more effectively and avoid unnecessary computations.
    Helper Functions:
    
    Added static helper functions for reading merges and vocabulary with proper error handling.
    DrHazemAli authored Jul 1, 2024
    Configuration menu
    Copy the full SHA
    08400d4 View commit details
    Browse the repository at this point in the history