Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -147,7 +147,9 @@ def generate_image(
|
|
147 |
image_token_id = pipe.tokenizer.convert_tokens_to_ids(pipe.trigger_word)
|
148 |
input_ids = pipe.tokenizer.encode(prompt)
|
149 |
if image_token_id not in input_ids:
|
150 |
-
|
|
|
|
|
151 |
|
152 |
if input_ids.count(image_token_id) > 1:
|
153 |
raise gr.Error(f"Cannot use multiple trigger words '{pipe.trigger_word}' in text prompt!")
|
|
|
147 |
image_token_id = pipe.tokenizer.convert_tokens_to_ids(pipe.trigger_word)
|
148 |
input_ids = pipe.tokenizer.encode(prompt)
|
149 |
if image_token_id not in input_ids:
|
150 |
+
prompt = "img" + prompt
|
151 |
+
input_ids = pipe.tokenizer.encode(prompt)
|
152 |
+
# raise gr.Error(f"Cannot find the trigger word '{pipe.trigger_word}' in text prompt! Please refer to step 2️⃣")
|
153 |
|
154 |
if input_ids.count(image_token_id) > 1:
|
155 |
raise gr.Error(f"Cannot use multiple trigger words '{pipe.trigger_word}' in text prompt!")
|