Remove direct access to std streams from "run"

The goal is to allow running "run" while connected to other streams,
such as TCP sockets.

Signed-off-by: Thiago Padilha <thiago@padilha.cc>
This commit is contained in:
Thiago Padilha
2023-03-22 09:55:45 -03:00
parent b7f1fa6d8c
commit bf44faa0ee
3 changed files with 40 additions and 30 deletions

View File

@@ -1,6 +1,8 @@
#include "run.h"
#include "ggml.h"
#include <iostream>
std::vector<double> softmax(const std::vector<float>& logits) {
std::vector<double> probs(logits.size());
@@ -123,5 +125,5 @@ int main(int argc, char ** argv) {
exit(0);
}
return run(ctx, params);
return run(ctx, params, std::cin, stdout, stderr);
}