Skip to content

Commit

Permalink
Added context memory section starter
Browse files Browse the repository at this point in the history
  • Loading branch information
FuexFollets committed Feb 8, 2024
1 parent a363df3 commit 4d49c6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lexocraft/llm/text_completion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ namespace lc {
const BinaryLayerSizeVectorGenerator_t& binary_layer_size_vector_generator,
std::size_t layer_count);

TextCompleter& start_new_section(float sentence_length_mean, float sentence_length_stddev,
float flesch_kincaid_grade);

TextCompleter& add_word_vector(const WordVector& added_word_vector);
TextCompleter& add_word_vector(const std::vector<WordVector>& added_word_vectors);
TextCompleter& add_word_vector(const std::string& word, const Eigen::VectorXf& vector);
Expand Down
10 changes: 10 additions & 0 deletions src/lexocraft/llm/text_completion_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
#include <lexocraft/llm/text_completion.hpp>

namespace lc {
// --------------------------- General ---------------------------

TextCompleter& TextCompleter::start_new_section(float sentence_length_mean,
float sentence_length_stddev,
float flesch_kincaid_grade) {
this->context_memory = this->accumulate_context_memory(
sentence_length_mean, sentence_length_stddev, flesch_kincaid_grade);
return *this;
}

TextCompleter& TextCompleter::add_word_vector(const WordVector& added_word_vector) {
vector_database.add_word(added_word_vector);
return create_vector_subdatabases();
Expand Down

0 comments on commit 4d49c6e

Please sign in to comment.