From 8c191ee794bff10278f312dec62c359fa5ab4b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Gonz=C3=A1lez=20Santamarta?= Date: Thu, 9 Jan 2025 19:28:43 +0100 Subject: [PATCH] moving get_metada service - embedding and rerank models will not have get_metada service --- llama_ros/src/llama_ros/llama_node.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/llama_ros/src/llama_ros/llama_node.cpp b/llama_ros/src/llama_ros/llama_node.cpp index 4cfbbc2..a0a5137 100644 --- a/llama_ros/src/llama_ros/llama_node.cpp +++ b/llama_ros/src/llama_ros/llama_node.cpp @@ -81,12 +81,6 @@ LlamaNode::on_activate(const rclcpp_lifecycle::State &) { // create llama this->create_llama(); - // get metadata service - this->get_metadata_service_ = - this->create_service( - "get_metadata", - std::bind(&LlamaNode::get_metadata_service_callback, this, _1, _2)); - // embeddings service if (this->llama->is_embedding() && !this->llama->is_reranking()) { this->generate_embeddings_service_ = @@ -107,6 +101,12 @@ LlamaNode::on_activate(const rclcpp_lifecycle::State &) { // completion services and action if (!this->llama->is_embedding() && !this->llama->is_reranking()) { + // get metadata service + this->get_metadata_service_ = + this->create_service( + "get_metadata", + std::bind(&LlamaNode::get_metadata_service_callback, this, _1, _2)); + this->tokenize_service_ = this->create_service( "tokenize", std::bind(&LlamaNode::tokenize_service_callback, this, _1, _2)); @@ -152,9 +152,6 @@ LlamaNode::on_deactivate(const rclcpp_lifecycle::State &) { this->destroy_llama(); - this->get_metadata_service_.reset(); - this->get_metadata_service_ = nullptr; - if (this->llama->is_embedding() && !this->llama->is_reranking()) { this->generate_embeddings_service_.reset(); this->generate_embeddings_service_ = nullptr; @@ -166,6 +163,9 @@ LlamaNode::on_deactivate(const rclcpp_lifecycle::State &) { } if (!this->llama->is_embedding() && !this->llama->is_reranking()) { + this->get_metadata_service_.reset(); + this->get_metadata_service_ = nullptr; + this->tokenize_service_.reset(); this->tokenize_service_ = nullptr;