Fill-Mask
Transformers
Safetensors
English
gemma3_text
feature-extraction
ecommerce
e-commerce
retail
marketplace
shopping
amazon
ebay
alibaba
google
rakuten
bestbuy
walmart
flipkart
wayfair
shein
target
etsy
shopify
taobao
asos
carrefour
costco
overstock
pretraining
encoder
language-modeling
foundation-model
custom_code
text-generation-inference
Update README.md
Browse files
README.md
CHANGED
|
@@ -91,7 +91,23 @@ with torch.no_grad():
|
|
| 91 |
emb = (out.last_hidden_state * inputs.attention_mask.unsqueeze(-1)).sum(dim=1) / inputs.attention_mask.sum(dim=1, keepdim=True)
|
| 92 |
```
|
| 93 |
|
|
|
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
---
|
| 96 |
|
| 97 |
## Intended Uses & Limitations
|
|
|
|
| 91 |
emb = (out.last_hidden_state * inputs.attention_mask.unsqueeze(-1)).sum(dim=1) / inputs.attention_mask.sum(dim=1, keepdim=True)
|
| 92 |
```
|
| 93 |
|
| 94 |
+
### Sentence-Transformers
|
| 95 |
|
| 96 |
+
```python
|
| 97 |
+
from transformers import AutoModelForMaskedLM, AutoTokenizer
|
| 98 |
+
|
| 99 |
+
model_name = "thebajajra/RexGemma-2048"
|
| 100 |
+
|
| 101 |
+
model_mlm = AutoModelForMaskedLM.from_pretrained(model_name, trust_remote_code=True)
|
| 102 |
+
encoder = model_mlm.encoder
|
| 103 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
| 104 |
+
|
| 105 |
+
ENCODER_DIR = "rexgemma-2048-encoder-only"
|
| 106 |
+
encoder.save_pretrained(ENCODER_DIR)
|
| 107 |
+
tokenizer.save_pretrained(ENCODER_DIR)
|
| 108 |
+
|
| 109 |
+
model = SentenceTransformer(ENCODER_DIR)
|
| 110 |
+
```
|
| 111 |
---
|
| 112 |
|
| 113 |
## Intended Uses & Limitations
|