Skip to content

Commit

Permalink
style: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Oct 18, 2024
1 parent 20c2beb commit 203715e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "LAST_RELEASE_TAG=$LAST_RELEASE_TAG" >> "$GITHUB_ENV"
echo "LAST_RELEASE_SHA=$LAST_RELEASE_SHA" >> "$GITHUB_ENV"
cd $ORIG_WORKING_DIR
- name: Checkout last release repository
uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Calculate and print SHA hash of each stable_diffusion.json file
run: |
echo "SHA of current_release/stable_diffusion.json: $(sha256sum current_release/stable_diffusion.json)"
echo "SHA of last_release/stable_diffusion.json: $(sha256sum last_release/stable_diffusion.json)"
echo "SHA of last_release/stable_diffusion.json: $(sha256sum last_release/stable_diffusion.json)"
- name: Run comparison script
run: |
Expand All @@ -71,4 +71,4 @@ jobs:
uses: tsickert/discord-webhook@v6.0.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
filename: ${{ env.INFO_FILE_OUT }}
filename: ${{ env.INFO_FILE_OUT }}
18 changes: 14 additions & 4 deletions scripts/compare_pr_to_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,20 @@ def compare_pr_to_main(
pr_hash = None
for _, pr_records in model.config.items():
for pr_record in pr_records:
if isinstance(pr_record, RawLegacy_FileRecord) and pr_record.sha256sum:
if (
isinstance(pr_record, RawLegacy_FileRecord)
and pr_record.sha256sum
):
pr_hash = pr_record.sha256sum
break

main_hash = None
for _, main_records in main_model_reference.root[model_name].config.items():
for main_record in main_records:
if isinstance(main_record, RawLegacy_FileRecord) and main_record.sha256sum:
if (
isinstance(main_record, RawLegacy_FileRecord)
and main_record.sha256sum
):
main_hash = main_record.sha256sum
break

Expand Down Expand Up @@ -128,7 +134,9 @@ def main():
main_hash = args.main_hash
output_dir = args.output_dir

models_added, models_removed, models_changed = compare_pr_to_main(pr_path, main_path)
models_added, models_removed, models_changed = compare_pr_to_main(
pr_path, main_path
)
hash_compared = f"{main_hash[:8]}...{pr_hash[:8]}"

output = ""
Expand Down Expand Up @@ -158,7 +166,9 @@ def main():

if output_dir:
if not pr_hash or not main_hash:
raise ValueError("Must provide both pr_hash and main_hash to write changes to disk")
raise ValueError(
"Must provide both pr_hash and main_hash to write changes to disk"
)
write_changes_to_dir(
models_added,
models_removed,
Expand Down

0 comments on commit 203715e

Please sign in to comment.