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
gaoqiong
lm-evaluation-harness
Commits
d1139741
Unverified
Commit
d1139741
authored
Nov 22, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Nov 22, 2023
Browse files
make `deepsparse` import conditional
parent
4747d318
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lm_eval/models/deepsparse.py
lm_eval/models/deepsparse.py
+2
-2
No files found.
lm_eval/models/deepsparse.py
View file @
d1139741
...
@@ -4,8 +4,6 @@ import random
...
@@ -4,8 +4,6 @@ import random
import
numpy
import
numpy
import
torch
import
torch
import
deepsparse
from
lm_eval
import
utils
from
lm_eval
import
utils
from
lm_eval.base
import
BaseLM
from
lm_eval.base
import
BaseLM
...
@@ -29,6 +27,8 @@ class DeepSparseLM(BaseLM):
...
@@ -29,6 +27,8 @@ class DeepSparseLM(BaseLM):
"""
"""
super
().
__init__
()
super
().
__init__
()
import
deepsparse
self
.
_batch_size
=
int
(
batch_size
)
self
.
_batch_size
=
int
(
batch_size
)
self
.
_max_length
=
max_length
or
self
.
_DEFAULT_MAX_LENGTH
self
.
_max_length
=
max_length
or
self
.
_DEFAULT_MAX_LENGTH
self
.
_max_gen_toks
=
max_gen_toks
self
.
_max_gen_toks
=
max_gen_toks
...
...
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