Add modeling.py
Browse files- modeling.py +15 -11
modeling.py
CHANGED
|
@@ -1,11 +1,15 @@
|
|
| 1 |
-
import sys
|
| 2 |
-
from sentence_transformers import SentenceTransformer
|
| 3 |
-
|
| 4 |
-
# This is required for the Hugging Face model
|
| 5 |
-
def load_model():
|
| 6 |
-
"""Load the ZamAI Multilingual Embeddings model"""
|
| 7 |
-
return SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
| 8 |
-
|
| 9 |
-
if __name__ == "__main__":
|
| 10 |
-
model = load_model()
|
| 11 |
-
print("ZamAI Multilingual Embeddings model loaded successfully!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from sentence_transformers import SentenceTransformer
|
| 3 |
+
|
| 4 |
+
# This is required for the Hugging Face model
|
| 5 |
+
def load_model():
|
| 6 |
+
"""Load the ZamAI Multilingual Embeddings model"""
|
| 7 |
+
return SentenceTransformer('sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2')
|
| 8 |
+
|
| 9 |
+
if __name__ == "__main__":
|
| 10 |
+
model = load_model()
|
| 11 |
+
print("ZamAI Multilingual Embeddings model loaded successfully!")
|
| 12 |
+
# Save the model weights for Hugging Face upload
|
| 13 |
+
save_dir = "zamai-weights"
|
| 14 |
+
model.save_pretrained(save_dir)
|
| 15 |
+
print(f"Model weights saved to '{save_dir}/'. You can now push this folder to Hugging Face.")
|