mirror of
https://github.com/Balshgit/gpt_chat_bot.git
synced 2025-12-16 21:20:39 +03:00
update provider geekgpt && llama2 (#50)
Update provider geekgpt && llama2
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <thread>
|
||||
|
||||
#include <yaml_cpp_struct.hpp>
|
||||
|
||||
struct Config {
|
||||
std::string client_root_path;
|
||||
std::size_t interval{300};
|
||||
std::size_t work_thread_num{8};
|
||||
std::size_t work_thread_num{std::thread::hardware_concurrency() * 2};
|
||||
std::string host{"0.0.0.0"};
|
||||
std::string port{"8858"};
|
||||
std::string chat_path{"/chat"};
|
||||
|
||||
@@ -101,3 +101,24 @@ inline std::string createUuidString() {
|
||||
static thread_local boost::uuids::random_generator gen;
|
||||
return boost::uuids::to_string(gen());
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
namespace detail {
|
||||
|
||||
template <typename C>
|
||||
struct to_helper {};
|
||||
|
||||
template <typename Container, std::ranges::range R>
|
||||
requires std::convertible_to<std::ranges::range_value_t<R>, typename Container::value_type>
|
||||
Container operator|(R&& r, to_helper<Container>) {
|
||||
return Container{r.begin(), r.end()};
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <std::ranges::range Container>
|
||||
requires(!std::ranges::view<Container>)
|
||||
inline auto to() {
|
||||
return detail::to_helper<Container>{};
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
Reference in New Issue
Block a user