Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,8 @@ processor = AutoProcessor.from_pretrained("HuggingFaceM4/Idefics3-8B-Llama3")
|
|
13 |
|
14 |
model = Idefics3ForConditionalGeneration.from_pretrained("HuggingFaceM4/Idefics3-8B-Llama3",
|
15 |
torch_dtype=torch.bfloat16,
|
16 |
-
#_attn_implementation="flash_attention_2"
|
17 |
-
|
18 |
|
19 |
BAD_WORDS_IDS = processor.tokenizer(["<image>", "<fake_token_around_image>"], add_special_tokens=False).input_ids
|
20 |
EOS_WORDS_IDS = [processor.tokenizer.eos_token_id]
|
|
|
13 |
|
14 |
model = Idefics3ForConditionalGeneration.from_pretrained("HuggingFaceM4/Idefics3-8B-Llama3",
|
15 |
torch_dtype=torch.bfloat16,
|
16 |
+
#_attn_implementation="flash_attention_2"
|
17 |
+
).to("cuda")
|
18 |
|
19 |
BAD_WORDS_IDS = processor.tokenizer(["<image>", "<fake_token_around_image>"], add_special_tokens=False).input_ids
|
20 |
EOS_WORDS_IDS = [processor.tokenizer.eos_token_id]
|