Spaces:
Sleeping
Sleeping
Update tasks/text.py
Browse files- 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,
|
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 |
#--------------------------------------------------------------------------------------------
|