speculative decoding initial impl completed (+6 squashed commit)

Squashed commit:

[0a6306ca0] draft wip dont use (will be squashed)

[a758a1c9c] wip dont use (will be squashed)

[e1994d3ce] wip dont use

[f59690d68] wip

[77228147d] wip on spec decoding. dont use yet

[2445bca54] wip adding speculative decoding (+1 squashed commits)

Squashed commits:

[50e341bb7] wip adding speculative decoding
This commit is contained in:
Concedo 2024-11-27 00:16:51 +08:00
parent b9e99c69e8
commit f75bbb945f
9 changed files with 539 additions and 280 deletions

View file

@ -8,6 +8,7 @@
#include <locale>
#include <codecvt>
#include <sstream>
#include <ctime>
void utreplace(std::string & str, const std::string & needle, const std::string & replacement) {
@ -302,3 +303,14 @@ std::vector<uint8_t> kcpp_base64_decode(const std::string & encoded_string)
return ret;
}
std::string get_timestamp_str()
{
std::time_t t = std::time(nullptr);
std::tm* now = std::localtime(&t);
char buffer[16]; // Buffer to hold "hh:mm:ss" and null terminator
std::sprintf(buffer, "%02d:%02d:%02d", now->tm_hour, now->tm_min, now->tm_sec);
// Convert the buffer to a std::string
std::string timestamp(buffer);
return timestamp;
}