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
AutoAWQ
Commits
cc779bed
Commit
cc779bed
authored
Aug 19, 2023
by
Casper Hansen
Browse files
Create generate method
parent
d68441d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
awq/models/base.py
awq/models/base.py
+4
-0
No files found.
awq/models/base.py
View file @
cc779bed
...
@@ -31,6 +31,10 @@ class BaseAWQForCausalLM(nn.Module):
...
@@ -31,6 +31,10 @@ class BaseAWQForCausalLM(nn.Module):
def
forward
(
self
,
*
args
,
**
kwargs
):
def
forward
(
self
,
*
args
,
**
kwargs
):
return
self
.
model
(
*
args
,
**
kwargs
)
return
self
.
model
(
*
args
,
**
kwargs
)
def
generate
(
self
,
*
args
,
**
kwargs
):
with
torch
.
inference_mode
():
return
self
.
model
.
generate
(
*
args
,
**
kwargs
)
@
torch
.
no_grad
()
@
torch
.
no_grad
()
def
quantize
(
self
,
tokenizer
=
None
,
quant_config
=
{},
n_samples
=
128
,
seqlen
=
512
,
def
quantize
(
self
,
tokenizer
=
None
,
quant_config
=
{},
n_samples
=
128
,
seqlen
=
512
,
...
...
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