server : add comment about changing slot_state to bool

This commit is contained in:
Georgi Gerganov 2023-10-22 22:24:39 +03:00
parent 83e1490187
commit c0f4d54870
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

View File

@ -158,6 +158,7 @@ struct task_result {
json result_json;
};
// TODO: can become bool if we can't find use of more states
enum slot_state
{
IDLE,
@ -188,11 +189,14 @@ struct slot_params
struct slot_image
{
clip_image_u8 img_data;
int32_t id;
bool request_encode_image = false;
float* image_embedding = nullptr;
int image_tokens = 0;
int id;
int32_t image_tokens = 0;
clip_image_u8 img_data;
std::string prefix_prompt; // before of this image
};
@ -769,8 +773,8 @@ struct llama_server_context
{
for (const auto &img : *images_data)
{
slot_image img_sl;
std::string data_b64 = img["data"].get<std::string>();
slot_image img_sl;
img_sl.id = img.count("id") != 0 ? img["id"].get<int>() : slot->images.size();
int width, height, channels;
std::vector<uint8_t> image_buffer = base64_decode(data_b64);