Commit a57d5bcb authored by 赵威's avatar 赵威

try predict

parent e365ab19
...@@ -46,15 +46,14 @@ def model_predict_tractate(device_id, tractate_ids, device_dict, tractate_dict, ...@@ -46,15 +46,14 @@ def model_predict_tractate(device_id, tractate_ids, device_dict, tractate_dict,
time_1 = timeit.default_timer() time_1 = timeit.default_timer()
predictions = predict_fn({"examples": examples}) predictions = predict_fn({"examples": examples})
print(predictions) res_tuple = sorted(zip(tractate_ids_res, predictions["output"].tolist()), key=lambda x: x[1], reverse=True)
# res_tuple = sorted(zip(tractate_ids_res, predictions["output"].tolist()), key=lambda x: x[1], reverse=True) res = []
# res = [] for (id, _) in res_tuple:
# for (id, _) in res_tuple: res.append(int(id))
# res.append(int(id)) # print(res)
# # print(res)
total_1 = (timeit.default_timer() - time_1) total_1 = (timeit.default_timer() - time_1)
print("prediction cost {:.5f}s".format(total_1)) print("prediction cost {:.5f}s".format(total_1))
# return res return res
except Exception as e: except Exception as e:
print(e) print(e)
# device_info, _, _ = device_tractate_fe(device_id, tractate_ids, device_dict, tractate_dict) # device_info, _, _ = device_tractate_fe(device_id, tractate_ids, device_dict, tractate_dict)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment