Spaces:
Sleeping
Sleeping
Fix Sentence Transformers import location
Browse files
app.py
CHANGED
@@ -3,7 +3,6 @@ from huggingface_hub import hf_hub_download
|
|
3 |
import json
|
4 |
import tensorflow as tf
|
5 |
import numpy as np
|
6 |
-
from sentence_transformers import SentenceTransformer
|
7 |
|
8 |
|
9 |
# Load models
|
@@ -17,7 +16,8 @@ nn_model = tf.keras.models.load_model(nn_model_path)
|
|
17 |
|
18 |
llm_model_path = hf_hub_download(repo_id="tbitai/gisty-enron1-spam", filename="gisty-enron1-spam.keras")
|
19 |
llm_model = tf.keras.models.load_model(llm_model_path)
|
20 |
-
#
|
|
|
21 |
st_model = SentenceTransformer("avsolatorio/GIST-large-Embedding-v0")
|
22 |
|
23 |
# Utils for Bayes
|
|
|
3 |
import json
|
4 |
import tensorflow as tf
|
5 |
import numpy as np
|
|
|
6 |
|
7 |
|
8 |
# Load models
|
|
|
16 |
|
17 |
llm_model_path = hf_hub_download(repo_id="tbitai/gisty-enron1-spam", filename="gisty-enron1-spam.keras")
|
18 |
llm_model = tf.keras.models.load_model(llm_model_path)
|
19 |
+
# Sentence Transformers should be imported after Keras models, in order to prevent it from setting Keras to legacy.
|
20 |
+
from sentence_transformers import SentenceTransformer
|
21 |
st_model = SentenceTransformer("avsolatorio/GIST-large-Embedding-v0")
|
22 |
|
23 |
# Utils for Bayes
|