Update src/app/model.py
Browse files- 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 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
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"
|