HarishMaths commited on
Commit
762f592
·
verified ·
1 Parent(s): 80cad69

Upload streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +25 -0
streamlit_app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import tensorflow as tf
3
+
4
+ st.markdown(
5
+ """
6
+ <h1 style='text-align: center; color: #4B8BBE; font-size: 48px;'>
7
+ Next Character Prediction
8
+ </h1>
9
+ """,
10
+ unsafe_allow_html=True
11
+ )
12
+
13
+ characters = st.text_input("Enter the characters to begin with")
14
+
15
+ one_step_reloaded = tf.saved_model.load('reonestep20F')
16
+
17
+ states = None
18
+ next_char = tf.constant([characters])
19
+ result = [next_char]
20
+
21
+ for n in range(100):
22
+ next_char, states = one_step_reloaded.generate_one_step(next_char, states=states)
23
+ result.append(next_char)
24
+
25
+ st.write(tf.strings.join(result)[0].numpy().decode("utf-8"))