[Bug] Fix bug in turbomind (#1377)

This commit is contained in:
Songyang Zhang 2024-07-30 09:37:50 +08:00 committed by GitHub
parent eee5a5be23
commit 33ceaa0eb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,7 +61,8 @@ class TurboMindModel(BaseModel):
from lmdeploy.messages import TurbomindEngineConfig
engine_config = TurbomindEngineConfig(**engine_config)
self.logger = get_logger()
assert os.path.exists(path), '{} is not existist'.format(path)
if path.startswith('/') or path.startswith('.'):
assert os.path.exists(path), '{} is not existist'.format(path)
tm_model = TurboMind.from_pretrained(path, engine_config=engine_config)
self.tokenizer = tm_model.tokenizer
self.generators = [