Upload folder using huggingface_hub
Browse files
README.md
CHANGED
@@ -21114,14 +21114,5 @@ output = generate(model, processor, None, texts=["I like grapes", "I like fruits
|
|
21114 |
# Get text embeddings from the output
|
21115 |
embeddings = output.text_embeds # Shape: [batch_size, hidden_size]
|
21116 |
|
21117 |
-
# For masked language modeling
|
21118 |
-
output = generate(model, processor, None, texts=["The capital of France is [MASK]."])
|
21119 |
-
|
21120 |
-
mask_index = processor.encode("[MASK]", add_special_tokens=False)[0]
|
21121 |
-
|
21122 |
-
predicted_token_id = mx.argmax(output.logits[0, mask_index], axis=-1)
|
21123 |
-
|
21124 |
-
predicted_token = processor.decode([predicted_token_id.item()])
|
21125 |
-
|
21126 |
|
21127 |
```
|
|
|
21114 |
# Get text embeddings from the output
|
21115 |
embeddings = output.text_embeds # Shape: [batch_size, hidden_size]
|
21116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21117 |
|
21118 |
```
|