Spaces:
Running
on
Zero
Running
on
Zero
suwonpabby
commited on
Commit
•
d1bdc32
1
Parent(s):
09ffae8
For Check
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ import uvicorn
|
|
11 |
import time
|
12 |
import numpy as np
|
13 |
import subprocess
|
14 |
-
import
|
15 |
|
16 |
# 모듈 설치 명령
|
17 |
subprocess.run(["pip", "install", "transformers"], check=True)
|
@@ -24,8 +24,11 @@ subprocess.run(["pip", "install", "numpy==1.26.0"], check=True)
|
|
24 |
modules = ['transformers', 'accelerate', 'peft', 'FlagEmbedding']
|
25 |
|
26 |
for module in modules:
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
29 |
|
30 |
#fmt: off
|
31 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
11 |
import time
|
12 |
import numpy as np
|
13 |
import subprocess
|
14 |
+
import importlib.metadata
|
15 |
|
16 |
# 모듈 설치 명령
|
17 |
subprocess.run(["pip", "install", "transformers"], check=True)
|
|
|
24 |
modules = ['transformers', 'accelerate', 'peft', 'FlagEmbedding']
|
25 |
|
26 |
for module in modules:
|
27 |
+
try:
|
28 |
+
version = importlib.metadata.version(module)
|
29 |
+
print(f"{module} version: {version}")
|
30 |
+
except importlib.metadata.PackageNotFoundError:
|
31 |
+
print(f"{module} is not installed")
|
32 |
|
33 |
#fmt: off
|
34 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|