Skip to content

Commit

Permalink
fix ci check
Browse files Browse the repository at this point in the history
  • Loading branch information
lvhan028 committed Sep 23, 2024
1 parent 73df7ca commit 2997b3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions opencompass/models/turbomind_with_tf_above_v4_33.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import copy
from typing import Dict, List, Optional, Union

import numpy as np
from lmdeploy import PytorchEngineConfig, TurbomindEngineConfig, pipeline
from transformers import AutoTokenizer

from opencompass.models.base import BaseModel
from opencompass.utils.logging import get_logger
from opencompass.utils.prompt import PromptList
Expand Down Expand Up @@ -48,6 +44,7 @@ def __init__(
self.template_parser = _get_meta_template(meta_template)
self.max_seq_len = _get_possible_max_seq_len(max_seq_len, path)

from transformers import AutoTokenizer
self.tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
if not tokenizer_only:
DEFAULT_ENGING_CONFIG = {'session_len': self.max_seq_len}
Expand Down Expand Up @@ -147,6 +144,9 @@ def get_token_len(self, prompt: str) -> int:
return len(t['input_ids'])

def _build_pipe(self, model_path, backend, engine_config):
from lmdeploy import (PytorchEngineConfig, TurbomindEngineConfig,
pipeline)

assert backend in ['pytorch', 'turbomind'], \
f'unsupported backend type: {backend}'

Expand Down

0 comments on commit 2997b3e

Please sign in to comment.