Better error handling when unable to extract contents of embedding/TI file
This commit is contained in:
parent
8dc920228e
commit
c5b7559856
|
@ -181,12 +181,16 @@ class EmbeddingDatabase:
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if data is not None:
|
||||||
embedding = create_embedding_from_data(data, name, filename=filename, filepath=path)
|
embedding = create_embedding_from_data(data, name, filename=filename, filepath=path)
|
||||||
|
|
||||||
if self.expected_shape == -1 or self.expected_shape == embedding.shape:
|
if self.expected_shape == -1 or self.expected_shape == embedding.shape:
|
||||||
self.register_embedding(embedding, shared.sd_model)
|
self.register_embedding(embedding, shared.sd_model)
|
||||||
else:
|
else:
|
||||||
self.skipped_embeddings[name] = embedding
|
self.skipped_embeddings[name] = embedding
|
||||||
|
else:
|
||||||
|
print(f"Unable to load Textual inversion embedding due to data issue: '{name}'.")
|
||||||
|
|
||||||
|
|
||||||
def load_from_dir(self, embdir):
|
def load_from_dir(self, embdir):
|
||||||
if not os.path.isdir(embdir.path):
|
if not os.path.isdir(embdir.path):
|
||||||
|
|
Loading…
Reference in New Issue