mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
Merge pull request #187 from space-nuko/add-commit-hash
Add commit hash to metadata
This commit is contained in:
@@ -12,6 +12,7 @@ import math
|
||||
import os
|
||||
import random
|
||||
import hashlib
|
||||
import subprocess
|
||||
from io import BytesIO
|
||||
|
||||
from tqdm import tqdm
|
||||
@@ -1100,6 +1101,13 @@ def addnet_hash_safetensors(b):
|
||||
return hash_sha256.hexdigest()
|
||||
|
||||
|
||||
def get_git_revision_hash() -> str:
|
||||
try:
|
||||
return subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
|
||||
except:
|
||||
return "(unknown)"
|
||||
|
||||
|
||||
# flash attention forwards and backwards
|
||||
|
||||
# https://arxiv.org/abs/2205.14135
|
||||
|
||||
Reference in New Issue
Block a user