sitammeur commited on
Commit
289ac79
1 Parent(s): 29918f4

Update src/app/model.py

Browse files
Files changed (1) hide show
  1. src/app/model.py +5 -13
src/app/model.py CHANGED
@@ -12,19 +12,11 @@ from src.exception import CustomExceptionHandling
12
 
13
 
14
  # Install the required dependencies
15
- try:
16
- subprocess.run(
17
- "pip install -r requirements.txt",
18
- env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
19
- shell=True,
20
- check=True,
21
- )
22
- logging.info("Dependencies installed successfully.")
23
-
24
- # Handle exceptions that may occur during the process
25
- except Exception as e:
26
- # Custom exception handling
27
- raise CustomExceptionHandling(e, sys) from e
28
 
29
  # Load model and processor from Hugging Face
30
  model_id = "microsoft/Florence-2-large-ft"
 
12
 
13
 
14
  # Install the required dependencies
15
+ subprocess.run(
16
+ "pip install flash-attn --no-build-isolation",
17
+ env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
18
+ shell=True,
19
+ )
 
 
 
 
 
 
 
 
20
 
21
  # Load model and processor from Hugging Face
22
  model_id = "microsoft/Florence-2-large-ft"