Skip to content

Commit

Permalink
add utility to push to hf dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
sayakpaul committed Nov 28, 2023
1 parent 8e2088e commit 01584c7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions benchmarks/push_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import glob
import os
import sys

from huggingface_hub import upload_file


sys.path.append(".")
from benchmark_utils import BASE_PATH, collate_csv # noqa: E402


FINAL_CSV_FILE = "collated_results.csv"
REPO_ID = "diffusers/benchmarks"
GITHUB_SHA = os.getenv("GITHUB_SHA", None)


def push_to_hf_dataset():
all_csvs = sorted(glob.glob(f"{BASE_PATH}/*.csv"))
collate_csv(all_csvs, FINAL_CSV_FILE)

commit_message = f"upload from sha: {GITHUB_SHA}" if GITHUB_SHA is not None else "upload benchmark results"
upload_file(repo_id=REPO_ID, path_or_fileobj=FINAL_CSV_FILE, repo_type="dataset", commit_message=commit_message)


if __name__ == "__main__":
push_to_hf_dataset()

0 comments on commit 01584c7

Please sign in to comment.