mirror of
https://gitlab.com/niansa/anyproc.git
synced 2025-03-06 20:49:24 +01:00
Fixed example()
This commit is contained in:
parent
274c56547d
commit
5480e3df7c
1 changed files with 7 additions and 3 deletions
|
@ -52,7 +52,7 @@ public:
|
|||
: LM::Inference(weights_path, p) {}
|
||||
|
||||
auto& begin() {
|
||||
buffer += " ";
|
||||
buffer += ">>> ";
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -77,14 +77,18 @@ public:
|
|||
auto run(const std::function<bool (float)> &on_append_tick = nullptr, const std::function<bool (const char *generated)>& on_generation_tick = nullptr) {
|
||||
buffer += "\n";
|
||||
append(buffer, on_append_tick);
|
||||
static std::string f;
|
||||
f += buffer;
|
||||
std::cout << f << std::endl;
|
||||
buffer.clear();
|
||||
return LM::Inference::run("\n", on_generation_tick);
|
||||
auto fres = LM::Inference::run("\n", on_generation_tick);
|
||||
f += fres;
|
||||
return fres;
|
||||
}
|
||||
void example(std::string_view response) {
|
||||
buffer += "\n";
|
||||
buffer += response;
|
||||
if (!response.empty()) buffer += "\n";
|
||||
buffer += ">>>";
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue