Hotfix #708... (#710)
parent
eea2ebb68f
commit
7499182064
|
|
@ -17,7 +17,8 @@ class SpecialSyntaxAwareMagicPromptGenerator(MagicPromptGenerator):
|
|||
orig_prompts, chunks = zip(
|
||||
*(remove_a1111_special_syntax_chunks(p) for p in orig_prompts),
|
||||
)
|
||||
magic_prompts = super()._generate_magic_prompts(orig_prompts)
|
||||
# `transformers` is rather particular that the input is a list, not a tuple
|
||||
magic_prompts = super()._generate_magic_prompts(list(orig_prompts))
|
||||
# in case we somehow get less magic prompts than we started with,
|
||||
# use zip_longest instead of zip.
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
def fake_generator(prompts, **_kwargs):
|
||||
assert isinstance(prompts, list) # be as particular as transformers is
|
||||
for prompt in prompts:
|
||||
assert "<" not in prompt # should have been stripped
|
||||
yield [{"generated_text": f"magical {prompt}"}]
|
||||
|
|
|
|||
Loading…
Reference in New Issue