mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-06-21 21:19:08 +00:00
Use the universal sep.
This commit is contained in:
parent
573e4e1f73
commit
a6ca45c9dd
@ -124,7 +124,7 @@ QString Download::downloadLocalModelsPath() const {
|
|||||||
void Download::setDownloadLocalModelsPath(const QString &modelPath) {
|
void Download::setDownloadLocalModelsPath(const QString &modelPath) {
|
||||||
QString filePath = (modelPath.startsWith("file://") ?
|
QString filePath = (modelPath.startsWith("file://") ?
|
||||||
QUrl(modelPath).toLocalFile() : modelPath);
|
QUrl(modelPath).toLocalFile() : modelPath);
|
||||||
QString canonical = QFileInfo(filePath).canonicalFilePath() + QDir::separator();
|
QString canonical = QFileInfo(filePath).canonicalFilePath() + "/";
|
||||||
if (m_downloadLocalModelsPath != canonical) {
|
if (m_downloadLocalModelsPath != canonical) {
|
||||||
m_downloadLocalModelsPath = canonical;
|
m_downloadLocalModelsPath = canonical;
|
||||||
emit downloadLocalModelsPathChanged();
|
emit downloadLocalModelsPathChanged();
|
||||||
@ -145,9 +145,9 @@ bool Download::isFirstStart() const
|
|||||||
QString Download::defaultLocalModelsPath() const
|
QString Download::defaultLocalModelsPath() const
|
||||||
{
|
{
|
||||||
QString localPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
|
QString localPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
|
||||||
+ QDir::separator();
|
+ "/";
|
||||||
QString testWritePath = localPath + QString("test_write.txt");
|
QString testWritePath = localPath + QString("test_write.txt");
|
||||||
QString canonicalLocalPath = QFileInfo(localPath).canonicalFilePath() + QDir::separator();
|
QString canonicalLocalPath = QFileInfo(localPath).canonicalFilePath() + "/";
|
||||||
QDir localDir(localPath);
|
QDir localDir(localPath);
|
||||||
if (!localDir.exists()) {
|
if (!localDir.exists()) {
|
||||||
if (!localDir.mkpath(localPath)) {
|
if (!localDir.mkpath(localPath)) {
|
||||||
|
6
llm.cpp
6
llm.cpp
@ -22,13 +22,13 @@ static LLModel::PromptContext s_ctx;
|
|||||||
static QString modelFilePath(const QString &modelName)
|
static QString modelFilePath(const QString &modelName)
|
||||||
{
|
{
|
||||||
QString appPath = QCoreApplication::applicationDirPath()
|
QString appPath = QCoreApplication::applicationDirPath()
|
||||||
+ QDir::separator() + "ggml-" + modelName + ".bin";
|
+ "/ggml-" + modelName + ".bin";
|
||||||
QFileInfo infoAppPath(appPath);
|
QFileInfo infoAppPath(appPath);
|
||||||
if (infoAppPath.exists())
|
if (infoAppPath.exists())
|
||||||
return appPath;
|
return appPath;
|
||||||
|
|
||||||
QString downloadPath = Download::globalInstance()->downloadLocalModelsPath()
|
QString downloadPath = Download::globalInstance()->downloadLocalModelsPath()
|
||||||
+ QDir::separator() + "ggml-" + modelName + ".bin";
|
+ "/ggml-" + modelName + ".bin";
|
||||||
|
|
||||||
QFileInfo infoLocalPath(downloadPath);
|
QFileInfo infoLocalPath(downloadPath);
|
||||||
if (infoLocalPath.exists())
|
if (infoLocalPath.exists())
|
||||||
@ -469,7 +469,7 @@ bool LLM::checkForUpdates() const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString fileName = QCoreApplication::applicationDirPath()
|
QString fileName = QCoreApplication::applicationDirPath()
|
||||||
+ QDir::separator() + ".." + QDir::separator() + tool;
|
+ "/../" + tool;
|
||||||
if (!QFileInfo::exists(fileName)) {
|
if (!QFileInfo::exists(fileName)) {
|
||||||
qDebug() << "Couldn't find tool at" << fileName << "so cannot check for updates!";
|
qDebug() << "Couldn't find tool at" << fileName << "so cannot check for updates!";
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user