| 54 | |
| 55 | static bool parse_double_list(const char * value, std::vector<double> & out) { |
| 56 | out.clear(); |
| 57 | if (!value || !*value) return false; |
| 58 | const char * p = value; |
| 59 | while (*p) { |
| 60 | char * end = nullptr; |
| 61 | double v = std::strtod(p, &end); |
| 62 | if (end == p) return false; |
| 63 | out.push_back(v); |
| 64 | if (*end == '\0') return true; |
| 65 | if (*end != ',') return false; |
| 66 | p = end + 1; |
| 67 | if (!*p) return false; |
| 68 | } |
| 69 | return !out.empty(); |
| 70 | } |
| 71 | |
| 72 | static void print_usage(const char * prog) { |
| 73 | std::fprintf(stderr, |
| 74 | "Usage: %s <model.gguf> [options]\n" |
no test coverage detected