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
585eabab
Commit
585eabab
authored
Jan 21, 2024
by
Lianmin Zheng
Browse files
Improve error message of openai
parent
cc3ada98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
python/sglang/backend/openai.py
python/sglang/backend/openai.py
+2
-2
No files found.
python/sglang/backend/openai.py
View file @
585eabab
...
...
@@ -51,11 +51,11 @@ CHAT_MODEL_NAMES = [
class
OpenAI
(
BaseBackend
):
def
__init__
(
self
,
model_name
,
*
args
,
**
kwargs
):
super
().
__init__
()
self
.
client
=
openai
.
OpenAI
(
*
args
,
**
kwargs
)
if
isinstance
(
openai
,
Exception
):
raise
e
raise
openai
self
.
client
=
openai
.
OpenAI
(
*
args
,
**
kwargs
)
self
.
model_name
=
model_name
self
.
tokenizer
=
tiktoken
.
encoding_for_model
(
model_name
)
self
.
logit_bias_int
=
create_logit_bias_int
(
self
.
tokenizer
)
...
...
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