Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
acaffd23
Unverified
Commit
acaffd23
authored
Sep 30, 2024
by
Xinyu Yang
Committed by
GitHub
Sep 29, 2024
Browse files
[Fix] fix ipv6 url when warm up model (#1537)
parent
04868543
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
python/sglang/srt/server_args.py
python/sglang/srt/server_args.py
+5
-2
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+9
-0
No files found.
python/sglang/srt/server_args.py
View file @
acaffd23
...
@@ -21,7 +21,7 @@ import logging
...
@@ -21,7 +21,7 @@ import logging
import
random
import
random
from
typing
import
List
,
Optional
,
Union
from
typing
import
List
,
Optional
,
Union
from
sglang.srt.utils
import
is_hip
from
sglang.srt.utils
import
is_hip
,
is_ipv6
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -570,7 +570,10 @@ class ServerArgs:
...
@@ -570,7 +570,10 @@ class ServerArgs:
return
cls
(
**
{
attr
:
getattr
(
args
,
attr
)
for
attr
in
attrs
})
return
cls
(
**
{
attr
:
getattr
(
args
,
attr
)
for
attr
in
attrs
})
def
url
(
self
):
def
url
(
self
):
return
f
"http://
{
self
.
host
}
:
{
self
.
port
}
"
if
is_ipv6
(
self
.
host
):
return
f
"http://[
{
self
.
host
}
]:
{
self
.
port
}
"
else
:
return
f
"http://
{
self
.
host
}
:
{
self
.
port
}
"
def
check_server_args
(
self
):
def
check_server_args
(
self
):
assert
(
assert
(
...
...
python/sglang/srt/utils.py
View file @
acaffd23
...
@@ -16,6 +16,7 @@ limitations under the License.
...
@@ -16,6 +16,7 @@ limitations under the License.
"""Common utilities."""
"""Common utilities."""
import
base64
import
base64
import
ipaddress
import
logging
import
logging
import
os
import
os
import
pickle
import
pickle
...
@@ -54,6 +55,14 @@ def is_hip() -> bool:
...
@@ -54,6 +55,14 @@ def is_hip() -> bool:
return
torch
.
version
.
hip
is
not
None
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
():
def
enable_show_time_cost
():
global
show_time_cost
global
show_time_cost
show_time_cost
=
True
show_time_cost
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment