dk-crazydiv commited on
Commit
07933be
·
1 Parent(s): 91afb34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -5,9 +5,8 @@ import os
5
  co = cohere.Client(os.getenv('COHERE_API_KEY'))
6
 
7
  # Initialization
8
- if 'output' not in st.session_state:
9
- st.session_state['output'] = 'Output:'
10
-
11
  def generate_hashtags(input):
12
  if len(input) == 0:
13
  return None
@@ -23,7 +22,7 @@ def generate_hashtags(input):
23
  stop_sequences=["--"],
24
  return_likelihoods='NONE')
25
 
26
- st.session_state['output'] = response.generations[0].text
27
 
28
 
29
  st.title('Positive Reframing Generator')
@@ -31,4 +30,4 @@ st.write('''This is a simple **Streamlit** app that generates the input sentence
31
 
32
  input = st.text_area('Enter your post title caption here', height=100)
33
  st.button('Reframe', on_click = generate_hashtags(input))
34
- st.write(st.session_state.output)
 
5
  co = cohere.Client(os.getenv('COHERE_API_KEY'))
6
 
7
  # Initialization
8
+ if not output:
9
+ output = ""
 
10
  def generate_hashtags(input):
11
  if len(input) == 0:
12
  return None
 
22
  stop_sequences=["--"],
23
  return_likelihoods='NONE')
24
 
25
+ output = response.generations[0].text
26
 
27
 
28
  st.title('Positive Reframing Generator')
 
30
 
31
  input = st.text_area('Enter your post title caption here', height=100)
32
  st.button('Reframe', on_click = generate_hashtags(input))
33
+ st.write('{output}')