Abdulabin commited on
Commit
67c52d0
·
verified ·
1 Parent(s): 070f1a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -191,6 +191,14 @@ if prob =="General Problem":
191
  except:
192
  st.write("Please Train Model first ..")
193
 
 
 
 
 
 
 
 
 
194
  if prob == "Time Series Problem":
195
  if uploaded_file is not None:
196
  df = pd.read_csv(uploaded_file)
@@ -288,7 +296,7 @@ if prob == "Time Series Problem":
288
  )
289
 
290
  with st.container():
291
- col1 ,col2 ,col3= st.columns([2,2,6])
292
  with col1:
293
  train_time = st.button("Train Time Series Model....")
294
  with col2:
@@ -362,7 +370,12 @@ if prob == "Time Series Problem":
362
  except:
363
  st.write("Please Train Model First....")
364
 
365
-
 
 
 
 
 
366
 
367
  file_path = os.path.join('best_model.pkl')
368
  file_path2 = os.path.join('best_model_time.pkl')
 
191
  except:
192
  st.write("Please Train Model first ..")
193
 
194
+
195
+ try:
196
+ with open("best_model.pkl", "rb") as f:
197
+ file_contents = f.read()
198
+ st.download_button('Download Model', file_contents, file_name='best_model.pkl', mime='application/octet-stream')
199
+ except:
200
+ pass
201
+
202
  if prob == "Time Series Problem":
203
  if uploaded_file is not None:
204
  df = pd.read_csv(uploaded_file)
 
296
  )
297
 
298
  with st.container():
299
+ col1 ,col2 ,col3= st.columns([2,3,6])
300
  with col1:
301
  train_time = st.button("Train Time Series Model....")
302
  with col2:
 
370
  except:
371
  st.write("Please Train Model First....")
372
 
373
+ try:
374
+ with open("best_model_time.pkl", "rb") as f:
375
+ file_contents = f.read()
376
+ st.download_button('Download Model', file_contents, file_name='best_model_time.pkl', mime='application/octet-stream')
377
+ except:
378
+ pass
379
 
380
  file_path = os.path.join('best_model.pkl')
381
  file_path2 = os.path.join('best_model_time.pkl')