Spaces:
Running
Running
Refactor prediction process by removing debug print statements and suppressing pandas warnings globally in the sentence transformer service.
Browse files
routes/predict.py
CHANGED
@@ -196,14 +196,6 @@ async def predict(
|
|
196 |
if col in df_output_data.columns:
|
197 |
df_output_data[col] = df_output_data[col].astype(str).fillna("")
|
198 |
|
199 |
-
# Debug: Print sample data before AbstractSimilarityMapper
|
200 |
-
print(f"DEBUG: Sample data before AbstractSimilarityMapper:")
|
201 |
-
print(
|
202 |
-
df_output_data[["標準科目", "摘要グループ", "確定", "摘要", "備考"]]
|
203 |
-
.head(3)
|
204 |
-
.to_string()
|
205 |
-
)
|
206 |
-
|
207 |
abstract_similarity_mapper = AbstractSimilarityMapper(
|
208 |
cached_embedding_helper=sentence_service.abstract_cached_embedding_helper,
|
209 |
df_map_data=sentence_service.df_abstract_map_data,
|
|
|
196 |
if col in df_output_data.columns:
|
197 |
df_output_data[col] = df_output_data[col].astype(str).fillna("")
|
198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
abstract_similarity_mapper = AbstractSimilarityMapper(
|
200 |
cached_embedding_helper=sentence_service.abstract_cached_embedding_helper,
|
201 |
df_map_data=sentence_service.df_abstract_map_data,
|
services/sentence_transformer_service.py
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
-
import pickle
|
2 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import sys
|
4 |
from config import (
|
5 |
MODEL_NAME,
|
|
|
|
|
1 |
import os
|
2 |
+
import pickle
|
3 |
+
import pandas as pd
|
4 |
+
import warnings
|
5 |
+
|
6 |
+
# Suppress pandas warnings globally
|
7 |
+
warnings.filterwarnings("ignore", category=FutureWarning)
|
8 |
+
warnings.filterwarnings("ignore", category=pd.errors.SettingWithCopyWarning)
|
9 |
+
pd.set_option("mode.chained_assignment", None)
|
10 |
+
|
11 |
import sys
|
12 |
from config import (
|
13 |
MODEL_NAME,
|