#include <map>
#include <string>
#include <vector>
-#include <iostream>
-#include <unistd.h>
// default hparams (Dolly-V2 3B)
struct dollyv2_hparams {
std::mt19937 rng(params.seed);
if (params.prompt.empty()) {
- if( !isatty(STDIN_FILENO) ){
- std::string line;
- while( std::getline(std::cin, line) ){
- params.prompt = params.prompt + "\n" + line;
- }
- } else {
- params.prompt = gpt_random_prompt(rng);
- }
+ params.prompt = gpt_random_prompt(rng);
}
const std::string prompt = prompt_for_generation(params.prompt);
#include <map>
#include <string>
#include <vector>
-#include <iostream>
-#include <unistd.h>
// default hparams (GPT-2 117M)
struct gpt2_hparams {
std::mt19937 rng(params.seed);
if (params.prompt.empty()) {
- if( !isatty(STDIN_FILENO) ){
- std::string line;
- while( std::getline(std::cin, line) ){
- params.prompt = params.prompt + "\n" + line;
- }
- } else {
- params.prompt = gpt_random_prompt(rng);
- }
+ params.prompt = gpt_random_prompt(rng);
}
int64_t t_load_us = 0;
#include <map>
#include <string>
#include <vector>
-#include <iostream>
-#include <unistd.h>
// default hparams (GPT-J 6B)
struct gptj_hparams {
std::mt19937 rng(params.seed);
if (params.prompt.empty()) {
- if( !isatty(STDIN_FILENO) ){
- std::string line;
- while( std::getline(std::cin, line) ){
- params.prompt = params.prompt + "\n" + line;
- }
- } else {
- params.prompt = gpt_random_prompt(rng);
- }
+ params.prompt = gpt_random_prompt(rng);
}
int64_t t_load_us = 0;
#include <map>
#include <string>
#include <vector>
-#include <iostream>
-#include <unistd.h>
// default hparams (StableLM 3B)
struct gpt_neox_hparams {
std::mt19937 rng(params.seed);
if (params.prompt.empty()) {
- if( !isatty(STDIN_FILENO) ){
- std::string line;
- while( std::getline(std::cin, line) ){
- params.prompt = params.prompt + "\n" + line;
- }
- } else {
- params.prompt = gpt_random_prompt(rng);
- }
+ params.prompt = gpt_random_prompt(rng);
}
int64_t t_load_us = 0;
#include "common-ggml.h"
#include "common.h"
-#include <cassert>
#include <cmath>
#include <cstddef>
#include <cstdio>
-#include <cstring>
#include <fstream>
-#include <iostream>
+#include <cinttypes>
#include <map>
-#include <stdint.h>
#include <string>
-#include <unistd.h>
-#include <unordered_map>
#include <utility>
#include <vector>
const size_t memory_size = ggml_nbytes(model.memory_k) + ggml_nbytes(model.memory_v);
- printf("%s: memory_size = %8.2f MB, n_mem = %ld\n", __func__, memory_size / 1024.0 / 1024.0, n_mem);
+ printf("%s: memory_size = %8.2f MB, n_mem = %" PRId64 "\n", __func__, memory_size / 1024.0 / 1024.0, n_mem);
}
// load weights
std::mt19937 rng(params.seed);
if (params.prompt.empty()) {
- if (!isatty(STDIN_FILENO)) {
- std::string line;
- while (std::getline(std::cin, line)) {
- params.prompt = params.prompt + "\n" + line;
- }
- } else {
- params.prompt = gpt_random_prompt(rng);
- }
+ params.prompt = gpt_random_prompt(rng);
}
int64_t t_load_us = 0;
#include <cstdio>
#include <cstring>
#include <fstream>
-#include <iostream>
#include <map>
#include <stdint.h>
#include <string>
-#include <unistd.h>
#include <unordered_map>
#include <utility>
#include <vector>
std::mt19937 rng(params.seed);
if (params.prompt.empty()) {
- if (!isatty(STDIN_FILENO)) {
- std::string line;
- while (std::getline(std::cin, line)) {
- params.prompt = params.prompt + "\n" + line;
- }
- } else {
- params.prompt = gpt_random_prompt(rng);
- }
+ params.prompt = gpt_random_prompt(rng);
}
int64_t t_load_us = 0;
#include <map>
#include <string>
#include <vector>
-#include <iostream>
-#include <unistd.h>
// default hparams (GPT-2 117M)
// https://huggingface.co/bigcode/gpt_bigcode-santacoder/blob/main/config.json
std::mt19937 rng(params.seed);
if (params.prompt.empty()) {
- if( !isatty(STDIN_FILENO) ){
- std::string line;
- while( std::getline(std::cin, line) ){
- params.prompt = params.prompt + "\n" + line;
- }
- } else {
- params.prompt = gpt_random_prompt(rng);
- }
+ params.prompt = gpt_random_prompt(rng);
}
int64_t t_load_us = 0;