Spaces:
Sleeping
Sleeping
replace old folder
Browse files- test_few_shot.py +5 -1
test_few_shot.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
import numpy as np
|
3 |
import torch
|
4 |
import torch.nn.functional as F
|
@@ -17,8 +18,11 @@ def test_main_model(opts):
|
|
17 |
import streamlit as st
|
18 |
|
19 |
if opts.dir_res:
|
20 |
-
os.mkdir(os.path.join(opts.dir_res, "results"))
|
21 |
dir_res = os.path.join(opts.dir_res, "results")
|
|
|
|
|
|
|
|
|
22 |
else:
|
23 |
dir_res = os.path.join(f"{opts.exp_path}", "experiments/", opts.name_exp, "results")
|
24 |
|
|
|
1 |
import os
|
2 |
+
import shutil
|
3 |
import numpy as np
|
4 |
import torch
|
5 |
import torch.nn.functional as F
|
|
|
18 |
import streamlit as st
|
19 |
|
20 |
if opts.dir_res:
|
|
|
21 |
dir_res = os.path.join(opts.dir_res, "results")
|
22 |
+
if os.path.exists(dir_res):
|
23 |
+
shutil.rmtree(dir_res)
|
24 |
+
os.mkdir(os.path.join(opts.dir_res, "results"))
|
25 |
+
|
26 |
else:
|
27 |
dir_res = os.path.join(f"{opts.exp_path}", "experiments/", opts.name_exp, "results")
|
28 |
|