ENCOA-274 and patch to the Dockerfile, in some merge the firebase tools were left out
This commit is contained in:
@@ -25,6 +25,9 @@ async def get_writing_args_academic(task: int, attachment: UploadFile) -> List[D
|
||||
if task == 2:
|
||||
raise NotImplemented("Task 2 academic isn't implemented yet, current implementation still uses General Task 2 prompts.")
|
||||
|
||||
attachment_bytes = await attachment.read()
|
||||
|
||||
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
@@ -32,17 +35,19 @@ async def get_writing_args_academic(task: int, attachment: UploadFile) -> List[D
|
||||
},
|
||||
{
|
||||
"role": "user",
|
||||
"content": writing_args[str(task)]["instructions"]
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": writing_args[str(task)]["instructions"],
|
||||
},
|
||||
{
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": f"data:image/{attachment.filename.split('.')[-1]};base64,{b64encode(attachment_bytes).decode('utf-8')}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
if task == 1:
|
||||
attachment_bytes = await attachment.read()
|
||||
messages.append({
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": f"data:image/{attachment.filename.split('.')[-1]};base64,{b64encode(attachment_bytes).decode('utf-8')}"
|
||||
}
|
||||
})
|
||||
|
||||
return messages
|
||||
|
||||
Reference in New Issue
Block a user