cleanup function braces

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel 2024-08-08 15:58:01 -04:00
parent 39f5c53638
commit 05bd6042b6
4 changed files with 13 additions and 8 deletions

View File

@ -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) {

View File

@ -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
{

View File

@ -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)
{

View File

@ -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());