feat(core): 实现插件加载系统并优化日志管理
- 新增插件加载系统,支持从指定目录加载插件 - 引入log4j2日志框架,优化日志记录和管理 - 重构主程序启动逻辑,增加加载动画和系统信息输出 - 优化窗口样式和布局,提高用户体验
This commit is contained in:
@@ -2,6 +2,8 @@ package org.tzd.lm;
|
||||
|
||||
import com.axis.innovators.box.tools.FolderCreator;
|
||||
import com.axis.innovators.box.tools.LibraryLoad;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* LM推理类
|
||||
@@ -10,21 +12,32 @@ import com.axis.innovators.box.tools.LibraryLoad;
|
||||
public class LM {
|
||||
public static boolean CUDA = true;
|
||||
public final static String DEEP_SEEK = FolderCreator.getModelFolder() + "\\DeepSeek-R1-Distill-Qwen-1.5B-Q8_0.gguf";
|
||||
private static final Logger logger = LogManager.getLogger(LM.class);
|
||||
|
||||
static {
|
||||
if (!CUDA) {
|
||||
logger.warn("The cpu will be used for inference");
|
||||
LibraryLoad.loadLibrary("cpu/ggml-base");
|
||||
LibraryLoad.loadLibrary("cpu/ggml-cpu");
|
||||
LibraryLoad.loadLibrary("cpu/ggml");
|
||||
LibraryLoad.loadLibrary("cpu/llama");
|
||||
} else {
|
||||
LibraryLoad.loadLibrary("cuda/ggml-base");
|
||||
LibraryLoad.loadLibrary("cuda/ggml-cpu");
|
||||
LibraryLoad.loadLibrary("cuda/ggml-rpc");
|
||||
// cuda版本 cuda-cu12.4-x64(确保你有)
|
||||
LibraryLoad.loadLibrary("cuda/ggml-cuda");
|
||||
LibraryLoad.loadLibrary("cuda/ggml");
|
||||
LibraryLoad.loadLibrary("cuda/llama");
|
||||
try {
|
||||
LibraryLoad.loadLibrary("cuda/ggml-base");
|
||||
LibraryLoad.loadLibrary("cuda/ggml-cpu");
|
||||
LibraryLoad.loadLibrary("cuda/ggml-rpc");
|
||||
// cuda版本 cuda-cu12.4-x64(确保你有)
|
||||
LibraryLoad.loadLibrary("cuda/ggml-cuda");
|
||||
LibraryLoad.loadLibrary("cuda/ggml");
|
||||
LibraryLoad.loadLibrary("cuda/llama");
|
||||
} catch (Exception e) {
|
||||
logger.error("Wrong cuda Settings", e);
|
||||
logger.warn("The cuda library could not be loaded, the cpu will be used for inference");
|
||||
LibraryLoad.loadLibrary("cpu/ggml-base");
|
||||
LibraryLoad.loadLibrary("cpu/ggml-cpu");
|
||||
LibraryLoad.loadLibrary("cpu/ggml");
|
||||
LibraryLoad.loadLibrary("cpu/llama");
|
||||
}
|
||||
}
|
||||
LibraryLoad.loadLibrary("LM");
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
/**
|
||||
* 使用AI接口获取回复
|
||||
* @author tzdwindows 7
|
||||
*/
|
||||
public class LMApi {
|
||||
|
||||
Reference in New Issue
Block a user