Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,7 +58,7 @@ Create a short story that expands on this image caption and brings it to life.
|
|
| 58 |
# Generate story with parameters tuned for brevity and coherence
|
| 59 |
response = story_generator(
|
| 60 |
prompt,
|
| 61 |
-
max_new_tokens=
|
| 62 |
do_sample=True,
|
| 63 |
temperature=0.7, # Balanced creativity
|
| 64 |
top_p=0.9, # Focus on more likely tokens
|
|
@@ -104,7 +104,7 @@ uploaded_file = st.file_uploader("Upload an image")
|
|
| 104 |
if uploaded_file is not None:
|
| 105 |
# Display image
|
| 106 |
image = Image.open(uploaded_file)
|
| 107 |
-
st.image(image, caption="Uploaded Image",
|
| 108 |
|
| 109 |
# Process image
|
| 110 |
with st.spinner("Processing..."):
|
|
|
|
| 58 |
# Generate story with parameters tuned for brevity and coherence
|
| 59 |
response = story_generator(
|
| 60 |
prompt,
|
| 61 |
+
max_new_tokens=120, # Allow enough tokens for a complete story
|
| 62 |
do_sample=True,
|
| 63 |
temperature=0.7, # Balanced creativity
|
| 64 |
top_p=0.9, # Focus on more likely tokens
|
|
|
|
| 104 |
if uploaded_file is not None:
|
| 105 |
# Display image
|
| 106 |
image = Image.open(uploaded_file)
|
| 107 |
+
st.image(image, caption="Uploaded Image", use_container_width=True)
|
| 108 |
|
| 109 |
# Process image
|
| 110 |
with st.spinner("Processing..."):
|