#endif
#define LLAMA_MAX_URL_LENGTH 2084 // Maximum URL Length in Chrome: 2083
+// isatty
+#if defined(_WIN32)
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
using json = nlohmann::ordered_json;
std::initializer_list<enum llama_example> mmproj_examples = {
}
}
+static bool is_output_a_tty() {
+#if defined(_WIN32)
+ return _isatty(_fileno(stdout));
+#else
+ return isatty(1);
+#endif
+}
+
common_arg & common_arg::set_examples(std::initializer_list<enum llama_example> examples) {
this->examples = std::move(examples);
return *this;
return parts.scheme + "://" + (parts.user.empty() ? "" : "****:****@") + parts.host + parts.path;
}
-static void print_progress(size_t current, size_t total) { // TODO isatty
+static void print_progress(size_t current, size_t total) {
+ if (!is_output_a_tty()) {
+ return;
+ }
+
if (!total) {
return;
}