Skip to content

chore: update dependencies#39

Open
Platohykj wants to merge 1 commit intoyourh:masterfrom
Platohykj:update_env
Open

chore: update dependencies#39
Platohykj wants to merge 1 commit intoyourh:masterfrom
Platohykj:update_env

Conversation

@Platohykj
Copy link

This pull request introduces several improvements to ensure compatibility with recent versions of Python, PyTorch, and scikit-learn, and enhances device management and data loading throughout the AttentionXML codebase. The most significant changes include adding allow_pickle=True to all relevant np.load calls, updating PyTorch and scikit-learn API usage for backward and forward compatibility, and improving device handling for both CPU and GPU environments.

Compatibility and Device Management Updates:

  • Added allow_pickle=True to all np.load calls across the codebase to support loading objects saved with pickling, preventing errors with newer numpy versions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Improved device management by dynamically selecting CUDA or CPU throughout the model and module classes, ensuring the code runs correctly regardless of hardware availability. [1] [2] [3] [4]

API and Backward Compatibility Fixes:

  • Updated PyTorch API usage to use the new alpha and value keyword arguments in tensor operations, and ensured correct handling of .item() for scalar tensors. [1] [2] [3]
  • Modified scikit-learn MultiLabelBinarizer usage to handle changes in module paths and initialization, improving backward compatibility. [1] [2]

Model and Data Pipeline Improvements:

  • Updated embedding initialization and data handling in modules.py for better compatibility with PyTorch 2.x and improved padding/masking logic. [1] [2] [3] [4]
  • Refined data loading and preprocessing functions to ensure robust handling of vocabularies and datasets. [1] [2] [3]

Documentation and Installation:

  • Updated the README.md with a new installation section, including instructions for installing the latest version of PyTorch and using a requirements.txt file, replacing the old requirements list.

These changes collectively modernize the codebase, improve its robustness across environments, and make it easier to set up and run.

Copilot AI review requested due to automatic review settings December 15, 2025 16:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

1 participant