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
4a0a1cd0
Unverified
Commit
4a0a1cd0
authored
Dec 15, 2023
by
q.yao
Committed by
GitHub
Dec 15, 2023
Browse files
Fix w4a16 conversion failed which is brought by PR 803 (#847)
parent
3295eac3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
lmdeploy/turbomind/deploy/target_model/base.py
lmdeploy/turbomind/deploy/target_model/base.py
+4
-3
No files found.
lmdeploy/turbomind/deploy/target_model/base.py
View file @
4a0a1cd0
...
@@ -152,9 +152,10 @@ class BaseOutputModel(ABC):
...
@@ -152,9 +152,10 @@ class BaseOutputModel(ABC):
tensor
.
contiguous
().
cpu
().
numpy
().
tofile
(
path
)
tensor
.
contiguous
().
cpu
().
numpy
().
tofile
(
path
)
if
self
.
to_file
:
if
self
.
to_file
:
torch_type
=
_WEIGHT_DTYPE_MAP
.
get
(
self
.
cfg
.
weight_type
,
if
torch
.
is_floating_point
(
param
):
torch
.
float16
)
torch_type
=
_WEIGHT_DTYPE_MAP
.
get
(
self
.
cfg
.
weight_type
,
param
=
param
.
to
(
torch_type
)
torch
.
float16
)
param
=
param
.
to
(
torch_type
)
tprint
(
name
,
param
.
shape
)
tprint
(
name
,
param
.
shape
)
_tofile
(
param
,
osp
.
join
(
self
.
out_dir
,
name
))
_tofile
(
param
,
osp
.
join
(
self
.
out_dir
,
name
))
elif
len
(
self
.
tm_params
)
>
0
:
elif
len
(
self
.
tm_params
)
>
0
:
...
...
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