Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,11 @@ def start_train():
|
|
32 |
# Handles CUDA OOM errors.
|
33 |
os.system(f"export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True")
|
34 |
os.system("echo 'Okay, trying training.'")
|
|
|
35 |
os.system(f"cd pytorch-image-models; ./train.sh 4 --dataset hfds/datacomp/imagenet-1k-random-0.0-frac-1over4 --log-wandb --wandb-project ImageNetTraining0.0-frac-1over4 --experiment ImageNetTraining0.0-frac-1over4 --model seresnet34 --sched cosine --epochs 150 --warmup-epochs 5 --lr 0.4 --reprob 0.5 --remode pixel --batch-size 256 --amp -j 4")
|
36 |
os.system("echo 'Done'.")
|
|
|
|
|
37 |
os.system("ls")
|
38 |
# Upload output to repository
|
39 |
os.system("echo 'trying to upload...'")
|
@@ -44,8 +47,12 @@ def run():
|
|
44 |
with gr.Blocks() as app:
|
45 |
gr.Markdown(f"Randomization: 0.0")
|
46 |
gr.Markdown(f"Subset: frac-1over4")
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
49 |
app.launch(server_name="0.0.0.0", server_port=7860)
|
50 |
|
51 |
if __name__ == '__main__':
|
|
|
32 |
# Handles CUDA OOM errors.
|
33 |
os.system(f"export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True")
|
34 |
os.system("echo 'Okay, trying training.'")
|
35 |
+
status = gr.Textbox(value='TRAINING')
|
36 |
os.system(f"cd pytorch-image-models; ./train.sh 4 --dataset hfds/datacomp/imagenet-1k-random-0.0-frac-1over4 --log-wandb --wandb-project ImageNetTraining0.0-frac-1over4 --experiment ImageNetTraining0.0-frac-1over4 --model seresnet34 --sched cosine --epochs 150 --warmup-epochs 5 --lr 0.4 --reprob 0.5 --remode pixel --batch-size 256 --amp -j 4")
|
37 |
os.system("echo 'Done'.")
|
38 |
+
API.add_space_variable['STATUS'] = "IDLE"
|
39 |
+
status.value = "IDLE"
|
40 |
os.system("ls")
|
41 |
# Upload output to repository
|
42 |
os.system("echo 'trying to upload...'")
|
|
|
47 |
with gr.Blocks() as app:
|
48 |
gr.Markdown(f"Randomization: 0.0")
|
49 |
gr.Markdown(f"Subset: frac-1over4")
|
50 |
+
space_variables = API.get_space_variables(repo_id=experiment_repo)
|
51 |
+
if 'STATUS' not in space_variables or space_variables['STATUS'].value != "TRAINING":
|
52 |
+
start = gr.Button("Start")
|
53 |
+
start.click(start_train)
|
54 |
+
else:
|
55 |
+
gr.Markdown(f"Status: Training.")
|
56 |
app.launch(server_name="0.0.0.0", server_port=7860)
|
57 |
|
58 |
if __name__ == '__main__':
|