Spaces:
Runtime error
Runtime error
Commit
·
07933be
1
Parent(s):
91afb34
Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,8 @@ import os
|
|
5 |
co = cohere.Client(os.getenv('COHERE_API_KEY'))
|
6 |
|
7 |
# Initialization
|
8 |
-
if
|
9 |
-
|
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 |
-
|
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(
|
|
|
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}')
|