[Fix] fix ipv6 url when warm up model (#1537)
This commit is contained in:
@@ -16,6 +16,7 @@ limitations under the License.
|
||||
"""Common utilities."""
|
||||
|
||||
import base64
|
||||
import ipaddress
|
||||
import logging
|
||||
import os
|
||||
import pickle
|
||||
@@ -54,6 +55,14 @@ def is_hip() -> bool:
|
||||
return torch.version.hip is not None
|
||||
|
||||
|
||||
def is_ipv6(address):
|
||||
try:
|
||||
ipaddress.IPv6Address(address)
|
||||
return True
|
||||
except ipaddress.AddressValueError:
|
||||
return False
|
||||
|
||||
|
||||
def enable_show_time_cost():
|
||||
global show_time_cost
|
||||
show_time_cost = True
|
||||
|
||||
Reference in New Issue
Block a user