mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-20 12:44:51 +00: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"}},
|
"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;
|
static const auto &specs = EMBEDDING_MODEL_SPECS;
|
||||||
auto it = std::find_if(specs, std::end(specs),
|
auto it = std::find_if(specs, std::end(specs),
|
||||||
[&modelName](auto &spec) {
|
[&modelName](auto &spec) {
|
||||||
|
@ -94,7 +94,8 @@ void LLModelStore::destroy()
|
|||||||
m_availableModel.reset();
|
m_availableModel.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLModelInfo::resetModel(LlamaCppModel *cllm, ModelBackend *model) {
|
void LLModelInfo::resetModel(LlamaCppModel *cllm, ModelBackend *model)
|
||||||
|
{
|
||||||
this->model.reset(model);
|
this->model.reset(model);
|
||||||
fallbackReason.reset();
|
fallbackReason.reset();
|
||||||
emit cllm->loadedModelInfoChanged();
|
emit cllm->loadedModelInfoChanged();
|
||||||
@ -582,7 +583,7 @@ bool LlamaCppModel::loadNewModel(const ModelInfo &modelInfo, QVariantMap &modelL
|
|||||||
|
|
||||||
modelLoadProps.insert("$duration", modelLoadTimer.elapsed() / 1000.);
|
modelLoadProps.insert("$duration", modelLoadTimer.elapsed() / 1000.);
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
|
|
||||||
bool LlamaCppModel::isModelLoaded() const
|
bool LlamaCppModel::isModelLoaded() const
|
||||||
{
|
{
|
||||||
|
@ -514,16 +514,18 @@ ModelList::ModelList()
|
|||||||
QCoreApplication::instance()->installEventFilter(this);
|
QCoreApplication::instance()->installEventFilter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ModelList::compatibleModelNameHash(QUrl baseUrl, QString modelName) {
|
QString ModelList::compatibleModelNameHash(QUrl baseUrl, QString modelName)
|
||||||
|
{
|
||||||
QCryptographicHash sha256(QCryptographicHash::Sha256);
|
QCryptographicHash sha256(QCryptographicHash::Sha256);
|
||||||
sha256.addData((baseUrl.toString() + "_" + modelName).toUtf8());
|
sha256.addData((baseUrl.toString() + "_" + modelName).toUtf8());
|
||||||
return sha256.result().toHex();
|
return sha256.result().toHex();
|
||||||
};
|
}
|
||||||
|
|
||||||
QString ModelList::compatibleModelFilename(QUrl baseUrl, QString modelName) {
|
QString ModelList::compatibleModelFilename(QUrl baseUrl, QString modelName)
|
||||||
|
{
|
||||||
QString hash(compatibleModelNameHash(baseUrl, modelName));
|
QString hash(compatibleModelNameHash(baseUrl, modelName));
|
||||||
return QString(u"gpt4all-%1-capi.rmodel"_s).arg(hash);
|
return QString(u"gpt4all-%1-capi.rmodel"_s).arg(hash);
|
||||||
};
|
}
|
||||||
|
|
||||||
bool ModelList::eventFilter(QObject *obj, QEvent *ev)
|
bool ModelList::eventFilter(QObject *obj, QEvent *ev)
|
||||||
{
|
{
|
||||||
|
@ -99,7 +99,8 @@ Network *Network::globalInstance()
|
|||||||
return networkInstance();
|
return networkInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Network::isHttpUrlValid(QUrl url) {
|
bool Network::isHttpUrlValid(QUrl url)
|
||||||
|
{
|
||||||
if (!url.isValid())
|
if (!url.isValid())
|
||||||
return false;
|
return false;
|
||||||
QString scheme(url.scheme());
|
QString scheme(url.scheme());
|
||||||
|
Loading…
Reference in New Issue
Block a user