Greg Thompson commited on
Commit
52065cc
1 Parent(s): 22b2ae8

Move model to global namespace

Browse files
mathtext_fastapi/intent_classification.py CHANGED
@@ -42,7 +42,10 @@ def retrieve_intent_classification_model():
42
 
43
 
44
  encoder = SentenceTransformer('all-MiniLM-L6-v2')
45
- model = retrieve_intent_classification_model()
 
 
 
46
 
47
  def predict_message_intent(message):
48
  tokenized_utterance = np.array([list(encoder.encode(message))])
 
42
 
43
 
44
  encoder = SentenceTransformer('all-MiniLM-L6-v2')
45
+ # model = retrieve_intent_classification_model()
46
+ DATA_DIR = Path(__file__).parent.parent / "mathtext_fastapi" / "data" / "intent_classification_model.joblib"
47
+ model = load(DATA_DIR)
48
+
49
 
50
  def predict_message_intent(message):
51
  tokenized_utterance = np.array([list(encoder.encode(message))])