Spaces:
Running
on
Zero
Running
on
Zero
AdrienB134
commited on
Commit
•
ba08945
1
Parent(s):
207c30a
jdytnty
Browse files
app.py
CHANGED
@@ -30,8 +30,8 @@ id_model = Idefics3ForConditionalGeneration.from_pretrained("HuggingFaceM4/Idefi
|
|
30 |
#_attn_implementation="flash_attention_2"
|
31 |
).to("cuda")
|
32 |
|
33 |
-
BAD_WORDS_IDS =
|
34 |
-
EOS_WORDS_IDS = [
|
35 |
|
36 |
@spaces.GPU
|
37 |
def model_inference(
|
|
|
30 |
#_attn_implementation="flash_attention_2"
|
31 |
).to("cuda")
|
32 |
|
33 |
+
BAD_WORDS_IDS = id_processor.tokenizer(["<image>", "<fake_token_around_image>"], add_special_tokens=False).input_ids
|
34 |
+
EOS_WORDS_IDS = [id_processor.tokenizer.eos_token_id]
|
35 |
|
36 |
@spaces.GPU
|
37 |
def model_inference(
|