File size: 428 Bytes
ad17f03
 
 
 
 
 
 
 
 
 
 
 
 
84683a4
ad17f03
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from pkgs import QuotaManager, executor
import os
import base64
from PIL import Image
import io


def answer(input_img):
    buffer = io.BytesIO()
    input_img.save(buffer, format="PNG")
    image_data = base64.b64encode(buffer.getvalue()).decode('utf-8')
    # print(os.getenv('PROMPT'))

    respose = executor.execute_with_image(user_input= '', model_input= os.environ['PROMPT'], base64_image=image_data)

    return respose