Skip to content

Commit

Permalink
moving get_metada service
Browse files Browse the repository at this point in the history
  - embedding and rerank models will not have get_metada service
  • Loading branch information
mgonzs13 committed Jan 9, 2025
1 parent 51fff6c commit 8c191ee
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions llama_ros/src/llama_ros/llama_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<llama_msgs::srv::GetMetadata>(
"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_ =
Expand All @@ -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<llama_msgs::srv::GetMetadata>(
"get_metadata",
std::bind(&LlamaNode::get_metadata_service_callback, this, _1, _2));

this->tokenize_service_ = this->create_service<llama_msgs::srv::Tokenize>(
"tokenize",
std::bind(&LlamaNode::tokenize_service_callback, this, _1, _2));
Expand Down Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 8c191ee

Please sign in to comment.