Skip to content

Commit 9035978

Browse files
authored
Merge pull request #6 from damian0815/fssrepo_mac_fixes
fix compilation errors with llvm
2 parents f47fd17 + 299f6b5 commit 9035978

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/server/server.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "build-info.h"
44
#include "grammar-parser.h"
55

6-
// #define SERVER_MULTIMODAL_SUPPORT
6+
#define SERVER_MULTIMODAL_SUPPORT
77

88
#ifdef SERVER_MULTIMODAL_SUPPORT
99
#include "../llava/clip.h"
@@ -78,7 +78,7 @@ std::vector<uint8_t> base64_decode(std::string const& encoded_string) {
7878
int i = 0;
7979
int j = 0;
8080
int in_ = 0;
81-
BYTE char_array_4[4], char_array_3[3];
81+
unsigned char char_array_4[4], char_array_3[3];
8282
std::vector<uint8_t> ret;
8383
while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
8484
char_array_4[i++] = encoded_string[in_]; in_++;
@@ -884,9 +884,10 @@ struct llama_server_context
884884

885885
// append prefix of next image
886886
batch.n_tokens = 0;
887-
std::vector<llama_token> append_tokens = tokenize(
888-
image_idx >= slot.images.size() ? slot.params.input_suffix : // no more images, then process suffix prompt
889-
slot.images[image_idx].prefix_prompt, true); // has next image
887+
const auto json_prompt = (image_idx >= slot.images.size()) ?
888+
slot.params.input_suffix : // no more images, then process suffix prompt
889+
(json)(slot.images[image_idx].prefix_prompt);
890+
std::vector<llama_token> append_tokens = tokenize(json_prompt, true); // has next image
890891
for (int i = 0; i < append_tokens.size(); ++i) {
891892
batch.token [batch.n_tokens] = append_tokens[i];
892893
batch.pos [batch.n_tokens] = slot.n_past;

0 commit comments

Comments
 (0)