mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
maintain gpt
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
version = '2.1.770'
|
version = '2.1.771'
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ aesthetic
|
|||||||
affectionate
|
affectionate
|
||||||
affirmed
|
affirmed
|
||||||
affirming
|
affirming
|
||||||
aged
|
|
||||||
ageless
|
|
||||||
agile
|
agile
|
||||||
aimed
|
aimed
|
||||||
airy
|
airy
|
||||||
@@ -654,7 +652,6 @@ outfitted
|
|||||||
outstanding
|
outstanding
|
||||||
overjoyed
|
overjoyed
|
||||||
pacified
|
pacified
|
||||||
painterly
|
|
||||||
paired
|
paired
|
||||||
palpable
|
palpable
|
||||||
panoramic
|
panoramic
|
||||||
|
|||||||
@@ -31,18 +31,20 @@ class FooocusExpansion:
|
|||||||
|
|
||||||
positive_words = open(os.path.join(fooocus_expansion_path, 'positive.txt'),
|
positive_words = open(os.path.join(fooocus_expansion_path, 'positive.txt'),
|
||||||
encoding='utf-8').read().splitlines()
|
encoding='utf-8').read().splitlines()
|
||||||
|
positive_words = [x.lower() for x in positive_words if x != '']
|
||||||
|
|
||||||
# new_content = '\n'.join(sorted(list(set(positive_words))))
|
# new_content = '\n'.join(sorted(list(set(positive_words))))
|
||||||
# t198 = self.tokenizer('\n', return_tensors="np")
|
# eos = self.tokenizer.eos_token_id
|
||||||
# t11 = self.tokenizer(',', return_tensors="np")
|
|
||||||
# positive_ids = [11, 198, self.tokenizer.eos_token_id]
|
|
||||||
|
|
||||||
positive_ids = [11]
|
symbols = '-+,.;?!!!'
|
||||||
|
|
||||||
self.bad_words_ids = []
|
self.bad_words_ids = []
|
||||||
for k, v in self.tokenizer.vocab.items():
|
for k, v in self.tokenizer.vocab.items():
|
||||||
if k.replace('Ġ', '') not in positive_words and v not in positive_ids:
|
if k.replace('Ġ', '').lower() not in positive_words and k not in symbols:
|
||||||
self.bad_words_ids.append([v])
|
self.bad_words_ids.append([v])
|
||||||
|
else:
|
||||||
|
# print(k)
|
||||||
|
pass
|
||||||
|
|
||||||
self.model = AutoModelForCausalLM.from_pretrained(fooocus_expansion_path)
|
self.model = AutoModelForCausalLM.from_pretrained(fooocus_expansion_path)
|
||||||
self.model.eval()
|
self.model.eval()
|
||||||
|
|||||||
Reference in New Issue
Block a user