Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
09ba206
1
Parent(s):
1784c2c
flas
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def model_inference(
|
|
36 |
|
37 |
id_model = Idefics3ForConditionalGeneration.from_pretrained("HuggingFaceM4/Idefics3-8B-Llama3",
|
38 |
torch_dtype=torch.bfloat16,
|
39 |
-
|
40 |
).to("cuda")
|
41 |
|
42 |
BAD_WORDS_IDS = id_processor.tokenizer(["<image>", "<fake_token_around_image>"], add_special_tokens=False).input_ids
|
|
|
36 |
|
37 |
id_model = Idefics3ForConditionalGeneration.from_pretrained("HuggingFaceM4/Idefics3-8B-Llama3",
|
38 |
torch_dtype=torch.bfloat16,
|
39 |
+
attn_implementation="flash_attention_2"
|
40 |
).to("cuda")
|
41 |
|
42 |
BAD_WORDS_IDS = id_processor.tokenizer(["<image>", "<fake_token_around_image>"], add_special_tokens=False).input_ids
|