char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
b5ed0e058
char/aliceai-t5-moe
1// Console functions 2 3#pragma once 4 5#include "common.h" 6 7#include <functional> 8#include <string> 9#include <vector> 10 11enum display_type { 12DISPLAY_TYPE_RESET = 0 , 13DISPLAY_TYPE_INFO , 14DISPLAY_TYPE_PROMPT , 15DISPLAY_TYPE_REASONING , 16DISPLAY_TYPE_USER_INPUT , 17DISPLAY_TYPE_ERROR 18}; 19 20namespace console { 21void init (bool use_simple_io ,bool use_advanced_display ); 22void cleanup (); 23void set_display (display_type display ); 24bool readline (std ::string & line ,bool multiline_input ); 25 26using completion_callback = std ::function < std ::vector < std ::pair < std ::string ,size_t >>(std ::string_view ,size_t )> ; 27void set_completion_callback (completion_callback cb ); 28 29namespace spinner { 30void start (); 31void stop (); 32 } 33 34// note: the logging API below output directly to stdout 35// it can negatively impact performance if used on inference thread 36// only use in in a dedicated CLI thread 37// for logging in inference thread, use log.h instead 38 39LLAMA_COMMON_ATTRIBUTE_FORMAT (1 ,2 ) 40void log (const char * fmt , ...); 41 42LLAMA_COMMON_ATTRIBUTE_FORMAT (1 ,2 ) 43void error (const char * fmt , ...); 44 45void flush (); 46}