yerang commited on
Commit
1a209c7
ยท
verified ยท
1 Parent(s): 6fa08f7

Update setup_environment.py

Browse files
Files changed (1) hide show
  1. 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