Spaces:
Running
Running
Work around Transformers setting Keras to legacy
Browse files
app.py
CHANGED
@@ -15,10 +15,10 @@ with open(model_probs_path) as f:
|
|
15 |
nn_model_path = hf_hub_download(repo_id="tbitai/nn-enron1-spam", filename="nn-enron1-spam.keras")
|
16 |
nn_model = tf.keras.models.load_model(nn_model_path)
|
17 |
|
18 |
-
st_model = SentenceTransformer("avsolatorio/GIST-large-Embedding-v0")
|
19 |
llm_model_path = hf_hub_download(repo_id="tbitai/gisty-enron1-spam", filename="gisty-enron1-spam.keras")
|
20 |
llm_model = tf.keras.models.load_model(llm_model_path)
|
21 |
-
|
|
|
22 |
|
23 |
# Utils for Bayes
|
24 |
|
|
|
15 |
nn_model_path = hf_hub_download(repo_id="tbitai/nn-enron1-spam", filename="nn-enron1-spam.keras")
|
16 |
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 |
+
# SentenceTransformer should be called after Keras models, in order to prevent it from setting Keras to legacy.
|
21 |
+
st_model = SentenceTransformer("avsolatorio/GIST-large-Embedding-v0")
|
22 |
|
23 |
# Utils for Bayes
|
24 |
|