add obs
This commit is contained in:
parent
c98fe54e16
commit
6270e7eebf
|
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="format" value="PLAIN" />
|
||||
<option name="myDocStringFormat" value="Plain" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/MNIST_Example.iml" filepath="$PROJECT_DIR$/.idea/MNIST_Example.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
import os
|
||||
import argparse
|
||||
import moxing as mox
|
||||
from upload import UploadOutput
|
||||
import json
|
||||
|
||||
output_path = '/cache/output'
|
||||
pretrain_path = '/cache/pretrain/'
|
||||
|
||||
### Copy ckpt file from obs to training image###
|
||||
### To operate on folders, use mox.file.copy_parallel. If copying a file.
|
||||
### Please use mox.file.copy to operate the file, this operation is to operate the file
|
||||
def download_model(files):
|
||||
for obs_url in files:
|
||||
local_file_path = pretrain_path + obs_url.split('/')[-1]
|
||||
try:
|
||||
mox.file.copy(obs_url, local_file_path)
|
||||
print('Successfully Download {} to {}'.format(obs_url,local_file_path))
|
||||
except Exception as e:
|
||||
print('moxing download {} to {} failed: '.format(obs_url, local_file_path) + str(e))
|
||||
|
||||
def upload_model(obs_output_url):
|
||||
### 将训练容器中的新输出模型 回传到启智社区
|
||||
try:
|
||||
mox.file.copy_parallel(output_path, obs_output_url)
|
||||
print("Successfully Upload {} to {}".format(output_path,obs_output_url))
|
||||
except Exception as e:
|
||||
print('moxing upload {} to {} failed: '.format(output_path,obs_output_url) + str(e))
|
||||
|
||||
|
||||
Loading…
Reference in New Issue