Spaces:
Runtime error
Runtime error
upload
Browse files
README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1 |
# exp-comman-generator
|
2 |
|
|
|
|
|
|
|
|
|
3 |
My personal tool for experiment command generation. Check this: https://experiment-comamnd-genertator.herokuapp.com/
|
|
|
1 |
# exp-comman-generator
|
2 |
|
3 |
+
```bash
|
4 |
+
streamlit run main.py --server.address localhost
|
5 |
+
```
|
6 |
+
|
7 |
My personal tool for experiment command generation. Check this: https://experiment-comamnd-genertator.herokuapp.com/
|
main.py
CHANGED
@@ -20,17 +20,17 @@ import time
|
|
20 |
st.title("Exp Command Generator")
|
21 |
|
22 |
# experiment mode
|
23 |
-
exp_mode = st.selectbox("Select Experiment Mode", ["OneExpOnecard", "MultipleExpOnecard"],key="MultipleExpOnecard")
|
24 |
|
25 |
## 检查框
|
26 |
-
debug = st.checkbox("Debug:选择则会串行地执行命令", value=True)
|
27 |
-
# st.write(f"checkbox的值是{res}")
|
28 |
|
29 |
-
setup = st.text_area("Some setup of env at beginning.", """cd $(dirname $(dirname $0))
|
30 |
source activate xai
|
31 |
export PYTHONPATH=${PYTHONPATH}:/Users/apple/Desktop/workspace/research_project/attention:/mnt/yixin/:/home/yila22/prj""")
|
32 |
|
33 |
-
exp_hyper = st.text_area("Hyperparameters", """exp_name="debug-adv-training-emotion"
|
34 |
dataset=emotion
|
35 |
n_epoch=3
|
36 |
K=3
|
@@ -44,7 +44,7 @@ bsize=8
|
|
44 |
lr=5e-5""")
|
45 |
|
46 |
## gpu 相关参数
|
47 |
-
gpu_list = st.multiselect("multi select", range(10), [
|
48 |
# print(gpu_list)
|
49 |
if exp_mode == "OneExpOnecard":
|
50 |
allow_gpu_memory_threshold_default = 20000
|
@@ -52,10 +52,10 @@ if exp_mode == "OneExpOnecard":
|
|
52 |
elif exp_mode == "MultipleExpOnecard":
|
53 |
allow_gpu_memory_threshold_default = 3000
|
54 |
gpu_threshold_default = 70
|
55 |
-
allow_gpu_memory_threshold = st.number_input("最小单卡剩余容量", value=allow_gpu_memory_threshold_default, min_value=0, max_value=30000, step=1000)
|
56 |
-
gpu_threshold = st.number_input("最大单卡利用率", value=gpu_threshold_default, min_value=0, max_value=100, step=10)
|
57 |
-
sleep_time_after_loading_task= st.number_input("加载任务后等待秒数", value=20, min_value=0,step=5)
|
58 |
-
all_full_sleep_time = st.number_input("全满之后等待秒数", value=20, min_value=0,step=5)
|
59 |
|
60 |
gpu_list_str = ' '.join([str(i) for i in gpu_list])
|
61 |
gpu_hyper = f"gpu=({gpu_list_str})\n"
|
@@ -88,8 +88,6 @@ print(python_cmd)
|
|
88 |
end_loop = "done;"*hyper_loop.count("for")
|
89 |
print(end_loop)
|
90 |
|
91 |
-
|
92 |
-
|
93 |
g = st.button("Generate")
|
94 |
if g:
|
95 |
s = ""
|
@@ -142,6 +140,8 @@ echo "use gpu id is ${gpu[$i]}, free memory is $free_mem, it utilization is ${gp
|
|
142 |
s += end_loop
|
143 |
st.success("Finished")
|
144 |
st.code(s, language="shell")
|
145 |
-
|
|
|
|
|
146 |
|
147 |
|
|
|
20 |
st.title("Exp Command Generator")
|
21 |
|
22 |
# experiment mode
|
23 |
+
exp_mode = st.sidebar.selectbox("Select Experiment Mode", ["OneExpOnecard", "MultipleExpOnecard"],key="MultipleExpOnecard")
|
24 |
|
25 |
## 检查框
|
26 |
+
debug = st.sidebar.checkbox("Debug:选择则会串行地执行命令", value=True)
|
27 |
+
# st.sidebar.write(f"checkbox的值是{res}")
|
28 |
|
29 |
+
setup = st.sidebar.text_area("Some setup of env at beginning.", """cd $(dirname $(dirname $0))
|
30 |
source activate xai
|
31 |
export PYTHONPATH=${PYTHONPATH}:/Users/apple/Desktop/workspace/research_project/attention:/mnt/yixin/:/home/yila22/prj""")
|
32 |
|
33 |
+
exp_hyper = st.sidebar.text_area("Hyperparameters", """exp_name="debug-adv-training-emotion"
|
34 |
dataset=emotion
|
35 |
n_epoch=3
|
36 |
K=3
|
|
|
44 |
lr=5e-5""")
|
45 |
|
46 |
## gpu 相关参数
|
47 |
+
gpu_list = st.sidebar.multiselect("multi select", range(10), [5, 6, 7, 8, 9])
|
48 |
# print(gpu_list)
|
49 |
if exp_mode == "OneExpOnecard":
|
50 |
allow_gpu_memory_threshold_default = 20000
|
|
|
52 |
elif exp_mode == "MultipleExpOnecard":
|
53 |
allow_gpu_memory_threshold_default = 3000
|
54 |
gpu_threshold_default = 70
|
55 |
+
allow_gpu_memory_threshold = st.sidebar.number_input("最小单卡剩余容量", value=allow_gpu_memory_threshold_default, min_value=0, max_value=30000, step=1000)
|
56 |
+
gpu_threshold = st.sidebar.number_input("最大单卡利用率", value=gpu_threshold_default, min_value=0, max_value=100, step=10)
|
57 |
+
sleep_time_after_loading_task= st.sidebar.number_input("加载任务后等待秒数", value=20, min_value=0,step=5)
|
58 |
+
all_full_sleep_time = st.sidebar.number_input("全满之后等待秒数", value=20, min_value=0,step=5)
|
59 |
|
60 |
gpu_list_str = ' '.join([str(i) for i in gpu_list])
|
61 |
gpu_hyper = f"gpu=({gpu_list_str})\n"
|
|
|
88 |
end_loop = "done;"*hyper_loop.count("for")
|
89 |
print(end_loop)
|
90 |
|
|
|
|
|
91 |
g = st.button("Generate")
|
92 |
if g:
|
93 |
s = ""
|
|
|
140 |
s += end_loop
|
141 |
st.success("Finished")
|
142 |
st.code(s, language="shell")
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
|
147 |
|