-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodelmanager.h
More file actions
41 lines (31 loc) · 1.48 KB
/
Copy pathmodelmanager.h
File metadata and controls
41 lines (31 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <QString>
#include <QList>
// One selectable whisper model in the download catalog.
struct ModelInfo {
QString name; // file name / settings key, e.g. "ggml-base.en.bin"
QString label; // human-readable label for the settings combo
QString url; // download URL
QString sha256; // lowercase hex; empty = checksum not verified
qint64 size = 0; // expected size in bytes (0 = unknown), for display
bool multilingual = false; // false → English-only (.en); language fixed to "en"
};
// Resolves whisper model files and the download catalog.
//
// Path logic mirrors the translations loader (tsparser.cpp / loadBestTranslator):
// the per-user writable QStandardPaths::AppLocalDataLocation, here under a
// "models/" subdirectory so a user can drop a ggml model in by hand.
namespace ModelManager {
// Default model used on first run ("ggml-base.en.bin").
QString defaultModelName();
// Selectable models for the settings UI (default first).
QList<ModelInfo> catalog();
// Catalog entry for `name`, or the default entry if `name` is unknown/empty.
ModelInfo modelInfo(const QString& name);
// <AppLocalDataLocation>/models
QString modelsDir();
// Absolute path to a model file in modelsDir (defaultModelName() when empty).
QString modelFilePath(const QString& name = QString());
// True when the model file exists and is non-empty.
bool isModelAvailable(const QString& name = QString());
} // namespace ModelManager