sitammeur commited on
Commit
aabcc84
Β·
verified Β·
1 Parent(s): f6cc575

Update src/florence/model.py

Browse files
Files changed (1) hide show
  1. src/florence/model.py +6 -6
src/florence/model.py CHANGED
@@ -1,6 +1,6 @@
1
  # Importing necessary libraries
2
  import sys
3
- # import subprocess
4
  from typing import Optional
5
  from PIL import Image
6
  import torch
@@ -14,11 +14,11 @@ from src.exception import CustomExceptionHandling
14
 
15
 
16
  # Install the required dependencies
17
- # subprocess.run(
18
- # "pip install flash-attn --no-build-isolation",
19
- # env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
20
- # shell=True,
21
- # )
22
 
23
  # Load model and processor from Hugging Face
24
  model_id = "microsoft/Florence-2-large-ft"
 
1
  # Importing necessary libraries
2
  import sys
3
+ import subprocess
4
  from typing import Optional
5
  from PIL import Image
6
  import torch
 
14
 
15
 
16
  # Install the required dependencies
17
+ subprocess.run(
18
+ "pip install flash-attn --no-build-isolation",
19
+ env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
20
+ shell=True,
21
+ )
22
 
23
  # Load model and processor from Hugging Face
24
  model_id = "microsoft/Florence-2-large-ft"