Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -71,7 +71,7 @@ st.set_page_config(layout="wide")
|
|
71 |
def main():
|
72 |
st.title("GeniusWords: Unleash Your Imagination")
|
73 |
|
74 |
-
example_prompt_template = 'You are a digital marketing and SEO expert and your task is to write an article on the given topic: {user_input}.
|
75 |
prompt_template = st.text_area("Please enter the prompt template:", value=example_prompt_template)
|
76 |
max_tokens = st.number_input("Please enter the maximum tokens:", min_value=1, value=800)
|
77 |
temperature = st.slider("Select the temperature:", min_value=0.1, max_value=1.0, value=0.7, step=0.1)
|
@@ -89,7 +89,7 @@ def main():
|
|
89 |
llm_call = load_llm(max_tokens=max_tokens, prompt_template=prompt_template, temperature=temperature)
|
90 |
result = llm_call(user_input)
|
91 |
if len(result) > 0:
|
92 |
-
st.info("Your
|
93 |
st.write(result)
|
94 |
else:
|
95 |
st.error("Your article couldn't be generated!")
|
@@ -100,7 +100,7 @@ def main():
|
|
100 |
st.image(image_url)
|
101 |
|
102 |
with col3:
|
103 |
-
st.subheader("Final
|
104 |
image_response = requests.get(image_url)
|
105 |
img = Image.open(io.BytesIO(image_response.content))
|
106 |
doc = create_word_docx(user_input, result['text'], img)
|
|
|
71 |
def main():
|
72 |
st.title("GeniusWords: Unleash Your Imagination")
|
73 |
|
74 |
+
example_prompt_template = 'You are a digital marketing and SEO expert and your task is to write an article on the given topic: {user_input}.'
|
75 |
prompt_template = st.text_area("Please enter the prompt template:", value=example_prompt_template)
|
76 |
max_tokens = st.number_input("Please enter the maximum tokens:", min_value=1, value=800)
|
77 |
temperature = st.slider("Select the temperature:", min_value=0.1, max_value=1.0, value=0.7, step=0.1)
|
|
|
89 |
llm_call = load_llm(max_tokens=max_tokens, prompt_template=prompt_template, temperature=temperature)
|
90 |
result = llm_call(user_input)
|
91 |
if len(result) > 0:
|
92 |
+
st.info("Your Content has been generated successfully!")
|
93 |
st.write(result)
|
94 |
else:
|
95 |
st.error("Your article couldn't be generated!")
|
|
|
100 |
st.image(image_url)
|
101 |
|
102 |
with col3:
|
103 |
+
st.subheader("Final Content to Download")
|
104 |
image_response = requests.get(image_url)
|
105 |
img = Image.open(io.BytesIO(image_response.content))
|
106 |
doc = create_word_docx(user_input, result['text'], img)
|