Spaces:
Running
Running
mrbeliever
commited on
Commit
•
8b45070
1
Parent(s):
03e23d5
Update app.py
Browse files
app.py
CHANGED
@@ -77,13 +77,7 @@ if uploaded_image and API_KEY:
|
|
77 |
.get("content", "No caption generated.")
|
78 |
)
|
79 |
st.subheader("Generated Caption")
|
80 |
-
|
81 |
-
# Use a text area for the caption so it can be copied easily
|
82 |
-
caption_area = st.text_area(
|
83 |
-
"", caption, height=100, key="caption_area", disabled=True,
|
84 |
-
max_chars=2000, # Limit number of characters for better display
|
85 |
-
help="The generated caption will appear here.", label_visibility="collapsed"
|
86 |
-
)
|
87 |
|
88 |
except Exception as e:
|
89 |
st.error(f"Error processing the response: {e}")
|
@@ -93,58 +87,16 @@ else:
|
|
93 |
else:
|
94 |
st.info("Please upload an image.")
|
95 |
|
96 |
-
#
|
97 |
st.markdown(
|
98 |
"""
|
99 |
<style>
|
100 |
-
|
101 |
-
.css-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
}
|
107 |
-
|
108 |
-
/* Glowing blue button styling */
|
109 |
-
.stButton>button {
|
110 |
-
background-color: #007bff; /* Blue color */
|
111 |
-
color: white;
|
112 |
-
font-size: 16px;
|
113 |
-
border: none;
|
114 |
-
border-radius: 4px;
|
115 |
-
padding: 12px 24px;
|
116 |
-
cursor: pointer;
|
117 |
-
box-shadow: 0 4px 6px rgba(0, 123, 255, 0.6), 0 0 10px rgba(0, 123, 255, 0.8);
|
118 |
-
transition: all 0.3s ease-in-out;
|
119 |
-
}
|
120 |
-
|
121 |
-
.stButton>button:hover {
|
122 |
-
background-color: #0056b3; /* Darker blue on hover */
|
123 |
-
box-shadow: 0 4px 6px rgba(0, 123, 255, 0.8), 0 0 20px rgba(0, 123, 255, 1);
|
124 |
-
}
|
125 |
-
|
126 |
-
/* Text area styling */
|
127 |
-
.stTextArea>div>textarea {
|
128 |
-
background-color: #f5f5f5;
|
129 |
-
color: #333;
|
130 |
-
font-size: 14px;
|
131 |
-
padding: 10px;
|
132 |
-
border-radius: 5px;
|
133 |
-
}
|
134 |
-
|
135 |
-
.stTextArea>div>textarea:disabled {
|
136 |
-
background-color: #e0e0e0;
|
137 |
-
color: #666;
|
138 |
-
}
|
139 |
-
|
140 |
-
/* Centering elements */
|
141 |
-
.css-1v3fvcr {
|
142 |
-
justify-content: center;
|
143 |
-
display: flex;
|
144 |
-
}
|
145 |
-
.css-ffhzg6 {
|
146 |
-
text-align: center;
|
147 |
-
}
|
148 |
</style>
|
149 |
""", unsafe_allow_html=True
|
150 |
)
|
|
|
77 |
.get("content", "No caption generated.")
|
78 |
)
|
79 |
st.subheader("Generated Caption")
|
80 |
+
st.write(caption)
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
|
82 |
except Exception as e:
|
83 |
st.error(f"Error processing the response: {e}")
|
|
|
87 |
else:
|
88 |
st.info("Please upload an image.")
|
89 |
|
90 |
+
# Remove the sidebar and center the content
|
91 |
st.markdown(
|
92 |
"""
|
93 |
<style>
|
94 |
+
.css-1d391kg {text-align: center;}
|
95 |
+
.css-1v3fvcr {justify-content: center; display: flex;}
|
96 |
+
.css-1y4ccs5 {margin: 0 auto;}
|
97 |
+
.css-1aumxhk {display: flex; justify-content: center;}
|
98 |
+
.css-1k6kn8p {justify-content: center; align-items: center; display: flex;}
|
99 |
+
.css-ffhzg6 {text-align: center;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
</style>
|
101 |
""", unsafe_allow_html=True
|
102 |
)
|