Fix unitest of light nas. (#18931)

test=develop
padding_in_crf
whs 6 years ago committed by GitHub
parent e1b5833b88
commit c92b78b060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -82,15 +82,7 @@ class LightNASStrategy(Strategy):
self._server_ip = self._get_host_ip()
def _get_host_ip(self):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
ip = s.getsockname()[0]
finally:
s.close()
return ip
return socket.gethostbyname(socket.gethostname())
def on_compression_begin(self, context):
self._current_tokens = context.search_space.init_tokens()

Loading…
Cancel
Save