Skip to content

Commit

Permalink
fix nas's bug (PaddlePaddle#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzjjay committed Mar 21, 2022
1 parent 1a9376a commit d66afeb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions paddleslim/common/controller_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import logging
import socket
from .log_helper import get_logger

import sys
__all__ = ['ControllerClient']

_logger = get_logger(__name__, level=logging.INFO)
Expand Down Expand Up @@ -110,7 +110,10 @@ def next_tokens(self):

socket_client.send("next_tokens".encode())
tokens = socket_client.recv(1024).decode()
tokens = [int(token) for token in tokens.strip("\n").split(",")]
try:
tokens = [int(token) for token in tokens.strip("\n").split(",")]
except ValueError:
sys.exit()
return tokens

def request_current_info(self):
Expand Down

0 comments on commit d66afeb

Please sign in to comment.