Skip to content

Commit a112aff

Browse files
committed
try for publish
1 parent bcc95cc commit a112aff

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

training/DeepJet_callbacks.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,19 @@
2929
#helper
3030

3131
def publish(file_to_publish, publish_to_path):
32-
cpstring = 'cp -f '
33-
if "@" in publish_to_path:
34-
cpstring = 'scp '
35-
spl = publish_to_path.split(':')
36-
path = spl[1]
37-
user = spl[0].split('@')[0]
38-
server = spl[0].split('@')[1]
39-
os.system('ssh -o ConnectTimeout=20 '+user+'@'+server+' "mkdir -p '+path+'"')
40-
basefilename = os.path.basename(file_to_publish)
41-
os.system(cpstring + file_to_publish + ' ' + publish_to_path +'/'+basefilename+ ' 2>&1 > /dev/null')
32+
try:
33+
cpstring = 'cp -f '
34+
if "@" in publish_to_path:
35+
cpstring = 'scp -o ConnectTimeout=20 '
36+
spl = publish_to_path.split(':')
37+
path = spl[1]
38+
user = spl[0].split('@')[0]
39+
server = spl[0].split('@')[1]
40+
os.system('ssh -o ConnectTimeout=20 '+user+'@'+server+' "mkdir -p '+path+'"')
41+
basefilename = os.path.basename(file_to_publish)
42+
os.system(cpstring + file_to_publish + ' ' + publish_to_path +'/'+basefilename+ ' 2>&1 > /dev/null')
43+
except Exception as e:
44+
print('exception in publish', e, 'when trying to publish to',publish_to_path ,'. Training will ignore this exception and move on.')
4245

4346
def hampel(vals_orig, k=7, t0=3):
4447
'''

0 commit comments

Comments
 (0)