启动不了

#120
by onthewayzh - opened

QQ_1743127756787.png

ls jinaai/
jina-embeddings-v3  xlm-roberta-flash-implementation
(ptca) root@ace77ead1284:/xiaobaogong/ai# cat test.py 
from transformers import AutoModel

# Initialize the model
model = AutoModel.from_pretrained("jinaai/jina-embeddings-v3", trust_remote_code=True)

texts = [
    "Follow the white rabbit.",  # English
    "Sigue al conejo blanco.",  # Spanish
    "Suis le lapin blanc.",  # French
    "跟着白兔走。",  # Chinese
    "اتبع الأرنب الأبيض.",  # Arabic
    "Folge dem weißen Kaninchen.",  # German
]

# When calling the `encode` function, you can choose a `task` based on the use case:
# 'retrieval.query', 'retrieval.passage', 'separation', 'classification', 'text-matching'
# Alternatively, you can choose not to pass a `task`, and no specific LoRA adapter will be used.
embeddings = model.encode(texts, task="text-matching")

# Compute similarities
print(embeddings[0] @ embeddings[1].T)

(ptca) root@ace77ead1284:/xiaobaogong/ai# pip3 list | grep transformers
transformers             4.28.0

[notice] A new release of pip is available: 23.2.1 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
(ptca) root@ace77ead1284:/xiaobaogong/ai# python3 test.py 
Explicitly passing a `revision` is encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision.
Could not locate the jinaai/xlm-roberta-flash-implementation--configuration_xlm_roberta.py inside jinaai/jina-embeddings-v3.
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    model = AutoModel.from_pretrained("jinaai/jina-embeddings-v3", trust_remote_code=True)
  File "/opt/conda/envs/ptca/lib/python3.8/site-packages/transformers/models/auto/auto_factory.py", line 441, in from_pretrained
    config, kwargs = AutoConfig.from_pretrained(
  File "/opt/conda/envs/ptca/lib/python3.8/site-packages/transformers/models/auto/configuration_auto.py", line 931, in from_pretrained
    config_class = get_class_from_dynamic_module(
  File "/opt/conda/envs/ptca/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 377, in get_class_from_dynamic_module
    final_module = get_cached_module_file(
  File "/opt/conda/envs/ptca/lib/python3.8/site-packages/transformers/dynamic_module_utils.py", line 232, in get_cached_module_file
    resolved_module_file = cached_file(
  File "/opt/conda/envs/ptca/lib/python3.8/site-packages/transformers/utils/hub.py", line 380, in cached_file
    raise EnvironmentError(
OSError: jinaai/jina-embeddings-v3 does not appear to have a file named jinaai/xlm-roberta-flash-implementation--configuration_xlm_roberta.py. Checkout 'https://huggingface.co/jinaai/jina-embeddings-v3/None' for available files.
Your need to confirm your account before you can post a new comment.

Sign up or log in to comment