shubham680 commited on
Commit
8efce7b
·
verified ·
1 Parent(s): a824ec6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -5,5 +5,12 @@ import keras
5
 
6
  model = keras.models.load_model("model.keras")
7
 
 
 
 
 
 
 
 
8
  st.write("### Model Summary:")
9
- st.text(str(model.summary()))
 
5
 
6
  model = keras.models.load_model("model.keras")
7
 
8
+ old_stdout = sys.stdout # Save the current stdout so we can restore it later
9
+ sys.stdout = StringIO() # Redirect stdout to StringIO object
10
+ model.summary() # This will now be written to the StringIO object
11
+ model_summary = sys.stdout.getvalue() # Get the value from StringIO
12
+ sys.stdout = old_stdout # Restore original stdout
13
+
14
+ # Display model summary using Streamlit
15
  st.write("### Model Summary:")
16
+ st.text(model_summary)