ENCOA-274 and patch to the Dockerfile, in some merge the firebase tools were left out

This commit is contained in:
Carlos-Mesquita
2024-12-11 15:23:00 +00:00
parent 0222c339fe
commit 196f9e9c3e
9 changed files with 36 additions and 23 deletions

View File

@@ -57,14 +57,17 @@ class GradeWriting:
name = attachment.split('/')[-1]
out_path = f'./tmp/{uuid}/{name}'
path = await self._file_storage.download_firebase_file(attachment, out_path)
messages.append({
"type": "image_url",
"image_url": {
"url": f"data:image/{name.split('.')[-1]};base64,{FileHelper.encode_image(path)}"
messages.append(
{
"role": "user",
"content": {
"type": "image_url",
"image_url": {
"url": f"data:image/{name.split('.')[-1]};base64,{FileHelper.encode_image(path)}"
}
}
})
llm_model = GPTModels.GPT_3_5_TURBO if task == 1 else GPTModels.GPT_4_O
temperature = (
TemperatureSettings.GRADING_TEMPERATURE
if task == 1 else
@@ -72,7 +75,7 @@ class GradeWriting:
)
evaluation_promise = self._llm.prediction(
llm_model,
GPTModels.GPT_4_O,
messages,
["comment"],
temperature