Spaces:
Sleeping
Sleeping
update model
Browse files- config.py +2 -2
- data/{anchor_name_sentence_embeddings(cl-nagoya-sup-simcse-ja-for-standard-name-v0_9_11).pkl → anchor_name_sentence_embeddings_cl-nagoya-sup-simcse-ja-nss-v_1_0_5.pkl} +2 -2
- data/anchor_name_sentence_sentence_embeddings(cl-nagoya-sup-simcse-ja-for-standard-name-v0_9_10).pkl +0 -3
- data/anchor_name_sentence_sentence_embeddings(cl-nagoya-sup-simcse-ja-for-standard-name-v0_9_11).pkl +0 -3
- data/standardData.csv +0 -0
- prepare.py +7 -6
- services/sentence_transformer_service.py +1 -1
config.py
CHANGED
@@ -14,10 +14,10 @@ SUBJECT_DATA_FILE = os.path.join(DATA_DIR, "subjectData.csv")
|
|
14 |
SAMPLE_DATA_FILE = os.path.join(DATA_DIR, "sampleData.csv")
|
15 |
STANDARD_NAME_MAP_DATA_FILE = os.path.join(DATA_DIR, "standardData.csv")
|
16 |
# Model Names
|
17 |
-
MODEL_NAME = "Detomo/cl-nagoya-sup-simcse-ja-nss-
|
18 |
SENTENCE_EMBEDDING_FILE = os.path.join(
|
19 |
DATA_DIR,
|
20 |
-
"anchor_name_sentence_embeddings_cl-nagoya-sup-simcse-ja-nss-
|
21 |
)
|
22 |
# SENTENCE_EMBEDDING_FILE = None
|
23 |
MODEL_TYPE = "openvino"
|
|
|
14 |
SAMPLE_DATA_FILE = os.path.join(DATA_DIR, "sampleData.csv")
|
15 |
STANDARD_NAME_MAP_DATA_FILE = os.path.join(DATA_DIR, "standardData.csv")
|
16 |
# Model Names
|
17 |
+
MODEL_NAME = "Detomo/cl-nagoya-sup-simcse-ja-nss-v_1_0_5"
|
18 |
SENTENCE_EMBEDDING_FILE = os.path.join(
|
19 |
DATA_DIR,
|
20 |
+
"anchor_name_sentence_embeddings_cl-nagoya-sup-simcse-ja-nss-v_1_0_5.pkl",
|
21 |
)
|
22 |
# SENTENCE_EMBEDDING_FILE = None
|
23 |
MODEL_TYPE = "openvino"
|
data/{anchor_name_sentence_embeddings(cl-nagoya-sup-simcse-ja-for-standard-name-v0_9_11).pkl → anchor_name_sentence_embeddings_cl-nagoya-sup-simcse-ja-nss-v_1_0_5.pkl}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c82797adfac6a639b7566fdd424f876273177e4ebb4a5279889d73e41630b7bd
|
3 |
+
size 21209252
|
data/anchor_name_sentence_sentence_embeddings(cl-nagoya-sup-simcse-ja-for-standard-name-v0_9_10).pkl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:062effa64e2fdd7b5b7253b596d777dea75a892b0b011592657ea51c3861ce62
|
3 |
-
size 21565604
|
|
|
|
|
|
|
|
data/anchor_name_sentence_sentence_embeddings(cl-nagoya-sup-simcse-ja-for-standard-name-v0_9_11).pkl
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:a4ab694e49dc81208646d88e29eb5b593a0a5c9da8236396d4d8d9f1e28a9786
|
3 |
-
size 12260516
|
|
|
|
|
|
|
|
data/standardData.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
prepare.py
CHANGED
@@ -4,7 +4,7 @@ from sentence_transformers import (
|
|
4 |
export_dynamic_quantized_onnx_model,
|
5 |
)
|
6 |
|
7 |
-
MODEL_NAME = "Detomo/cl-nagoya-sup-simcse-ja-nss-
|
8 |
|
9 |
|
10 |
def export_model(backend="onnx", use_qint8=False):
|
@@ -16,9 +16,10 @@ def export_model(backend="onnx", use_qint8=False):
|
|
16 |
quantization_config=None,
|
17 |
model_name_or_path=MODEL_NAME,
|
18 |
push_to_hub=True,
|
|
|
19 |
)
|
20 |
else:
|
21 |
-
model.push_to_hub(MODEL_NAME)
|
22 |
elif backend == "onnx":
|
23 |
model = SentenceTransformer(MODEL_NAME, backend="onnx")
|
24 |
if use_qint8:
|
@@ -32,7 +33,7 @@ def export_model(backend="onnx", use_qint8=False):
|
|
32 |
|
33 |
|
34 |
# Export all combinations
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
4 |
export_dynamic_quantized_onnx_model,
|
5 |
)
|
6 |
|
7 |
+
MODEL_NAME = "Detomo/cl-nagoya-sup-simcse-ja-nss-v_1_0_5"
|
8 |
|
9 |
|
10 |
def export_model(backend="onnx", use_qint8=False):
|
|
|
16 |
quantization_config=None,
|
17 |
model_name_or_path=MODEL_NAME,
|
18 |
push_to_hub=True,
|
19 |
+
create_pr=True,
|
20 |
)
|
21 |
else:
|
22 |
+
model.push_to_hub(MODEL_NAME, create_pr=True)
|
23 |
elif backend == "onnx":
|
24 |
model = SentenceTransformer(MODEL_NAME, backend="onnx")
|
25 |
if use_qint8:
|
|
|
33 |
|
34 |
|
35 |
# Export all combinations
|
36 |
+
backend = "openvino"
|
37 |
+
use_qint8 = False
|
38 |
+
print(f"Exporting {backend} model with QINT8={use_qint8}")
|
39 |
+
export_model(backend=backend, use_qint8=use_qint8)
|
services/sentence_transformer_service.py
CHANGED
@@ -53,7 +53,7 @@ class SentenceTransformerService:
|
|
53 |
)
|
54 |
with open(SENTENCE_EMBEDDING_FILE, "wb") as f:
|
55 |
pickle.dump(self.anchor_name_sentence_embeddings, f)
|
56 |
-
print(f"Saved anchor name sentence embeddings to {SENTENCE_EMBEDDING_FILE}")
|
57 |
|
58 |
# Update embeddings in StandardNameMapData
|
59 |
self.standardNameMapData.update_embeddings(self.anchor_name_sentence_embeddings)
|
|
|
53 |
)
|
54 |
with open(SENTENCE_EMBEDDING_FILE, "wb") as f:
|
55 |
pickle.dump(self.anchor_name_sentence_embeddings, f)
|
56 |
+
print(f"Saved anchor name sentence embeddings to {SENTENCE_EMBEDDING_FILE} with shape {self.anchor_name_sentence_embeddings.shape}")
|
57 |
|
58 |
# Update embeddings in StandardNameMapData
|
59 |
self.standardNameMapData.update_embeddings(self.anchor_name_sentence_embeddings)
|