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
a97a5a9e
Unverified
Commit
a97a5a9e
authored
Nov 22, 2023
by
Hailey Schoelkopf
Committed by
GitHub
Nov 22, 2023
Browse files
make optimum imports conditional
parent
84f1a131
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lm_eval/models/gpt2.py
lm_eval/models/gpt2.py
+3
-2
No files found.
lm_eval/models/gpt2.py
View file @
a97a5a9e
...
@@ -2,8 +2,6 @@ import torch
...
@@ -2,8 +2,6 @@ import torch
import
transformers
import
transformers
from
typing
import
Optional
,
Union
from
typing
import
Optional
,
Union
from
lm_eval.base
import
BaseLM
from
lm_eval.base
import
BaseLM
import
optimum
from
optimum.intel.openvino
import
OVModelForCausalLM
def
_get_dtype
(
dtype
:
Union
[
str
,
torch
.
dtype
])
->
torch
.
dtype
:
def
_get_dtype
(
dtype
:
Union
[
str
,
torch
.
dtype
])
->
torch
.
dtype
:
...
@@ -193,6 +191,9 @@ class OPTIMUMLM(BaseLM):
...
@@ -193,6 +191,9 @@ class OPTIMUMLM(BaseLM):
):
):
super
().
__init__
()
super
().
__init__
()
import
optimum
from
optimum.intel.openvino
import
OVModelForCausalLM
assert
isinstance
(
device
,
str
)
assert
isinstance
(
device
,
str
)
assert
isinstance
(
pretrained
,
str
)
assert
isinstance
(
pretrained
,
str
)
assert
isinstance
(
batch_size
,
(
int
,
str
))
assert
isinstance
(
batch_size
,
(
int
,
str
))
...
...
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