Skip to content

Commit

Permalink
To solve the "ImportError: always import a name 'LlamaTokenizer' from…
Browse files Browse the repository at this point in the history
… 'transformers. Models. Llama" problem (#745)

RuntimeError: Failed to import modelscope.models.nlp.llama2 because of the following error (look up to see its traceback):
*aot imoont mame 'lamalokenizer'from tnansformers.models,llama /e:PVthoPvthn311li site-Dackagesitransformers models llama init.y
  • Loading branch information
Siu-Ming committed Feb 23, 2024
1 parent 158d72b commit 4f2e9d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modelscope/models/nlp/llama/__init__.py
@@ -1,8 +1,11 @@
# Copyright (c) Alibaba, Inc. and its affiliates.
from typing import TYPE_CHECKING

from transformers.models.llama import (LlamaConfig, LlamaTokenizer,
LlamaTokenizerFast)
# from transformers.models.llama import (LlamaConfig, LlamaTokenizer,
# LlamaTokenizerFast)

from transformers import LlamaTokenizer
from transformers.models.llama import (LlamaConfig, LlamaTokenizerFast)

from modelscope.utils.import_utils import LazyImportModule

Expand Down

0 comments on commit 4f2e9d2

Please sign in to comment.