llama_ros: llama.cpp for ROS 2
Loading...
Searching...
No Matches
llama_params.hpp
Go to the documentation of this file.
1// MIT License
2//
3// Copyright (c) 2024 Miguel Ángel González Santamarta
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23#ifndef LLAMA_UTILS__LLAMA_PARAMS_HPP
24#define LLAMA_UTILS__LLAMA_PARAMS_HPP
25
26#include <memory>
27#include <rclcpp/rclcpp.hpp>
28#include <rclcpp_lifecycle/lifecycle_node.hpp>
29
30#include "common.h"
31#include "llama.h"
32
33#include "llama_msgs/msg/sampling_config.hpp"
34#include "llama_utils/logs.hpp"
35#include "llava_ros/llava.hpp"
36
37namespace llama_utils {
38
40 std::string system_prompt;
41 struct common_params params;
43};
44
46 const rclcpp_lifecycle::LifecycleNode::SharedPtr &node);
47
48struct LlamaParams
49get_llama_params(const rclcpp_lifecycle::LifecycleNode::SharedPtr &node);
50
51enum ggml_sched_priority parse_priority(std::string priority);
52
53struct common_params_sampling
54parse_sampling_params(const llama_msgs::msg::SamplingConfig &sampling_config,
55 int n_vocab);
56
57} // namespace llama_utils
58
59#endif
Definition llama_params.hpp:37
enum ggml_sched_priority parse_priority(std::string priority)
Definition llama_params.cpp:437
void declare_llama_params(const rclcpp_lifecycle::LifecycleNode::SharedPtr &node)
Definition llama_params.cpp:58
struct common_params_sampling parse_sampling_params(const llama_msgs::msg::SamplingConfig &sampling_config, int n_vocab)
Definition llama_params.cpp:451
struct LlamaParams get_llama_params(const rclcpp_lifecycle::LifecycleNode::SharedPtr &node)
Definition llama_params.cpp:138
Definition llama_params.hpp:39
std::string system_prompt
Definition llama_params.hpp:40
struct llava_ros::LlavaParams llava_params
Definition llama_params.hpp:42
struct common_params params
Definition llama_params.hpp:41
Definition llava.hpp:40