File size: 2,615 Bytes
250c8ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b030ff5
250c8ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
```CODE: 
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("DatologyAI/luxical-one", trust_remote_code=True)

sentences = [
    "The weather is lovely today.",
    "It's so sunny outside!",
    "He drove to the stadium."
]
embeddings = model.encode(sentences)

similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
```

ERROR: 
Traceback (most recent call last):
  File "/tmp/DatologyAI_luxical-one_0ttgEtf.py", line 25, in <module>
    model = SentenceTransformer("DatologyAI/luxical-one", trust_remote_code=True)
  File "/tmp/.cache/uv/environments-v2/0c397aefee4cc689/lib/python3.13/site-packages/sentence_transformers/SentenceTransformer.py", line 327, in __init__
    modules, self.module_kwargs = self._load_sbert_model(
                                  ~~~~~~~~~~~~~~~~~~~~~~^
        model_name_or_path,
        ^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
        config_kwargs=config_kwargs,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/tmp/.cache/uv/environments-v2/0c397aefee4cc689/lib/python3.13/site-packages/sentence_transformers/SentenceTransformer.py", line 2251, in _load_sbert_model
    module_class: Module = self._load_module_class_from_ref(
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        class_ref, model_name_or_path, trust_remote_code, revision, model_kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/tmp/.cache/uv/environments-v2/0c397aefee4cc689/lib/python3.13/site-packages/sentence_transformers/SentenceTransformer.py", line 2141, in _load_module_class_from_ref
    return get_class_from_dynamic_module(
        class_ref,
    ...<2 lines>...
        code_revision=code_revision,
    )
  File "/tmp/.cache/uv/environments-v2/0c397aefee4cc689/lib/python3.13/site-packages/transformers/dynamic_module_utils.py", line 604, in get_class_from_dynamic_module
    final_module = get_cached_module_file(
        repo_id,
    ...<8 lines>...
        repo_type=repo_type,
    )
  File "/tmp/.cache/uv/environments-v2/0c397aefee4cc689/lib/python3.13/site-packages/transformers/dynamic_module_utils.py", line 427, in get_cached_module_file
    modules_needed = check_imports(resolved_module_file)
  File "/tmp/.cache/uv/environments-v2/0c397aefee4cc689/lib/python3.13/site-packages/transformers/dynamic_module_utils.py", line 260, in check_imports
    raise ImportError(
    ...<2 lines>...
    )
ImportError: This modeling file requires the following packages that were not found in your environment: luxical. Run `pip install luxical`