diff --git a/.github/workflows/slack-report.yml b/.github/workflows/slack-report.yml index d4926594bb45ee..61da83681ba158 100644 --- a/.github/workflows/slack-report.yml +++ b/.github/workflows/slack-report.yml @@ -58,6 +58,7 @@ jobs: # Upload complete failure tables, as they might be big and only truncated versions could be sent to Slack. - name: Failure table artifacts + # Only the model testing job is concerned for this step if: ${{ inputs.job == 'run_tests_gpu' }} uses: actions/upload-artifact@v3 with: diff --git a/utils/notification_service.py b/utils/notification_service.py index ab7769e5ca874c..999cdc6987e7c5 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -1153,8 +1153,11 @@ def prepare_reports(title, header, reports, to_truncate=True): if not os.path.isdir(os.path.join(os.getcwd(), "prev_ci_results")): os.makedirs(os.path.join(os.getcwd(), "prev_ci_results")) - with open("prev_ci_results/model_results.json", "w", encoding="UTF-8") as fp: - json.dump(model_results, fp, indent=4, ensure_ascii=False) + # Only the model testing job is concerned: this condition is to avoid other jobs to upload the empty list as + # results. + if job_name == "run_tests_gpu": + with open("prev_ci_results/model_results.json", "w", encoding="UTF-8") as fp: + json.dump(model_results, fp, indent=4, ensure_ascii=False) prev_ci_artifacts = None target_workflow = "huggingface/transformers/.github/workflows/self-scheduled.yml@refs/heads/main"