Skip to content

fix: update device handling in OpusMtEnESTransformer#284

Merged
cristian-tamblay merged 1 commit into
developfrom
fix/hide-gpu-when-unavailable
Sep 5, 2025
Merged

fix: update device handling in OpusMtEnESTransformer#284
cristian-tamblay merged 1 commit into
developfrom
fix/hide-gpu-when-unavailable

Conversation

@Irozuku
Copy link
Copy Markdown
Collaborator

@Irozuku Irozuku commented Sep 4, 2025

Improve Device Selection in OpusMtEnESTransformerSchema

This pull request updates the OpusMtEnESTransformerSchema in opus_mt_en_es_transformer.py to dynamically detect and enumerate available hardware devices (CPU and CUDA GPUs) for model training. This makes the device selection more robust and reflective of the actual environment, improving usability and reducing configuration errors.

Device Selection Improvements

  • Added dynamic detection of available CUDA devices using torch, and updated the DEVICE_ENUM and DEVICE_PLACEHOLDER variables to reflect the actual hardware present.
  • Updated the device field in the OpusMtEnESTransformerSchema to use the dynamically determined DEVICE_ENUM and DEVICE_PLACEHOLDER instead of hardcoded values.

Before (without cuda)

image

After (without cuda)

image

@cristian-tamblay cristian-tamblay merged commit c81d0e6 into develop Sep 5, 2025
4 checks passed
@cristian-tamblay cristian-tamblay deleted the fix/hide-gpu-when-unavailable branch September 5, 2025 16:13
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.

2 participants