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

Update streamlit_app.py

Browse files
Files changed (1) hide show
  1. streamlit_app.py +27 -25
streamlit_app.py CHANGED
@@ -1,25 +1,27 @@
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"))
 
 
 
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
+ if characters:
18
+
19
+ states = None
20
+ next_char = tf.constant([characters])
21
+ result = [next_char]
22
+
23
+ for n in range(100):
24
+ next_char, states = one_step_reloaded.generate_one_step(next_char, states=states)
25
+ result.append(next_char)
26
+
27
+ st.write(tf.strings.join(result)[0].numpy().decode("utf-8"))