mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
Simplify image loading
This commit is contained in:
parent
632b0b175b
commit
8d16602e6d
1 changed files with 5 additions and 8 deletions
|
@ -3930,10 +3930,8 @@ public:
|
||||||
{
|
{
|
||||||
for (const auto &img : *images_data)
|
for (const auto &img : *images_data)
|
||||||
{
|
{
|
||||||
const std::vector<uint8_t> image_buffer = base64_decode(img["data"].get<std::string>());
|
auto decoded_data = base64_decode(img["data"].get<std::string>());
|
||||||
raw_buffer data;
|
files.push_back(decoded_data);
|
||||||
data.insert(data.end(), image_buffer.begin(), image_buffer.end());
|
|
||||||
files.push_back(data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4113,10 +4111,9 @@ public:
|
||||||
std::cout << "[DEBUG] Found " << images_data->size() << " images to process" << std::endl;
|
std::cout << "[DEBUG] Found " << images_data->size() << " images to process" << std::endl;
|
||||||
for (const auto &img : *images_data)
|
for (const auto &img : *images_data)
|
||||||
{
|
{
|
||||||
const std::vector<uint8_t> image_buffer = base64_decode(img["data"].get<std::string>());
|
std::cout << "[PREDICT] Processing image" << std::endl;
|
||||||
raw_buffer data;
|
auto decoded_data = base64_decode(img["data"].get<std::string>());
|
||||||
data.insert(data.end(), image_buffer.begin(), image_buffer.end());
|
files.push_back(decoded_data);
|
||||||
files.push_back(data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// process files
|
// process files
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue