mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
cleanup function braces
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
39f5c53638
commit
05bd6042b6
@ -884,7 +884,8 @@ static const EmbModelGroup EMBEDDING_MODEL_SPECS[] {
|
||||
"multilingual-e5-large-instruct"}},
|
||||
};
|
||||
|
||||
static const EmbModelSpec *getEmbedSpec(const std::string &modelName) {
|
||||
static const EmbModelSpec *getEmbedSpec(const std::string &modelName)
|
||||
{
|
||||
static const auto &specs = EMBEDDING_MODEL_SPECS;
|
||||
auto it = std::find_if(specs, std::end(specs),
|
||||
[&modelName](auto &spec) {
|
||||
|
@ -94,7 +94,8 @@ void LLModelStore::destroy()
|
||||
m_availableModel.reset();
|
||||
}
|
||||
|
||||
void LLModelInfo::resetModel(LlamaCppModel *cllm, ModelBackend *model) {
|
||||
void LLModelInfo::resetModel(LlamaCppModel *cllm, ModelBackend *model)
|
||||
{
|
||||
this->model.reset(model);
|
||||
fallbackReason.reset();
|
||||
emit cllm->loadedModelInfoChanged();
|
||||
@ -582,7 +583,7 @@ bool LlamaCppModel::loadNewModel(const ModelInfo &modelInfo, QVariantMap &modelL
|
||||
|
||||
modelLoadProps.insert("$duration", modelLoadTimer.elapsed() / 1000.);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
bool LlamaCppModel::isModelLoaded() const
|
||||
{
|
||||
|
@ -514,16 +514,18 @@ ModelList::ModelList()
|
||||
QCoreApplication::instance()->installEventFilter(this);
|
||||
}
|
||||
|
||||
QString ModelList::compatibleModelNameHash(QUrl baseUrl, QString modelName) {
|
||||
QString ModelList::compatibleModelNameHash(QUrl baseUrl, QString modelName)
|
||||
{
|
||||
QCryptographicHash sha256(QCryptographicHash::Sha256);
|
||||
sha256.addData((baseUrl.toString() + "_" + modelName).toUtf8());
|
||||
return sha256.result().toHex();
|
||||
};
|
||||
}
|
||||
|
||||
QString ModelList::compatibleModelFilename(QUrl baseUrl, QString modelName) {
|
||||
QString ModelList::compatibleModelFilename(QUrl baseUrl, QString modelName)
|
||||
{
|
||||
QString hash(compatibleModelNameHash(baseUrl, modelName));
|
||||
return QString(u"gpt4all-%1-capi.rmodel"_s).arg(hash);
|
||||
};
|
||||
}
|
||||
|
||||
bool ModelList::eventFilter(QObject *obj, QEvent *ev)
|
||||
{
|
||||
|
@ -99,7 +99,8 @@ Network *Network::globalInstance()
|
||||
return networkInstance();
|
||||
}
|
||||
|
||||
bool Network::isHttpUrlValid(QUrl url) {
|
||||
bool Network::isHttpUrlValid(QUrl url)
|
||||
{
|
||||
if (!url.isValid())
|
||||
return false;
|
||||
QString scheme(url.scheme());
|
||||
|
Loading…
Reference in New Issue
Block a user