Skip to content

Commit fc6a935

Browse files
authored
enable server
1 parent 66874d4 commit fc6a935

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

.devops/full.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ WORKDIR /app
1414

1515
COPY . .
1616

17-
RUN make
17+
RUN make && make server
1818

1919
ENTRYPOINT ["/app/.devops/tools.sh"]

.devops/tools.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ elif [[ $arg1 == '--quantize' || $arg1 == '-q' ]]; then
1616
./quantize $arg2
1717
elif [[ $arg1 == '--run' || $arg1 == '-r' ]]; then
1818
./main $arg2
19+
elif [[ $arg1 == '--serve' || $arg1 == '-s' ]]; then
20+
./server $arg2
1921
elif [[ $arg1 == '--all-in-one' || $arg1 == '-a' ]]; then
2022
echo "Converting PTH to GGML..."
2123
for i in `ls $1/$2/ggml-model-f16.bin*`; do
@@ -35,6 +37,8 @@ else
3537
echo " ex: \"/models/7B/\" 1"
3638
echo " --quantize (-q): Optimize with quantization process ggml"
3739
echo " ex: \"/models/7B/ggml-model-f16.bin\" \"/models/7B/ggml-model-q4_0.bin\" 2"
40+
echo " --serve (-s): Run the server"
41+
echo " ex: -m /models/7B/ggml-model-q4_0.bin -host 0.0.0.0 -port 8080"
3842
echo " --all-in-one (-a): Execute --convert & --quantize"
3943
echo " ex: \"/models/\" 7B"
4044
fi

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ jobs:
211211
run: |
212212
mkdir build
213213
cd build
214-
cmake .. ${{ matrix.defines }}
214+
cmake .. ${{ matrix.defines }} -DLLAMA_BUILD_SERVER=ON
215215
cmake --build . --config Release
216216
cp ../LICENSE ./bin/Release/llama.cpp.txt
217217
@@ -292,7 +292,7 @@ jobs:
292292
run: |
293293
mkdir build
294294
cd build
295-
cmake .. -DLLAMA_CUBLAS=ON
295+
cmake .. -DLLAMA_CUBLAS=ON -DLLAMA_BUILD_SERVER=ON
296296
cmake --build . --config Release
297297
298298
- name: Get commit hash

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ embedding: examples/embedding/embedding.cpp build-info.h ggml.o llama.o common.o
237237
save-load-state: examples/save-load-state/save-load-state.cpp build-info.h ggml.o llama.o common.o $(OBJS)
238238
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
239239

240+
server: examples/server/server.cpp build-info.h ggml.o llama.o common.o $(OBJS)
241+
$(CXX) $(CXXFLAGS) $(filter-out %.h,$^) -o $@ $(LDFLAGS)
242+
240243
build-info.h: $(wildcard .git/index) scripts/build-info.sh
241244
@sh scripts/build-info.sh > $@.tmp
242245
@if ! cmp -s $@.tmp $@; then \

0 commit comments

Comments
 (0)