Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -99,8 +99,8 @@ if uploaded_image:
|
|
99 |
base64_string = convert_to_base64(compressed_image_data)
|
100 |
|
101 |
# Call the Nebius API to generate a caption
|
102 |
-
if st.button("Generate
|
103 |
-
st.write("Generating
|
104 |
result = generate_caption(base64_string, API_KEY)
|
105 |
|
106 |
# Display the generated caption
|
@@ -113,8 +113,8 @@ if uploaded_image:
|
|
113 |
.get("message", {})
|
114 |
.get("content", "No caption generated.")
|
115 |
)
|
116 |
-
st.subheader("Generated
|
117 |
-
st.text_area("Generated Caption Output", caption, height=100, key="caption_output"
|
118 |
except Exception as e:
|
119 |
st.error(f"Error processing the response: {e}")
|
120 |
else:
|
@@ -127,6 +127,18 @@ else:
|
|
127 |
st.markdown(
|
128 |
"""
|
129 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
textarea {
|
131 |
color: white !important;
|
132 |
background-color: #262626 !important;
|
|
|
99 |
base64_string = convert_to_base64(compressed_image_data)
|
100 |
|
101 |
# Call the Nebius API to generate a caption
|
102 |
+
if st.button("Generate Prompt"):
|
103 |
+
st.write("Generating Prompt...")
|
104 |
result = generate_caption(base64_string, API_KEY)
|
105 |
|
106 |
# Display the generated caption
|
|
|
113 |
.get("message", {})
|
114 |
.get("content", "No caption generated.")
|
115 |
)
|
116 |
+
st.subheader("Prompt Generated")
|
117 |
+
st.text_area("Generated Caption Output", caption, height=100, key="caption_output")
|
118 |
except Exception as e:
|
119 |
st.error(f"Error processing the response: {e}")
|
120 |
else:
|
|
|
127 |
st.markdown(
|
128 |
"""
|
129 |
<style>
|
130 |
+
|
131 |
+
.css-1d391kg {text-align: center;}
|
132 |
+
.css-1v3fvcr {justify-content: center; display: flex;}
|
133 |
+
.css-1y4ccs5 {margin: 0 auto;}
|
134 |
+
.css-1aumxhk {display: flex; justify-content: center;}
|
135 |
+
.css-1k6kn8p {justify-content: center; align-items: center; display: flex;}
|
136 |
+
.css-ffhzg6 {text-align: center;}
|
137 |
+
textarea {
|
138 |
+
color: white !important;
|
139 |
+
background-color: #262626 !important;
|
140 |
+
}
|
141 |
+
|
142 |
textarea {
|
143 |
color: white !important;
|
144 |
background-color: #262626 !important;
|