Spaces:
Running
on
Zero
Running
on
Zero
suwonpabby
commited on
Commit
•
09ffae8
1
Parent(s):
aec2b55
For Check
Browse files
app.py
CHANGED
@@ -10,12 +10,22 @@ import torch
|
|
10 |
import uvicorn
|
11 |
import time
|
12 |
import numpy as np
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|