Unverified Commit d1139741 authored by Hailey Schoelkopf's avatar Hailey Schoelkopf Committed by GitHub
Browse files

make `deepsparse` import conditional

parent 4747d318
...@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment