Spaces:
Sleeping
Sleeping
Update pages/Custom.py
Browse files- pages/Custom.py +7 -4
pages/Custom.py
CHANGED
|
@@ -47,10 +47,13 @@ graph = builder.compile()
|
|
| 47 |
st.title("Generate Custom Title Blog")
|
| 48 |
input_data = st.text_input("Enter a Title for your blog:")
|
| 49 |
|
| 50 |
-
|
| 51 |
-
if st.button("Generate Blog"):
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
|
| 56 |
|
|
|
|
| 47 |
st.title("Generate Custom Title Blog")
|
| 48 |
input_data = st.text_input("Enter a Title for your blog:")
|
| 49 |
|
| 50 |
+
if input_data: # Ensure input_data is not empty
|
| 51 |
+
if st.button("Generate Blog"):
|
| 52 |
+
try:
|
| 53 |
+
content = graph.invoke({"final_topic": input_data})
|
| 54 |
+
st.markdown(content.get('image_formated_blog', "No content generated.")) # Avoid KeyError
|
| 55 |
+
except Exception as e:
|
| 56 |
+
st.error(str(e))
|
| 57 |
|
| 58 |
|
| 59 |
|