Spaces:
Sleeping
Sleeping
ZeroCommand
commited on
Commit
•
79d13cd
1
Parent(s):
02cf07d
only show the folder where submitted config files are
Browse files- app_debug.py +1 -1
- io_utils.py +11 -1
- run_jobs.py +2 -2
app_debug.py
CHANGED
@@ -8,7 +8,7 @@ import pipe
|
|
8 |
from io_utils import get_logs_file
|
9 |
|
10 |
LOG_PATH = "./tmp"
|
11 |
-
CONFIG_PATH = "./cicd/configs/"
|
12 |
MAX_FILES_NUM = 20
|
13 |
|
14 |
|
|
|
8 |
from io_utils import get_logs_file
|
9 |
|
10 |
LOG_PATH = "./tmp"
|
11 |
+
CONFIG_PATH = "./cicd/configs/submitted/"
|
12 |
MAX_FILES_NUM = 20
|
13 |
|
14 |
|
io_utils.py
CHANGED
@@ -1,15 +1,25 @@
|
|
1 |
import os
|
2 |
-
|
3 |
import yaml
|
4 |
|
5 |
YAML_PATH = "./cicd/configs"
|
6 |
LOG_FILE = "temp_log"
|
7 |
|
|
|
8 |
|
9 |
class Dumper(yaml.Dumper):
|
10 |
def increase_indent(self, flow=False, *args, **kwargs):
|
11 |
return super().increase_indent(flow=flow, indentless=False)
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
def get_yaml_path(uid):
|
15 |
if not os.path.exists(YAML_PATH):
|
|
|
1 |
import os
|
2 |
+
import logging
|
3 |
import yaml
|
4 |
|
5 |
YAML_PATH = "./cicd/configs"
|
6 |
LOG_FILE = "temp_log"
|
7 |
|
8 |
+
logger = logging.getLogger(__name__)
|
9 |
|
10 |
class Dumper(yaml.Dumper):
|
11 |
def increase_indent(self, flow=False, *args, **kwargs):
|
12 |
return super().increase_indent(flow=flow, indentless=False)
|
13 |
|
14 |
+
def get_submitted_yaml_path(uid):
|
15 |
+
if not os.path.exists(f"{YAML_PATH}/submitted"):
|
16 |
+
os.makedirs(f"{YAML_PATH}/submitted")
|
17 |
+
if not os.path.exists(f"{YAML_PATH}/{uid}_config.yaml"):
|
18 |
+
logger.error(f"config.yaml does not exist for {uid}")
|
19 |
+
os.system(f"cp config.yaml {YAML_PATH}/{uid}_config.yaml")
|
20 |
+
if not os.path.exists(f"{YAML_PATH}/submitted/{uid}_config.yaml"):
|
21 |
+
os.system(f"cp {YAML_PATH}/{uid}_config.yaml {YAML_PATH}/submitted/{uid}_config.yaml")
|
22 |
+
return f"{YAML_PATH}/submitted/{uid}_config.yaml"
|
23 |
|
24 |
def get_yaml_path(uid):
|
25 |
if not os.path.exists(YAML_PATH):
|
run_jobs.py
CHANGED
@@ -17,7 +17,7 @@ from app_env import (
|
|
17 |
HF_SPACE_ID,
|
18 |
HF_WRITE_TOKEN,
|
19 |
)
|
20 |
-
from io_utils import LOG_FILE,
|
21 |
from isolated_env import prepare_venv
|
22 |
from leaderboard import LEADERBOARD
|
23 |
|
@@ -98,7 +98,7 @@ def prepare_env_and_get_command(
|
|
98 |
"--label_mapping",
|
99 |
json.dumps(label_mapping),
|
100 |
"--scan_config",
|
101 |
-
|
102 |
"--inference_type",
|
103 |
inference_type,
|
104 |
"--inference_api_token",
|
|
|
17 |
HF_SPACE_ID,
|
18 |
HF_WRITE_TOKEN,
|
19 |
)
|
20 |
+
from io_utils import LOG_FILE, get_submitted_yaml_path, write_log_to_user_file
|
21 |
from isolated_env import prepare_venv
|
22 |
from leaderboard import LEADERBOARD
|
23 |
|
|
|
98 |
"--label_mapping",
|
99 |
json.dumps(label_mapping),
|
100 |
"--scan_config",
|
101 |
+
get_submitted_yaml_path(uid),
|
102 |
"--inference_type",
|
103 |
inference_type,
|
104 |
"--inference_api_token",
|