mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-03-12 22:19:48 +00:00
Added a file signature check on the dataset size caching system to invalidate cached dimensions if the file changes.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import gc
|
||||
import os
|
||||
|
||||
import torch
|
||||
|
||||
@@ -54,3 +55,12 @@ def adain(content_features, style_features):
|
||||
stylized_content = normalized_content * style_std + style_mean
|
||||
|
||||
return stylized_content
|
||||
|
||||
def get_quick_signature_string(file_path):
|
||||
try:
|
||||
file_stats = os.stat(file_path)
|
||||
# Combine size and mtime into a single string
|
||||
return f"{file_stats.st_size}:{int(file_stats.st_mtime)}"
|
||||
except Exception as e:
|
||||
print(f"Error accessing file {file_path}: {e}")
|
||||
return None
|
||||
Reference in New Issue
Block a user