@@ -89,43 +89,6 @@ absl::Status OpenAIChatCompletionsHandler::parseCompletionsPart() {
89
89
return absl::OkStatus ();
90
90
}
91
91
92
- // ov::Tensor load_image_stbi(const std::string& imageBytes) {
93
- // int x = 0, y = 0, channelsInFile = 0;
94
- // constexpr int desiredChannels = 3;
95
- // unsigned char* image = stbi_load_from_memory(
96
- // (const unsigned char*)imageBytes.data(), imageBytes.size(),
97
- // &x, &y, &channelsInFile, desiredChannels);
98
- // if (!image) {
99
- // std::stringstream errorMessage;
100
- // errorMessage << "Failed to load the image";
101
- // throw std::runtime_error{errorMessage.str()};
102
- // }
103
- // struct SharedImageAllocator {
104
- // unsigned char* image;
105
- // int channels, height, width;
106
- // void* allocate(size_t bytes, size_t) const {
107
- // if (image && channels * height * width == bytes) {
108
- // return image;
109
- // }
110
- // throw std::runtime_error{"Unexpected number of bytes was requested to allocate."};
111
- // }
112
- // void deallocate(void*, size_t bytes, size_t) {
113
- // if (channels * height * width != bytes) {
114
- // throw std::runtime_error{"Unexpected number of bytes was requested to deallocate."};
115
- // }
116
- // if (image != nullptr) {
117
- // stbi_image_free(image);
118
- // image = nullptr;
119
- // }
120
- // }
121
- // bool is_equal(const SharedImageAllocator& other) const noexcept { return this == &other; }
122
- // };
123
- // return ov::Tensor(
124
- // ov::element::u8,
125
- // ov::Shape{1, size_t(y), size_t(x), size_t(desiredChannels)},
126
- // SharedImageAllocator{image, desiredChannels, y, x});
127
- // }
128
-
129
92
absl::Status OpenAIChatCompletionsHandler::parseMessages () {
130
93
auto it = doc.FindMember (" messages" );
131
94
if (it == doc.MemberEnd ())
0 commit comments