summarylogtreecommitdiffstats
path: root/002-install-and-load-localdocs-model-more-standardly.diff
blob: 46b06c60732ff1eadc612e0fc62b692e753790f2 (plain)
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
diff '--color=auto' -u a/gpt4all-chat/CMakeLists.txt b/gpt4all-chat/CMakeLists.txt
--- a/gpt4all-chat/CMakeLists.txt	2024-08-08 10:27:08.167174253 +0800
+++ b/gpt4all-chat/CMakeLists.txt	2024-08-08 10:30:07.805894482 +0800
@@ -391,7 +391,11 @@
     endif()
 endif()
 
-if (NOT APPLE)
+if (LINUX)
+    install(FILES "${CMAKE_BINARY_DIR}/resources/${LOCAL_EMBEDDING_MODEL}"
+            DESTINATION share/gpt4all/chat/resources
+            COMPONENT ${COMPONENT_NAME_MAIN})
+elseif (NOT APPLE)
     install(FILES "${CMAKE_BINARY_DIR}/resources/${LOCAL_EMBEDDING_MODEL}"
             DESTINATION resources
             COMPONENT ${COMPONENT_NAME_MAIN})
diff '--color=auto' -u a/gpt4all-chat/embllm.cpp b/gpt4all-chat/embllm.cpp
--- a/gpt4all-chat/embllm.cpp	2024-07-28 02:17:29.000000000 +0800
+++ b/gpt4all-chat/embllm.cpp	2024-08-08 10:31:41.736927471 +0800
@@ -79,8 +79,12 @@
 #ifdef Q_OS_DARWIN
     static const QString embPathFmt = u"%1/../Resources/%2"_s;
 #else
+#ifdef Q_OS_LINUX
+    static const QString embPathFmt = u"%1/../share/gpt4all/chat/resources/%2"_s;
+#else
     static const QString embPathFmt = u"%1/../resources/%2"_s;
-#endif
+#endif // Q_OS_LINUX
+#endif // Q_OS_DARWIN
 
     QString filePath = embPathFmt.arg(QCoreApplication::applicationDirPath(), LOCAL_EMBEDDING_MODEL);
     if (!QFileInfo::exists(filePath)) {