ProfessorLeVesseur commited on
Commit
b62550e
·
verified ·
1 Parent(s): b725814

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -33,13 +33,11 @@ if uploaded_file and openai.api_key and analyze_button:
33
  with st.spinner("Analyzing the image..."):
34
  base64_image = encode_image(uploaded_file)
35
  prompt_text = (
36
- "You are a highly knowledgeable scientific image analysis expert. "
37
  "Your task is to examine the following image in detail. "
38
- "Provide a comprehensive, factual, and scientifically accurate explanation of what the image depicts. "
39
- "Highlight key elements and their significance, and present your analysis in clear, well-structured markdown format. "
40
- "If applicable, include any relevant scientific terminology to enhance the explanation. "
41
- "Assume the reader has a basic understanding of scientific concepts."
42
- "Create a detailed image caption in bold explaining in short."
43
  )
44
 
45
  if show_details and additional_details:
@@ -53,7 +51,7 @@ if uploaded_file and openai.api_key and analyze_button:
53
 
54
  try:
55
  # Make the request to OpenAI and handle streaming if required
56
- response = openai.chat.completions.create(model="gpt-4-vision-preview", messages=messages, max_tokens=1200)
57
  st.write(response.choices[0].message.content)
58
  except Exception as e:
59
  st.error(f"An error occurred: {e}")
 
33
  with st.spinner("Analyzing the image..."):
34
  base64_image = encode_image(uploaded_file)
35
  prompt_text = (
36
+ "You are a highly knowledgeable accessibility expert. "
37
  "Your task is to examine the following image in detail. "
38
+ "Provide a comprehensive, factual, and accurate explanation of what the image depicts. "
39
+ "Highlight key elements and their significance, and present your analysis in clear, well-structured format. "
40
+ "Create a detailed image caption in explaining in 150 words or less."
 
 
41
  )
42
 
43
  if show_details and additional_details:
 
51
 
52
  try:
53
  # Make the request to OpenAI and handle streaming if required
54
+ response = openai.chat.completions.create(model="gpt-4-vision-preview", messages=messages, max_tokens=150)
55
  st.write(response.choices[0].message.content)
56
  except Exception as e:
57
  st.error(f"An error occurred: {e}")