aimeri commited on
Commit
b7fa0fa
·
1 Parent(s): c7db60b

Update app.py to change torch data type to float16 and comment out attention implementation; modify requirements.txt to reorder dependencies and remove flash-attn.

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. requirements.txt +1 -2
app.py CHANGED
@@ -8,14 +8,14 @@ import spaces
8
 
9
  # Initialize the model and processor
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
- torch_dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32
12
 
13
  model = Qwen2_5OmniModel.from_pretrained(
14
  "Qwen/Qwen2.5-Omni-7B",
15
  torch_dtype=torch_dtype,
16
  device_map="auto",
17
  enable_audio_output=True,
18
- attn_implementation="flash_attention_2" if torch.cuda.is_available() else None
19
  )
20
 
21
  processor = Qwen2_5OmniProcessor.from_pretrained("Qwen/Qwen2.5-Omni-7B")
 
8
 
9
  # Initialize the model and processor
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
+ torch_dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float16
12
 
13
  model = Qwen2_5OmniModel.from_pretrained(
14
  "Qwen/Qwen2.5-Omni-7B",
15
  torch_dtype=torch_dtype,
16
  device_map="auto",
17
  enable_audio_output=True,
18
+ # attn_implementation="flash_attention_2" if torch.cuda.is_available() else None
19
  )
20
 
21
  processor = Qwen2_5OmniProcessor.from_pretrained("Qwen/Qwen2.5-Omni-7B")
requirements.txt CHANGED
@@ -2,5 +2,4 @@ transformers @ git+https://github.com/huggingface/transformers@3a1ead0aabed473ea
2
  qwen-omni-utils[decord]
3
  soundfile
4
  torch
5
- gradio
6
- flash-attn
 
2
  qwen-omni-utils[decord]
3
  soundfile
4
  torch
5
+ gradio