Spaces:
Sleeping
Sleeping
Update app.py
Browse files47 unmodified lines4849505152535455565758596061626364656667187 unmodified lines25525625725847 unmodified linesnow = datetime.now()current_time = now.strftime("%Y-%m-%d %H:%M:%S")# If prediction is a NumPy ndarray, convert it to a scalar or listif isinstance(prediction, np.ndarray):prediction = prediction.tolist() # Convert ndarray to listelse:prediction = str(prediction) # Ensure it's a string if it's not a list# Convert prediction to "Đúng hạn" or "Không đúng hạn"if prediction == 1:prediction_result = "Đúng hạn"else:prediction_result = "Không đúng hạn"# Create a data row to insert into the sheetdata_row = [name, student_id, major, prediction_result, current_time]# Connect to Google Sheetsclient = get_gsheet_client()187 unmodified lines# st.write("Available sheet names:", sheet_names)# Ghi log lên Google Sheetssave_to_gsheet(name, student_id, major, prediction[0])47 unmodified lines48495051525354555657187 unmodified lines24524624724847 unmodified linesnow = datetime.now()current_time = now.strftime("%Y-%m-%d %H:%M:%S")# Create a data row to insert into the sheetdata_row = [name, student_id, major, prediction, current_time]# Connect to Google Sheetsclient = get_gsheet_client()187 unmodified lines# st.write("Available sheet names:", sheet_names)# Ghi log lên Google Sheetssave_to_gsheet(name, student_id, major, prediction)
app.py+3-13