admchiem commited on
Commit
fd64fb4
·
1 Parent(s): d8e1c23

Ajout du print pour vérifier que le modèle ne se recharge qu'une fois

Browse files
__pycache__/inference.cpython-39.pyc CHANGED
Binary files a/__pycache__/inference.cpython-39.pyc and b/__pycache__/inference.cpython-39.pyc differ
 
inference.py CHANGED
@@ -132,6 +132,7 @@ label_encoder = joblib.load("label_encoder.pkl")
132
  class_centroids = joblib.load("class_centroids.pkl")
133
  best_threshold = joblib.load("oos_threshold.pkl")
134
 
 
135
  # Recharger l'embedding model
136
  embedder = SentenceTransformer("intfloat/e5-small-v2")
137
 
@@ -145,8 +146,3 @@ model = IntentClassifierWithOOS(
145
  oos_threshold=best_threshold,
146
  device="cpu"
147
  )
148
-
149
- if __name__ == "__main__":
150
- # Test with a sample query
151
- result = model.predict("Can you play some jazz music?")
152
- print(result)
 
132
  class_centroids = joblib.load("class_centroids.pkl")
133
  best_threshold = joblib.load("oos_threshold.pkl")
134
 
135
+ print("Model charging")
136
  # Recharger l'embedding model
137
  embedder = SentenceTransformer("intfloat/e5-small-v2")
138
 
 
146
  oos_threshold=best_threshold,
147
  device="cpu"
148
  )