Skip to content

Commit

Permalink
feat: read config from stdin to allow pipe (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Jun 20, 2022
1 parent 4a298d4 commit 6902d2d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion server/clip_server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@

from jina import Flow

if len(sys.argv) > 1:
if sys.argv[1] == '-i':
_input = sys.stdin.read()
else:
_input = sys.argv[1]
else:
_input = 'torch-flow.yml'

f = Flow.load_config(
'torch-flow.yml' if len(sys.argv) == 1 else sys.argv[1],
_input,
extra_search_paths=[os.path.dirname(inspect.getfile(inspect.currentframe()))],
)
with f:
Expand Down

0 comments on commit 6902d2d

Please sign in to comment.