Add VAE to meatada, add no_metadata option

This commit is contained in:
Kohya S
2023-01-11 23:12:18 +09:00
parent 895a599d34
commit e4f9b2b715
3 changed files with 59 additions and 42 deletions

View File

@@ -749,16 +749,16 @@ def default(val, d):
def model_hash(filename):
try:
with open(filename, "rb") as file:
import hashlib
m = hashlib.sha256()
try:
with open(filename, "rb") as file:
import hashlib
m = hashlib.sha256()
file.seek(0x100000)
m.update(file.read(0x10000))
return m.hexdigest()[0:8]
except FileNotFoundError:
return 'NOFILE'
file.seek(0x100000)
m.update(file.read(0x10000))
return m.hexdigest()[0:8]
except FileNotFoundError:
return 'NOFILE'
# flash attention forwards and backwards