suwonpabby commited on
Commit
09ffae8
1 Parent(s): aec2b55
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -10,12 +10,22 @@ import torch
10
  import uvicorn
11
  import time
12
  import numpy as np
13
-
14
- os.system("pip install transformers")
15
- os.system("pip install accelerate")
16
- os.system("pip install peft")
17
- os.system("pip install -U FlagEmbedding")
18
- os.system("pip install numpy==2.1.0")
 
 
 
 
 
 
 
 
 
 
19
 
20
  #fmt: off
21
  from transformers import AutoModelForCausalLM, AutoTokenizer
 
10
  import uvicorn
11
  import time
12
  import numpy as np
13
+ import subprocess
14
+ import pkg_resources
15
+
16
+ # 모듈 설치 명령
17
+ subprocess.run(["pip", "install", "transformers"], check=True)
18
+ subprocess.run(["pip", "install", "accelerate"], check=True)
19
+ subprocess.run(["pip", "install", "peft"], check=True)
20
+ subprocess.run(["pip", "install", "-U", "FlagEmbedding"], check=True)
21
+ subprocess.run(["pip", "install", "numpy==1.26.0"], check=True)
22
+
23
+ # 설치된 모듈들의 현재 버전 출력
24
+ modules = ['transformers', 'accelerate', 'peft', 'FlagEmbedding']
25
+
26
+ for module in modules:
27
+ version = pkg_resources.get_distribution(module).version
28
+ print(f"{module} version: {version}")
29
 
30
  #fmt: off
31
  from transformers import AutoModelForCausalLM, AutoTokenizer