Any-to-Any
Transformers
Safetensors
multilingual
spev
feature-extraction
multimodal
text
audio
image
video
decision-model
choice
qwen3-omni
lora
custom-code
custom_code
Instructions to use SpragAI/SPEV with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SpragAI/SPEV with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SpragAI/SPEV", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Preserve the existing branch matrix axis
Browse files- token_operations.py +2 -1
token_operations.py
CHANGED
|
@@ -72,7 +72,8 @@ def install(model,*,linears,moe):
|
|
| 72 |
if module.weight.dtype!=torch.bfloat16 or (is_output and value.ndim==2):
|
| 73 |
return original(value,*args,**kwargs)
|
| 74 |
shape=value.shape
|
| 75 |
-
|
|
|
|
| 76 |
return result.reshape(*shape[:-1],module.weight.shape[0])
|
| 77 |
return forward
|
| 78 |
if linears:
|
|
|
|
| 72 |
if module.weight.dtype!=torch.bfloat16 or (is_output and value.ndim==2):
|
| 73 |
return original(value,*args,**kwargs)
|
| 74 |
shape=value.shape
|
| 75 |
+
matrices=value if value.ndim==3 else value.reshape(1,-1,shape[-1])
|
| 76 |
+
result=batched_linear(matrices,module.weight,module.bias)
|
| 77 |
return result.reshape(*shape[:-1],module.weight.shape[0])
|
| 78 |
return forward
|
| 79 |
if linears:
|