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
OpenDAS
Lmdeploy
Commits
18170ee5
Unverified
Commit
18170ee5
authored
Nov 09, 2023
by
Chen Xin
Committed by
GitHub
Nov 09, 2023
Browse files
fix Tokenizer load error when the path of the being-converted model is not writable (#669)
parent
013000d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
lmdeploy/tokenizer.py
lmdeploy/tokenizer.py
+3
-1
No files found.
lmdeploy/tokenizer.py
View file @
18170ee5
# Copyright (c) OpenMMLab. All rights reserved.
import
json
import
os
import
os.path
as
osp
from
typing
import
Optional
,
Sequence
,
Union
...
...
@@ -125,7 +126,8 @@ class HuggingFaceTokenizer:
# save tokenizer.json to reuse
if
not
osp
.
exists
(
backend_tokenizer_file
)
and
model_file_exists
:
if
hasattr
(
self
.
model
,
'backend_tokenizer'
):
self
.
model
.
backend_tokenizer
.
save
(
backend_tokenizer_file
)
if
os
.
access
(
model_dir
,
os
.
W_OK
):
self
.
model
.
backend_tokenizer
.
save
(
backend_tokenizer_file
)
if
self
.
model
.
eos_token_id
is
None
:
generation_config_file
=
osp
.
join
(
model_dir
,
...
...
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