Skip to content

Commit

Permalink
trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
ydshieh committed Jul 26, 2024
1 parent ad463d4 commit 2865376
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions utils/notification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,23 +773,6 @@ def post_reply(self):
with open(file_path, "w", encoding="UTF-8") as fp:
fp.write(failure_text)

client.chat_postMessage(
channel=SLACK_REPORT_CHANNEL_ID,
text="Results for new failures",
blocks=blocks,
thread_ts=self.thread_ts["ts"],
attachments=[{"pretext": "pre-hello", "text": "text-world"}],
)

# Call the files.upload method using the WebClient
# Uploading files requires the `files:write` scope
result = client.files_upload(
channels=SLACK_REPORT_CHANNEL_ID,
initial_comment="Here's my file :smile:",
file=file_path,
)



def retrieve_artifact(artifact_path: str, gpu: Optional[str]):
if gpu not in [None, "single", "multi"]:
Expand Down Expand Up @@ -1240,3 +1223,15 @@ def prepare_reports(title, header, reports, to_truncate=True):
if message.n_failures or (ci_event != "push" and not ci_event.startswith("Push CI (AMD)")):
message.post()
message.post_reply()

# upload results to Hub dataset (only for the scheduled daily CI run on `main`)
# if is_scheduled_ci_run:
if True:
file_path = os.path.join(os.getcwd(), f"ci_results_{job_name}/new_model_failures.txt")
api.upload_file(
path_or_fileobj=file_path,
path_in_repo=f"{datetime.datetime.today().strftime('%Y-%m-%d')}/ci_results_{job_name}/new_model_failures.txt",
repo_id="hf-internal-testing/transformers_daily_ci",
repo_type="dataset",
token=os.environ.get("TRANSFORMERS_CI_RESULTS_UPLOAD_TOKEN", None),
)

0 comments on commit 2865376

Please sign in to comment.