NiCEtmtm commited on
Commit
b3b20a3
·
verified ·
1 Parent(s): 23e18ba

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -3
handler.py CHANGED
@@ -12,6 +12,9 @@ from transformers import WhisperForConditionalGeneration, pipeline
12
  def install(package):
13
  subprocess.check_call([sys.executable, "-m", "pip", "install", package])
14
 
 
 
 
15
  # try:
16
  # import bitsandbytes
17
  # except ImportError:
@@ -51,9 +54,6 @@ class EndpointHandler:
51
 
52
  # 确保在安装依赖项之后再实例化和加载模型
53
  if __name__ == "__main__":
54
- # 更新 pip 并安装指定版本的库
55
- subprocess.run(["pip", "install", "--upgrade", "pip"], check=True)
56
- subprocess.run(["pip", "install", "--upgrade", "huggingface_hub"], check=True)
57
  try:
58
  # Install accelerate
59
  pip.main(['install', 'accelerate'])
 
12
  def install(package):
13
  subprocess.check_call([sys.executable, "-m", "pip", "install", package])
14
 
15
+ # 更新 pip 并安装指定版本的库
16
+ subprocess.run(["pip", "install", "--upgrade", "pip"], check=True)
17
+ subprocess.run(["pip", "install", "--upgrade", "huggingface_hub"], check=True)
18
  # try:
19
  # import bitsandbytes
20
  # except ImportError:
 
54
 
55
  # 确保在安装依赖项之后再实例化和加载模型
56
  if __name__ == "__main__":
 
 
 
57
  try:
58
  # Install accelerate
59
  pip.main(['install', 'accelerate'])