Skip to content

Commit

Permalink
Renaming llm_handler target to babyllama_handler
Browse files Browse the repository at this point in the history
Signed-off-by: Shrinath Suresh <[email protected]>
  • Loading branch information
shrinath-suresh committed Sep 12, 2023
1 parent 67b46aa commit f30aab2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions cpp/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ function build() {
mv $DEPS_DIR/../src/examples/libmnist_handler.so $DEPS_DIR/../../test/resources/torchscript_model/mnist/mnist_handler/libmnist_handler.so
fi

if [ -f "$DEPS_DIR/../src/examples/libllm_handler.so" ]; then
mv $DEPS_DIR/../src/examples/libllm_handler.so $DEPS_DIR/../../test/resources/torchscript_model/babyllama/libllm_handler.so
if [ -f "$DEPS_DIR/../src/examples/libbabyllama_handler.so" ]; then
mv $DEPS_DIR/../src/examples/libbabyllama_handler.so $DEPS_DIR/../../test/resources/torchscript_model/babyllama/babyllama_handler/libbabyllama_handler.so
fi

cd $DEPS_DIR/../..
Expand Down
15 changes: 8 additions & 7 deletions cpp/src/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ add_library(mnist_handler SHARED ${MNIST_SOURCE_FILES})
target_include_directories(mnist_handler PUBLIC ${MNIST_SRC_DIR})
target_link_libraries(mnist_handler PRIVATE ts_backends_torch_scripted ts_utils ${TORCH_LIBRARIES})

set(LLM_SRC_DIR "${torchserve_cpp_SOURCE_DIR}/src/examples/babyllama")
set(LLM_SOURCE_FILES "")
list(APPEND LLM_SOURCE_FILES ${LLM_SRC_DIR}/baby_llama_handler.cc)
add_library(llm_handler SHARED ${LLM_SOURCE_FILES})
target_include_directories(llm_handler PUBLIC ${LLM_SRC_DIR})
target_link_libraries(llm_handler PRIVATE ts_backends_torch_scripted ts_utils ${TORCH_LIBRARIES})
target_compile_options(llm_handler PRIVATE -Wall -Wextra -Ofast)

set(BABYLLAMA_SRC_DIR "${torchserve_cpp_SOURCE_DIR}/src/examples/babyllama")
set(BABYLLAMA_SOURCE_FILES "")
list(APPEND BABYLLAMA_SOURCE_FILES ${BABYLLAMA_SRC_DIR}/baby_llama_handler.cc)
add_library(babyllama_handler SHARED ${BABYLLAMA_SOURCE_FILES})
target_include_directories(babyllama_handler PUBLIC ${BABYLLAMA_SRC_DIR})
target_link_libraries(babyllama_handler PRIVATE ts_backends_torch_scripted ts_utils ${TORCH_LIBRARIES})
target_compile_options(babyllama_handler PRIVATE -Wall -Wextra -Ofast)
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ TEST_F(TorchScriptedBackendTest, TestLoadPredictMnistHandler) {
TEST_F(TorchScriptedBackendTest, TestLoadPredictLlmHandler) {
this->LoadPredict(
std::make_shared<torchserve::LoadModelRequest>(
"test/resources/torchscript_model/babyllama/llm_handler", "llm", -1,
"", "", 1, false),
"test/resources/torchscript_model/babyllama/llm_handler",
"test/resources/torchscript_model/babyllama/babyllama_handler", "llm",
-1, "", "", 1, false),
"test/resources/torchscript_model/babyllama/babyllama_handler",
"test/resources/torchscript_model/babyllama/prompt.txt", "llm_ts",
200);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"model": {
"modelName": "llm",
"serializedFile": "dummy.pt",
"handler": "libllm_handler:LlmHandler",
"handler": "libbabyllama_handler:BabyLlamaHandler",
"modelVersion": "2.0"
},
"archiverVersion": "0.2.0"
Expand Down

0 comments on commit f30aab2

Please sign in to comment.