Last active
March 30, 2022 15:41
-
-
Save mika-rafie/9d137957f078169b263182144d785cc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from urllib.request import urlopen | |
import streamlit as st | |
from keras_model import model # your custom model | |
my_email = st.secrets['email'] | |
model_weight_file = st.secrets['model_url'] | |
if not os.path.exists('./best_weights.h5'): | |
u = urlopen(model_weight_file) | |
data = u.read() | |
u.close() | |
with open('best_weights.h5', 'wb') as f: | |
f.write(data) | |
... | |
model = model.load_weights('best_weights.h5') | |
... | |
st.write(f'My email is {my_email}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment