Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from gtts import gTTS
|
|
5 |
|
6 |
st.set_page_config(page_title="Image to Audio Story", page_icon="🦜")
|
7 |
caption_pipeline = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
8 |
-
story_pipeline = pipeline("text-generation", model="Qwen/Qwen2-
|
9 |
|
10 |
|
11 |
def extract_image_caption(image_data):
|
@@ -19,7 +19,7 @@ def compose_story_from_caption(caption_detail):
|
|
19 |
"You are a talented and imaginative storyteller for children aged 3 to 10. "
|
20 |
"Using the details derived from the image below, craft a captivating tale that goes beyond merely describing the scene. "
|
21 |
"Let your creativity shine by introducing engaging characters, adventurous journeys, and delightful surprises. "
|
22 |
-
"Your story should be vivid, original, and
|
23 |
f"Image Details: {caption_detail}\n\nStory:"
|
24 |
)
|
25 |
story_results = story_pipeline(prompt_text, num_return_sequences=1)
|
|
|
5 |
|
6 |
st.set_page_config(page_title="Image to Audio Story", page_icon="🦜")
|
7 |
caption_pipeline = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
8 |
+
story_pipeline = pipeline("text-generation", model="Qwen/Qwen2.5-0.5B-Instruct")
|
9 |
|
10 |
|
11 |
def extract_image_caption(image_data):
|
|
|
19 |
"You are a talented and imaginative storyteller for children aged 3 to 10. "
|
20 |
"Using the details derived from the image below, craft a captivating tale that goes beyond merely describing the scene. "
|
21 |
"Let your creativity shine by introducing engaging characters, adventurous journeys, and delightful surprises. "
|
22 |
+
"Your story should be vivid, original, and less than 100 words in length.\n\n"
|
23 |
f"Image Details: {caption_detail}\n\nStory:"
|
24 |
)
|
25 |
story_results = story_pipeline(prompt_text, num_return_sequences=1)
|