awacke1 commited on
Commit
fd44629
·
verified ·
1 Parent(s): 9c24d62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -38,11 +38,18 @@ def process_image(image_input):
38
  base64_image = base64.b64encode(image_input.read()).decode("utf-8")
39
  response = client.chat.completions.create(
40
  model=MODEL,
41
- prompt=f"You are a helpful assistant that responds in Markdown. Help me with my math homework! What's the area of the triangle? [image: data:image/png;base64,{base64_image}]",
42
- max_tokens=100,
43
- temperature=0.5,
 
 
 
 
 
 
 
44
  )
45
- st.markdown(response.choices[0].text.strip())
46
 
47
  def process_audio(audio_input):
48
  if audio_input:
 
38
  base64_image = base64.b64encode(image_input.read()).decode("utf-8")
39
  response = client.chat.completions.create(
40
  model=MODEL,
41
+ messages=[
42
+ {"role": "system", "content": "You are a helpful assistant that responds in Markdown."},
43
+ {"role": "user", "content": [
44
+ {"type": "text", "text": "Help me understand what is in this picture and list ten facts as markdown outline with appropriate emojis that describes what you see."},
45
+ {"type": "image_url", "image_url": {
46
+ "url": f"data:image/png;base64,{base64_image}"}
47
+ }
48
+ ]}
49
+ ],
50
+ temperature=0.0,
51
  )
52
+ st.markdown(response.message.content)
53
 
54
  def process_audio(audio_input):
55
  if audio_input: