sitammeur commited on
Commit
a4a68e2
1 Parent(s): caeba95

Update src/model.py

Browse files
Files changed (1) hide show
  1. src/model.py +4 -0
src/model.py CHANGED
@@ -1,8 +1,12 @@
1
  # Importing necessary libraries
 
2
  import spaces
3
  from transformers import AutoProcessor, AutoModelForCausalLM
4
 
5
 
 
 
 
6
  # Load model and processor from Hugging Face
7
  model_id = "microsoft/Florence-2-large-ft"
8
  model = (
 
1
  # Importing necessary libraries
2
+ import subprocess
3
  import spaces
4
  from transformers import AutoProcessor, AutoModelForCausalLM
5
 
6
 
7
+ # Install the required dependencies
8
+ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
9
+
10
  # Load model and processor from Hugging Face
11
  model_id = "microsoft/Florence-2-large-ft"
12
  model = (