Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "../src/llama-sampling.h"

#include <cmath>
#include <cstring>
#include <unordered_map>
#include <algorithm>

Expand Down
6 changes: 4 additions & 2 deletions src/anu-qrng-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

// ANU QRNG API endpoint
static const char* ANU_API_HOST = "api.quantumnumbers.anu.edu.au";
#ifdef _WIN32
static const wchar_t* ANU_API_HOST_W = L"api.quantumnumbers.anu.edu.au";
#endif

ANUQRNGClient::ANUQRNGClient(const Config& config)
: config(config), stats(), initialized(false) {
Expand Down Expand Up @@ -374,7 +376,7 @@ int ANUQRNGClient::http_request_hex16(std::vector<uint8_t>& uint8_values) {

#else
// Linux/Mac implementation using libcurl
static size_t curl_write_callback(void* contents, size_t size, size_t nmemb, void* userp) {
static size_t anu_curl_write_callback(void* contents, size_t size, size_t nmemb, void* userp) {
size_t total_size = size * nmemb;
std::vector<uint8_t>* vec = static_cast<std::vector<uint8_t>*>(userp);
const uint8_t* data = static_cast<const uint8_t*>(contents);
Expand Down Expand Up @@ -406,7 +408,7 @@ int ANUQRNGClient::http_request_hex16(std::vector<uint8_t>& uint8_values) {

curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_write_callback);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, anu_curl_write_callback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &json_response);
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, config.timeout_ms);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
Expand Down
2 changes: 1 addition & 1 deletion src/llama-sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static void llama_token_data_array_partial_sort_inplace(llama_token_data_array *
cur_p->sorted = true;
}

static int llama_sample_dist(llama_token_data_array * cur_p, std::mt19937 & rng) {
static int llama_sample_dist(llama_token_data_array * cur_p, std::mt19937 & /*rng*/) {
double chance;

// Get quantum random value (fresh API call each time)
Expand Down