Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -50,10 +50,9 @@ if uploaded_file is not None and analyze_button:
|
|
50 |
|
51 |
# Optimized prompt for additional clarity and detail
|
52 |
prompt_text = (
|
53 |
-
"As an expert in image accessibility and alternative text,
|
54 |
-
"
|
55 |
-
"Your description should form a clear, well-structured, and factual paragraph
|
56 |
-
"Avoid bullet points, focusing on creating a seamless narrative that serves as effective alternative text for accessibility purposes."
|
57 |
)
|
58 |
|
59 |
if show_details and additional_details:
|
@@ -88,7 +87,7 @@ if uploaded_file is not None and analyze_button:
|
|
88 |
message_placeholder = st.empty()
|
89 |
for completion in openai.chat.completions.create(
|
90 |
model="gpt-4-vision-preview", messages=messages,
|
91 |
-
max_tokens=
|
92 |
):
|
93 |
# # Check if there is content to display
|
94 |
# if completion.choices[0].delta.content is not None:
|
|
|
50 |
|
51 |
# Optimized prompt for additional clarity and detail
|
52 |
prompt_text = (
|
53 |
+
"As an expert in image accessibility and alternative text, succinctly describe the image provided in less than 150 characters. "
|
54 |
+
"Focus on capturing the essence and key elements of the image in a single, clear, and concise sentence for use as alt text."
|
55 |
+
"Your description should form a clear, well-structured, and factual paragraph that avoids bullet points, focusing on creating a seamless narrative that serves as effective alternative text for accessibility purposes."
|
|
|
56 |
)
|
57 |
|
58 |
if show_details and additional_details:
|
|
|
87 |
message_placeholder = st.empty()
|
88 |
for completion in openai.chat.completions.create(
|
89 |
model="gpt-4-vision-preview", messages=messages,
|
90 |
+
max_tokens=250, stream=True
|
91 |
):
|
92 |
# # Check if there is content to display
|
93 |
# if completion.choices[0].delta.content is not None:
|