Merge pull request #6384 from faber6/loads-ti-from-subdirs

allow loading embeddings from subdirectories
This commit is contained in:
AUTOMATIC1111 2023-01-06 07:56:48 +03:00 committed by GitHub
commit 143ed5a42d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -149,9 +149,10 @@ class EmbeddingDatabase:
else:
self.skipped_embeddings[name] = embedding
for fn in os.listdir(self.embeddings_dir):
for root, dirs, fns in os.walk(self.embeddings_dir):
for fn in fns:
try:
fullfn = os.path.join(self.embeddings_dir, fn)
fullfn = os.path.join(root, fn)
if os.stat(fullfn).st_size == 0:
continue