Blog from given image

This commit is contained in:
ajaysi
2024-07-02 16:48:36 +05:30
parent 94b938d31e
commit 7abc396633

View File

@@ -4,6 +4,7 @@ import os
from textwrap import dedent from textwrap import dedent
from PIL import Image from PIL import Image
import json import json
import asyncio
from pathlib import Path from pathlib import Path
from datetime import datetime from datetime import datetime
import streamlit as st import streamlit as st
@@ -52,7 +53,7 @@ def blog_from_image(prompt, uploaded_img):
try: try:
status.update(label="🙎 Generating - Title, Meta Description, Tags, Categories for the content.") status.update(label="🙎 Generating - Title, Meta Description, Tags, Categories for the content.")
blog_title, blog_meta_desc, blog_tags, blog_categories = blog_metadata(blog_markdown_str) blog_title, blog_meta_desc, blog_tags, blog_categories = asyncio.run(blog_metadata(blog_markdown_str))
except Exception as err: except Exception as err:
st.error(f"Failed to get blog metadata: {err}") st.error(f"Failed to get blog metadata: {err}")