Spaces:
Sleeping
Sleeping
Update setup_environment.py
Browse files- setup_environment.py +26 -1
setup_environment.py
CHANGED
@@ -113,7 +113,29 @@ def add_to_ld_library_path(library_dir):
|
|
113 |
print("์ ํจํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฒฝ๋ก๊ฐ ์์ต๋๋ค.")
|
114 |
|
115 |
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
def initialize_environment():
|
118 |
"""ํ๊ฒฝ ์ค์ ์ ์ํ ์ ์ฒด ํ๋ก์ธ์ค ์คํ"""
|
119 |
print('aaaaaaaaaaaa')
|
@@ -125,6 +147,9 @@ def initialize_environment():
|
|
125 |
print('11111111')
|
126 |
check_stf_alternative_installed()
|
127 |
|
|
|
|
|
|
|
128 |
# stf-api-alternative์์ pip install . ์คํ
|
129 |
run_pip_install("/tmp/stf/stf-api-alternative")
|
130 |
|
|
|
113 |
print("์ ํจํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฒฝ๋ก๊ฐ ์์ต๋๋ค.")
|
114 |
|
115 |
|
116 |
+
def download_files_from_url():
|
117 |
+
os.makedirs('/tmp/stf',exist_ok=True)
|
118 |
+
os.makedirs('/tmp/stf/TEMP',exist_ok=True)
|
119 |
+
|
120 |
+
file_id=os.getenv('DOWNLOAD_1')
|
121 |
+
url = f"https://drive.google.com/uc?id={file_id}"
|
122 |
+
gdown.download(url, '/tmp/stf-api-alternative.zip', quiet=False)
|
123 |
+
zipfile.ZipFile('/tmp/stf-api-alternative.zip', 'r').extractall('/tmp/stf/')
|
124 |
+
|
125 |
+
file_id=os.getenv('DOWNLOAD_2')
|
126 |
+
url = f"https://drive.google.com/uc?id={file_id}"
|
127 |
+
gdown.download(url, '/tmp/stf/089.pth', quiet=False)
|
128 |
+
|
129 |
+
|
130 |
+
file_id=os.getenv('DOWNLOAD_3')
|
131 |
+
url = f"https://drive.google.com/uc?id={file_id}"
|
132 |
+
gdown.download(url, '/tmp/stf/TEMP/0157.pth', quiet=False)
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
|
137 |
+
|
138 |
+
|
139 |
def initialize_environment():
|
140 |
"""ํ๊ฒฝ ์ค์ ์ ์ํ ์ ์ฒด ํ๋ก์ธ์ค ์คํ"""
|
141 |
print('aaaaaaaaaaaa')
|
|
|
147 |
print('11111111')
|
148 |
check_stf_alternative_installed()
|
149 |
|
150 |
+
# ์ฌ๊ธฐ์ ํ์ผ ๋ค์ด๋ก๋
|
151 |
+
download_files_from_url()
|
152 |
+
|
153 |
# stf-api-alternative์์ pip install . ์คํ
|
154 |
run_pip_install("/tmp/stf/stf-api-alternative")
|
155 |
|