ShynBui commited on
Commit
d3f8c04
·
verified ·
1 Parent(s): ddd33bf

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +7 -3
utils.py CHANGED
@@ -5,12 +5,16 @@ from PIL import Image
5
  import io
6
 
7
 
8
- def answer(input_img):
9
  buffer = io.BytesIO()
10
  input_img.save(buffer, format="PNG")
11
  image_data = base64.b64encode(buffer.getvalue()).decode('utf-8')
12
- # print(os.getenv('PROMPT'))
13
 
14
- respose = executor.execute_with_image(user_input= '', model_input= os.environ['PROMPT'], base64_image=image_data)
 
 
 
 
 
15
 
16
  return respose
 
5
  import io
6
 
7
 
8
+ def answer(input_img, selected):
9
  buffer = io.BytesIO()
10
  input_img.save(buffer, format="PNG")
11
  image_data = base64.b64encode(buffer.getvalue()).decode('utf-8')
 
12
 
13
+ if selected == "Describe things":
14
+ model_input = os.environ['PROMPT']
15
+ else:
16
+ model_input = os.environ['PROMPT_OCR']
17
+
18
+ respose = executor.execute_with_image(user_input= '', model_input= model_input, base64_image=image_data)
19
 
20
  return respose