update provider geekgpt && llama2 (#50)

Update provider geekgpt && llama2
This commit is contained in:
Dmitry Afanasyev
2023-11-02 20:22:56 +03:00
committed by GitHub
parent 2789b33677
commit 6262059bc7
5 changed files with 178 additions and 198 deletions

View File

@@ -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"};

View File

@@ -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