dlflannery commited on
Commit
0fb4a4f
·
verified ·
1 Parent(s): 3a2eaed

Update app.py

Browse files

Fixed: prompt not carried thru to analyze image

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -207,7 +207,7 @@ def chat(prompt, user_window, pwd_window, past, response, gptModel, uploaded_ima
207
  messages=past)
208
  reporting_model = gptModel
209
  else:
210
- (completion, msg) = analyze_image(user_window, image_gen_model)
211
  uploaded_image_file= ''
212
  reporting_model = image_gen_model
213
  if not msg == 'ok':
@@ -431,7 +431,7 @@ def load_image(image, user):
431
  status = 'Unable to upload image'
432
  return [fpath, status]
433
 
434
- def analyze_image(user, model):
435
  status = 'ok'
436
  try:
437
  with open(dataDir + user + '_image.b64', 'rt') as fp:
@@ -447,7 +447,7 @@ def analyze_image(user, model):
447
  "content": [
448
  {
449
  "type": "text",
450
- "text": "What's in this image?"
451
  },
452
  {
453
  "type": "image_url",
 
207
  messages=past)
208
  reporting_model = gptModel
209
  else:
210
+ (completion, msg) = analyze_image(user_window, image_gen_model, prompt)
211
  uploaded_image_file= ''
212
  reporting_model = image_gen_model
213
  if not msg == 'ok':
 
431
  status = 'Unable to upload image'
432
  return [fpath, status]
433
 
434
+ def analyze_image(user, model, prompt):
435
  status = 'ok'
436
  try:
437
  with open(dataDir + user + '_image.b64', 'rt') as fp:
 
447
  "content": [
448
  {
449
  "type": "text",
450
+ "text": prompt
451
  },
452
  {
453
  "type": "image_url",