未验证 提交 b3ddbd77 编写于 作者: P Peter Pan 提交者: GitHub

fix: update python setup (#583)

* v2.0.0-beta.12

* v2.0.0-beta.13

* fix: use new development server

* v2.0.0-beta.14

* build: build frontend from npm tarball

* fix: update python setup
上级 d7fc4271
...@@ -109,6 +109,13 @@ scripts = ['visualdl/server/visualdl', 'demo/vdl_create_scratch_log'] ...@@ -109,6 +109,13 @@ scripts = ['visualdl/server/visualdl', 'demo/vdl_create_scratch_log']
if platform == 'win32': if platform == 'win32':
scripts.append('visualdl/server/visualDL.bat') scripts.append('visualdl/server/visualDL.bat')
def frontend_package_files(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join(path, filename))
return paths
setup( setup(
name="visualdl", name="visualdl",
version=VERSION_NUMBER, version=VERSION_NUMBER,
...@@ -120,7 +127,7 @@ setup( ...@@ -120,7 +127,7 @@ setup(
install_requires=install_requires, install_requires=install_requires,
package_data={ package_data={
'visualdl.server': 'visualdl.server':
['dist/*.js', 'dist/*.html', 'dist/fonts/*', 'dist/assets/*'], [s[len('visualdl/server/'):] for s in frontend_package_files('visualdl/server/dist')],
'visualdl': 'visualdl':
libraries, libraries,
'visualdl.python': 'visualdl.python':
......
...@@ -89,17 +89,13 @@ def get_image_tags(storage): ...@@ -89,17 +89,13 @@ def get_image_tags(storage):
with storage.mode(mode) as reader: with storage.mode(mode) as reader:
tags = reader.tags('image') tags = reader.tags('image')
if tags: if tags:
result[mode] = {} result[mode] = []
for tag in tags: for tag in tags:
image = reader.image(tag) image = reader.image(tag)
for i in range(max(1, image.num_samples())): for i in range(max(1, image.num_samples())):
caption = tag if image.num_samples( caption = tag if image.num_samples(
) <= 1 else '%s/%d' % (tag, i) ) <= 1 else '%s/%d' % (tag, i)
result[mode][caption] = { result[mode].append(caption)
'displayName': caption,
'description': "",
'samples': 1,
}
return result return result
...@@ -179,11 +175,7 @@ def get_audio_tags(storage): ...@@ -179,11 +175,7 @@ def get_audio_tags(storage):
for i in range(max(1, audio.num_samples())): for i in range(max(1, audio.num_samples())):
caption = tag if audio.num_samples( caption = tag if audio.num_samples(
) <= 1 else '%s/%d' % (tag, i) ) <= 1 else '%s/%d' % (tag, i)
result[mode][caption] = { result[mode].append(caption)
'displayName': caption,
'description': "",
'samples': 1,
}
return result return result
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册