Akshay Vs commited on
Commit
5f669c2
1 Parent(s): ef0e5a7
Files changed (1) hide show
  1. app.py +18 -19
app.py CHANGED
@@ -7,10 +7,10 @@ from random import randint
7
 
8
  # initializing session_state
9
  st.session_state['new']=True
10
- #if st.session_state.new==True:
11
- os.system('pip install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html')
12
- os.system('pip install transformers')
13
- st.session_state.new=False
14
 
15
  from transformers import pipeline, set_seed
16
 
@@ -29,18 +29,17 @@ def type_text(text):
29
  sys.stdout.write(letter)
30
  time.sleep(0)
31
 
32
- if __name__ == "__main__":
33
- text = input("Enter something to begin with... ")
34
- print(".\n.\n.\nGenerating\n.\n.\n.")
35
-
36
- for _ in range(50):
37
- result = generate(text)
38
- text=slice(result)
39
- with concurrent.futures.ThreadPoolExecutor() as executor:
40
- executor.submit(type_text, result.replace(text,""))
41
-
42
- #Streamlit
43
- st.title("Story AI")
44
- st.markdown("<h1 style='text-align: center; color: white;'>I can generate intresting stories</h1>", unsafe_allow_html=True)
45
- st.markdown('')
46
- st.markdown('')
 
7
 
8
  # initializing session_state
9
  st.session_state['new']=True
10
+ if st.session_state.new==True:
11
+ os.system('pip install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html')
12
+ os.system('pip install transformers')
13
+ st.session_state.new=False
14
 
15
  from transformers import pipeline, set_seed
16
 
 
29
  sys.stdout.write(letter)
30
  time.sleep(0)
31
 
32
+ text = input("Enter something to begin with... ")
33
+ print(".\n.\n.\nGenerating\n.\n.\n.")
34
+
35
+ for _ in range(50):
36
+ result = generate(text)
37
+ text=slice(result)
38
+ with concurrent.futures.ThreadPoolExecutor() as executor:
39
+ executor.submit(type_text, result.replace(text,""))
40
+
41
+ #Streamlit
42
+ st.title("Story AI")
43
+ st.markdown("<h1 style='text-align: center; color: white;'>I can generate intresting stories</h1>", unsafe_allow_html=True)
44
+ st.markdown('')
45
+ st.markdown('')