diff --git a/src/lexocraft/llm/text_completion.cpp b/src/lexocraft/llm/text_completion.cpp index 2d58424..c178d12 100644 --- a/src/lexocraft/llm/text_completion.cpp +++ b/src/lexocraft/llm/text_completion.cpp @@ -624,24 +624,4 @@ namespace lc { return *this; } - - TextCompleter& TextCompleter::save(const std::filesystem::path& filepath) { - std::ofstream file {filepath}; - - cereal::BinaryOutputArchive oarchive {file}; - - oarchive(*this); - - return *this; - } - - TextCompleter& TextCompleter::load(const std::filesystem::path& filepath) { - std::ifstream file {filepath}; - - cereal::BinaryInputArchive iarchive {file}; - - iarchive(*this); - - return *this; - } } // namespace lc diff --git a/src/lexocraft/llm/text_completion.hpp b/src/lexocraft/llm/text_completion.hpp index 15a09f7..52755d4 100644 --- a/src/lexocraft/llm/text_completion.hpp +++ b/src/lexocraft/llm/text_completion.hpp @@ -344,9 +344,6 @@ namespace lc { TextCompleter& create_vector_subdatabases(); - TextCompleter& save(const std::filesystem::path& filepath); - TextCompleter& load(const std::filesystem::path& filepath); - TextCompleter(); TextCompleter(const TextCompleter&) = default; TextCompleter& operator=(const TextCompleter&) = default; diff --git a/src/lexocraft/llm/text_completion_interface.hpp b/src/lexocraft/llm/text_completion_interface.hpp index b83f23f..cfb4d85 100644 --- a/src/lexocraft/llm/text_completion_interface.hpp +++ b/src/lexocraft/llm/text_completion_interface.hpp @@ -1,3 +1,8 @@ +#include + +#include +#include + #include namespace lc { @@ -73,6 +78,26 @@ namespace lc { return create_vector_subdatabases(); } + TextCompleter& TextCompleter::save_file(const std::filesystem::path& filepath) { + std::ofstream file {filepath}; + + cereal::BinaryOutputArchive archive {file}; + + archive(*this); + + return *this; + } + + TextCompleter& TextCompleter::load_file(const std::filesystem::path& filepath) { + std::ifstream file {filepath}; + + cereal::BinaryInputArchive archive {file}; + + archive(*this); + + return *this; + } + // -------------------------- Ephermal Memory Accumulator -------------------------- TextCompleter& TextCompleter::set_ephemeral_memory_accumulator_layer_sizes( const BinaryLayerSizeVectorGenerator_t& binary_layer_size_vector_generator,