forked from undreamai/LlamaLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathundreamai_server.cpp
More file actions
32 lines (29 loc) · 848 Bytes
/
undreamai_server.cpp
File metadata and controls
32 lines (29 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "undreamai.h"
int main(int argc, char ** argv) {
int i = 1;
std::string templateValue = "";
std::string command = "";
while (i < argc) {
if (std::string(argv[i]) == "--template") {
if (i + 1 < argc) {
templateValue = argv[i + 1];
i++;
} else {
std::cerr << "Error: --template option requires a value" << std::endl;
exit(1);
}
} else {
command += argv[i];
if (i < argc - 1) command += " ";
}
i++;
}
LLM* llm = LLM_Construct(command.c_str());
if (templateValue != ""){
std::cout<<"Using template "<<templateValue<<std::endl;
LLM_SetTemplate(llm, templateValue.c_str());
}
LLM_StartServer(llm);
LLM_Start(llm);
return 0;
}