arjunanand13 commited on
Commit
54b2a68
·
verified ·
1 Parent(s): 23f8a2f

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +14 -0
handler.py CHANGED
@@ -1,3 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM, pipeline
2
 
3
  class InferenceHandler:
 
1
+ import subprocess
2
+ import sys
3
+
4
+ def install(package):
5
+ subprocess.check_call([sys.executable, "-m", "pip", "install", package])
6
+
7
+ try:
8
+ install("flash_attn")
9
+ except subprocess.CalledProcessError:
10
+ print("Failed to install flash_attn")
11
+
12
+ install("timm")
13
+ install("einops")
14
+
15
  from transformers import AutoConfig, AutoTokenizer, AutoModelForCausalLM, pipeline
16
 
17
  class InferenceHandler: