Spaces:
Running
Running
File size: 432 Bytes
72cfe15 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
'''
For future reference with downloading model files:
import streamlit as st
import pickle
import base64
x = {"my": "data"}
def download_model(model):
output_model = pickle.dumps(model)
b64 = base64.b64encode(output_model).decode()
href = f'<a href="data:file/output_model;base64,{b64}" download="myfile.pkl">Download Trained Model .pkl File</a>'
st.markdown(href, unsafe_allow_html=True)
download_model(x)
''' |