Spaces:
Running
Running
update run time
Browse files- routes/predict.py +4 -1
routes/predict.py
CHANGED
@@ -38,6 +38,7 @@ async def predict(
|
|
38 |
|
39 |
try:
|
40 |
# Process input data
|
|
|
41 |
inputData = InputNameData(sentence_service.dic_standard_subject)
|
42 |
inputData.load_data_from_csv(input_file_path)
|
43 |
inputData.process_data(sentence_service.sentenceTransformerHelper)
|
@@ -71,7 +72,9 @@ async def predict(
|
|
71 |
|
72 |
# Save with utf_8_sig encoding for Japanese Excel compatibility
|
73 |
output_df.to_csv(output_file_path, index=False, encoding="utf_8_sig")
|
74 |
-
|
|
|
|
|
75 |
return FileResponse(
|
76 |
path=output_file_path,
|
77 |
filename=f"output_{Path(file.filename).stem}.csv",
|
|
|
38 |
|
39 |
try:
|
40 |
# Process input data
|
41 |
+
start_time = time.time()
|
42 |
inputData = InputNameData(sentence_service.dic_standard_subject)
|
43 |
inputData.load_data_from_csv(input_file_path)
|
44 |
inputData.process_data(sentence_service.sentenceTransformerHelper)
|
|
|
72 |
|
73 |
# Save with utf_8_sig encoding for Japanese Excel compatibility
|
74 |
output_df.to_csv(output_file_path, index=False, encoding="utf_8_sig")
|
75 |
+
end_time = time.time()
|
76 |
+
execution_time = end_time - start_time
|
77 |
+
print(f"Execution time: {execution_time} seconds")
|
78 |
return FileResponse(
|
79 |
path=output_file_path,
|
80 |
filename=f"output_{Path(file.filename).stem}.csv",
|