Skip to content

Commit f1748d7

Browse files
authored
avoid leaking data to HuggingFace (invoke-ai#2021)
Before making a concept download request to HuggingFace, the concepts library module now checks the concept name against a downloaded list of all the concepts currently known to HuggingFace. If the requested concept is not on the list, then no download request is made.
1 parent de7abce commit f1748d7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ldm/invoke/concepts_lib.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def get_concept_model_path(self, concept_name:str)->str:
4646
the named concept. Returns None if invalid or cannot
4747
be downloaded.
4848
'''
49+
if not concept_name in self.list_concepts():
50+
print(f'This concept is not known to the Hugging Face library. Generation will continue without the concept.')
51+
return None
4952
return self.get_concept_file(concept_name.lower(),'learned_embeds.bin')
5053

5154
def concept_to_trigger(self, concept_name:str)->str:

0 commit comments

Comments
 (0)