blanchon commited on
Commit
66845ac
·
1 Parent(s): 763c766

Using flash_attention_2?

Browse files
Files changed (1) hide show
  1. demo/app_januspro.py +3 -1
demo/app_januspro.py CHANGED
@@ -10,7 +10,9 @@ from transformers import AutoConfig, AutoModelForCausalLM
10
  model_path = "deepseek-ai/Janus-Pro-7B"
11
  config = AutoConfig.from_pretrained(model_path)
12
  language_config = config.language_config
13
- language_config._attn_implementation = "eager"
 
 
14
  vl_gpt = AutoModelForCausalLM.from_pretrained(
15
  model_path, language_config=language_config, trust_remote_code=True
16
  )
 
10
  model_path = "deepseek-ai/Janus-Pro-7B"
11
  config = AutoConfig.from_pretrained(model_path)
12
  language_config = config.language_config
13
+ # language_config._attn_implementation = "eager"
14
+ language_config["attn_implementation"] = "flash_attention_2"
15
+
16
  vl_gpt = AutoModelForCausalLM.from_pretrained(
17
  model_path, language_config=language_config, trust_remote_code=True
18
  )