Skip to content

Commit

Permalink
change import place
Browse files Browse the repository at this point in the history
  • Loading branch information
shijinPJ committed Sep 19, 2024
1 parent dd11d7f commit 38a0f8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions opencompass/datasets/dingo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@

from .base import BaseDataset

try:
from dingo.model.model import Model
from dingo.io import InputArgs
from dingo.exec import Executor
except Exception:
raise ModuleNotFoundError('=========== dingo register fail. please try: pip install dingo-python. ===========')

@LOAD_DATASET.register_module()
class DingoDataset(BaseDataset):

Expand Down Expand Up @@ -48,6 +41,14 @@ def load(path: str):

@ICL_EVALUATORS.register_module()
class DingoEvaluator(BaseEvaluator):
def __init__(self):
try:
from dingo.model.model import Model
from dingo.io import InputArgs
from dingo.exec import Executor
except Exception:
raise ModuleNotFoundError(
'=========== dingo register fail. please try: pip install dingo-python. ===========')

def score(self, origin_prompt: List, predictions: List) -> dict:
current_time = time.strftime('%Y%m%d_%H%M%S', time.localtime())
Expand Down
2 changes: 1 addition & 1 deletion requirements/extra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ pyext
pypinyin
# RULER
wonderwords
dingo
dingo-python

0 comments on commit 38a0f8b

Please sign in to comment.