Skip to content

Commit

Permalink
Fix failing tests on main
Browse files Browse the repository at this point in the history
Unrelated to this PR: opts.data was renamed to opts.tasks
  • Loading branch information
Waino committed Oct 2, 2023
1 parent 1ad2d0b commit 0b69de6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions mammoth/tests/test_task_distribution_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def test_weights_all_zero():
opts = Namespace(data={
opts = Namespace(tasks={
'a': {
'weight': 0,
'introduce_at_training_step': 0,
Expand All @@ -25,7 +25,7 @@ def test_weights_all_zero():


def test_weights_all_postponed():
opts = Namespace(data={
opts = Namespace(tasks={
'a': {
'weight': 1,
'introduce_at_training_step': 1,
Expand All @@ -45,7 +45,7 @@ def test_weights_all_postponed():


def test_invalid_curriculum():
opts = Namespace(data={
opts = Namespace(tasks={
# 'a' disabled by weight
'a': {
'weight': 0,
Expand All @@ -67,7 +67,7 @@ def test_invalid_curriculum():


def test_sampling_task_distribution_strategy():
opts = Namespace(data={
opts = Namespace(tasks={
# 'a' disabled by weight
'a': {
'weight': 0,
Expand Down
8 changes: 4 additions & 4 deletions mammoth/tests/test_task_queue_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_init_minimal():
'gpu_ranks': [0, 1],
'enc_layers': [1],
'dec_layers': [1],
'data': {
'tasks': {
'train_a-b': {'path_src': 'dummy', 'path_tgt': 'dummy', 'src_tgt': 'a-b'},
'train_c-d': {'path_src': 'dummy', 'path_tgt': 'dummy', 'src_tgt': 'c-d'},
}
Expand Down Expand Up @@ -52,7 +52,7 @@ def create_basic_task_queue_manager():
# enc_sharing_group x is twice, on two devices 0:0 and 0:1
# dec_sharing_group y is twice, on two devices 0:0 and 1:0
# dec_sharing_group yy is twice, but only on a single device 0:1
'data': {
'tasks': {
'train_0_a-b': {
'path_src': 'dummy',
'path_tgt': 'dummy',
Expand Down Expand Up @@ -183,7 +183,7 @@ def test_cpu_distributed_groups():
'n_nodes': 1,
'enc_layers': [1],
'dec_layers': [1],
'data': {
'tasks': {
'train_a-b': {
'path_src': 'dummy',
'path_tgt': 'dummy',
Expand Down Expand Up @@ -221,7 +221,7 @@ def test_distributed_groups_no_encoder_group():
'dec_layers': [1],
'gpu_ranks': [0, 1],
# every language pair on its own gpu: no overlap
'data': {
'tasks': {
'train_a-b': {
'path_src': 'dummy',
'path_tgt': 'dummy',
Expand Down

0 comments on commit 0b69de6

Please sign in to comment.