Update README.md
Browse files
README.md
CHANGED
|
@@ -60,6 +60,10 @@ model = AutoModel.from_pretrained("govtech/lionguard-2-lite", trust_remote_code=
|
|
| 60 |
|
| 61 |
# Download model from the 🤗 Hub
|
| 62 |
embedding_model = SentenceTransformer("google/embeddinggemma-300m")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
# Add prompt instructions to generate embeddings that are optimized to classify texts according to preset labels
|
| 64 |
formatted_texts = [f"task: classification | query: {c}" for c in texts]
|
| 65 |
embeddings = embedding_model.encode(formatted_texts) # NOTE: use encode() instead of encode_documents()
|
|
|
|
| 60 |
|
| 61 |
# Download model from the 🤗 Hub
|
| 62 |
embedding_model = SentenceTransformer("google/embeddinggemma-300m")
|
| 63 |
+
|
| 64 |
+
# Text to classify
|
| 65 |
+
texts = ["hello", "world"]
|
| 66 |
+
|
| 67 |
# Add prompt instructions to generate embeddings that are optimized to classify texts according to preset labels
|
| 68 |
formatted_texts = [f"task: classification | query: {c}" for c in texts]
|
| 69 |
embeddings = embedding_model.encode(formatted_texts) # NOTE: use encode() instead of encode_documents()
|