提交 ac43e8f5 编写于 作者: B barrierye

fix bug

上级 fd1055ef
...@@ -306,6 +306,9 @@ class Server(object): ...@@ -306,6 +306,9 @@ class Server(object):
self.check_local_bin() self.check_local_bin()
if not self.use_local_bin: if not self.use_local_bin:
self.download_bin() self.download_bin()
# wait for other process to download server bin
while not os.path.exists(self.server_path):
time.sleep(1)
else: else:
print("Use local bin : {}".format(self.bin_path)) print("Use local bin : {}".format(self.bin_path))
command = "{} " \ command = "{} " \
...@@ -337,8 +340,5 @@ class Server(object): ...@@ -337,8 +340,5 @@ class Server(object):
self.gpuid,) self.gpuid,)
print("Going to Run Comand") print("Going to Run Comand")
print(command) print(command)
# wait for other process to download server bin
while not os.path.exists(self.server_path):
time.sleep(1)
os.system(command) os.system(command)
...@@ -164,6 +164,7 @@ function python_test_fit_a_line() { ...@@ -164,6 +164,7 @@ function python_test_fit_a_line() {
fi fi
;; ;;
GPU) GPU)
export CUDA_VISIBLE_DEVICES=0
# test rpc # test rpc
check_cmd "python -m paddle_serving_server_gpu.serve --model uci_housing_model --port 9393 --thread 4 --gpu_ids 0 > /dev/null &" check_cmd "python -m paddle_serving_server_gpu.serve --model uci_housing_model --port 9393 --thread 4 --gpu_ids 0 > /dev/null &"
sleep 5 # wait for the server to start sleep 5 # wait for the server to start
...@@ -298,6 +299,7 @@ function python_test_bert() { ...@@ -298,6 +299,7 @@ function python_test_bert() {
echo "bert RPC inference pass" echo "bert RPC inference pass"
;; ;;
GPU) GPU)
export CUDA_VISIBLE_DEVICES=0
pip install paddlehub pip install paddlehub
# Because download from paddlehub may timeout, # Because download from paddlehub may timeout,
# download the model from bos(max_seq_len=128). # download the model from bos(max_seq_len=128).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册