sumesh4C commited on
Commit
dbda781
·
verified ·
1 Parent(s): 9a2ff40

Update tasks/text.py

Browse files
Files changed (1) hide show
  1. tasks/text.py +3 -3
tasks/text.py CHANGED
@@ -72,12 +72,12 @@ async def evaluate_text(request: TextEvaluationRequest):
72
  current_file_path = os.path.abspath(__file__)
73
  current_dir = os.path.dirname(current_file_path)
74
 
75
- with open(os.path.join(current_dir,"tfidf_vectorizer2.pkl"), "rb") as tfidf_file:
76
- tfidf_vectorizer = cloudpickle.load(tfidf_file)
77
 
78
 
79
  # Make predictions using the loaded model
80
- predictions = predict(test_dataset,tfidf_vectorizer,os.path.join(current_dir,"random_forest_model.pkl"))
81
  predictions = [LABEL_MAPPING[label] for label in predictions]
82
 
83
  #--------------------------------------------------------------------------------------------
 
72
  current_file_path = os.path.abspath(__file__)
73
  current_dir = os.path.dirname(current_file_path)
74
 
75
+ """ with open(os.path.join(current_dir,"tfidf_vectorizer2.pkl"), "rb") as tfidf_file:
76
+ tfidf_vectorizer = cloudpickle.load(tfidf_file)"""
77
 
78
 
79
  # Make predictions using the loaded model
80
+ predictions = predict(test_dataset,os.path.join(current_dir,"tfidf_vectorizer_params.json"),os.path.join(current_dir,"random_forest_model.pkl"))
81
  predictions = [LABEL_MAPPING[label] for label in predictions]
82
 
83
  #--------------------------------------------------------------------------------------------