AndySAnker commited on
Commit
6fe2177
1 Parent(s): d914a39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -86,6 +86,16 @@ def POMPredicter(POMFinder, Gr, y_onehotenc_cat):
86
 
87
  return res, y_pred_proba
88
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  st.title('POMFinder')
91
  st.write('Welcome to POMFinder which is a tree-based supervised learning algorithm that can predict the polyoxometalate cluster from a Pair Distribution Function.')
@@ -124,6 +134,9 @@ else:
124
  r, Gr = PDF_Preparation(args.data, args.Qmin, args.Qmax, args.Qdamp, rmax=10, nyquist=args.nyquist)
125
  res, y_pred_proba = POMPredicter(POMFinder, Gr, y_onehotenc_cat);
126
 
 
 
 
127
 
128
  st.subheader('Cite')
129
 
 
86
 
87
  return res, y_pred_proba
88
 
89
+ # Define a download button to download the file
90
+ def download_button(file_name, button_text):
91
+ with open(file_name, "rb") as f:
92
+ bytes = f.read()
93
+ st.download_button(
94
+ label=button_text,
95
+ data=bytes,
96
+ file_name=file_name,
97
+ mime="text/xyz",)
98
+
99
 
100
  st.title('POMFinder')
101
  st.write('Welcome to POMFinder which is a tree-based supervised learning algorithm that can predict the polyoxometalate cluster from a Pair Distribution Function.')
 
134
  r, Gr = PDF_Preparation(args.data, args.Qmin, args.Qmax, args.Qdamp, rmax=10, nyquist=args.nyquist)
135
  res, y_pred_proba = POMPredicter(POMFinder, Gr, y_onehotenc_cat);
136
 
137
+ # Download the structural database
138
+ download_button("COD_ICSD_XYZs_POMs_unique99.zip", "Download structural database")
139
+
140
 
141
  st.subheader('Cite')
142