Spaces:
Running
Running
mrbeliever
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -78,12 +78,14 @@ if uploaded_image and API_KEY:
|
|
78 |
.get("content", "No caption generated.")
|
79 |
)
|
80 |
st.subheader("Generated Caption")
|
81 |
-
|
|
|
|
|
82 |
|
83 |
# Add a copy button to copy the caption to clipboard
|
84 |
copy_button = st.button("Copy Caption", use_container_width=True)
|
85 |
if copy_button:
|
86 |
-
pyperclip.copy(
|
87 |
st.success("Caption copied to clipboard!")
|
88 |
|
89 |
except Exception as e:
|
|
|
78 |
.get("content", "No caption generated.")
|
79 |
)
|
80 |
st.subheader("Generated Caption")
|
81 |
+
|
82 |
+
# Use a text area for the caption so it can be copied easily
|
83 |
+
caption_area = st.text_area("", caption, height=100, key="caption_area", disabled=True)
|
84 |
|
85 |
# Add a copy button to copy the caption to clipboard
|
86 |
copy_button = st.button("Copy Caption", use_container_width=True)
|
87 |
if copy_button:
|
88 |
+
pyperclip.copy(caption_area) # Copy caption to clipboard
|
89 |
st.success("Caption copied to clipboard!")
|
90 |
|
91 |
except Exception as e:
|