Feature Extraction
sentence-transformers
Safetensors
Transformers
qwen3_pseudo_moe
sentence-similarity
custom_code
Instructions to use geevec-ai/geevec-embeddings-1.0-lite with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use geevec-ai/geevec-embeddings-1.0-lite with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("geevec-ai/geevec-embeddings-1.0-lite", 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] - Transformers
How to use geevec-ai/geevec-embeddings-1.0-lite with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="geevec-ai/geevec-embeddings-1.0-lite", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("geevec-ai/geevec-embeddings-1.0-lite", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling_qwen3_pseudo_moe.py
Browse filesFix loading under Transformers 5 (_tied_weights_keys)
Loading fails on Transformers 5.x in post_init() with AttributeError: 'list' object has no attribute 'keys'. The cause is that _tied_weights_keys = [] uses the old list format while config.json sets tie_word_embeddings: true. This sets it to None, the PreTrainedModel default; nothing is tied, since the model has no LM head. It also replaces the deprecated config.use_return_dict with an equivalent expression. Tested with Transformers 4.51.3, 4.57.1 and 5.18.0: all 475 weights load and the embeddings are identical to the original code's.
modeling_qwen3_pseudo_moe.py
CHANGED
|
@@ -92,7 +92,9 @@ class MultiLoRALinear(nn.Module):
|
|
| 92 |
class Qwen3PseudoMoEModelModel(Qwen3PreTrainedModel):
|
| 93 |
config_class = Qwen3PseudoMoEConfig
|
| 94 |
_no_split_modules = ["Qwen3DecoderLayer"]
|
| 95 |
-
|
|
|
|
|
|
|
| 96 |
|
| 97 |
def __init__(self, config: Qwen3PseudoMoEConfig):
|
| 98 |
super().__init__(config)
|
|
@@ -169,7 +171,10 @@ class Qwen3PseudoMoEModelModel(Qwen3PreTrainedModel):
|
|
| 169 |
if domain is not None:
|
| 170 |
self.set_domain(domain)
|
| 171 |
|
| 172 |
-
|
|
|
|
|
|
|
|
|
|
| 173 |
|
| 174 |
outputs = self.model(
|
| 175 |
input_ids=input_ids,
|
|
@@ -222,4 +227,4 @@ class Qwen3PseudoMoEModelModel(Qwen3PreTrainedModel):
|
|
| 222 |
|
| 223 |
|
| 224 |
AutoConfig.register("qwen3_pseudo_moe", Qwen3PseudoMoEConfig)
|
| 225 |
-
AutoModel.register(Qwen3PseudoMoEConfig, Qwen3PseudoMoEModelModel)
|
|
|
|
| 92 |
class Qwen3PseudoMoEModelModel(Qwen3PreTrainedModel):
|
| 93 |
config_class = Qwen3PseudoMoEConfig
|
| 94 |
_no_split_modules = ["Qwen3DecoderLayer"]
|
| 95 |
+
# Nothing is tied (the model has no LM head). None is the PreTrainedModel default in every Transformers
|
| 96 |
+
# version; the former [] crashes Transformers 5, which expects a dict here when tie_word_embeddings is true.
|
| 97 |
+
_tied_weights_keys = None
|
| 98 |
|
| 99 |
def __init__(self, config: Qwen3PseudoMoEConfig):
|
| 100 |
super().__init__(config)
|
|
|
|
| 171 |
if domain is not None:
|
| 172 |
self.set_domain(domain)
|
| 173 |
|
| 174 |
+
# Same result as config.use_return_dict, which Transformers 5 deprecates (5.x also drops torchscript).
|
| 175 |
+
return_dict = return_dict if return_dict is not None else (
|
| 176 |
+
getattr(self.config, "return_dict", True) and not getattr(self.config, "torchscript", False)
|
| 177 |
+
)
|
| 178 |
|
| 179 |
outputs = self.model(
|
| 180 |
input_ids=input_ids,
|
|
|
|
| 227 |
|
| 228 |
|
| 229 |
AutoConfig.register("qwen3_pseudo_moe", Qwen3PseudoMoEConfig)
|
| 230 |
+
AutoModel.register(Qwen3PseudoMoEConfig, Qwen3PseudoMoEModelModel)
|