-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSophora.Common.pas
95 lines (73 loc) · 1.84 KB
/
Sophora.Common.pas
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{===============================================================================
___ _
/ __| ___ _ __| |_ ___ _ _ __ _ ™
\__ \/ _ \ '_ \ ' \/ _ \ '_/ _` |
|___/\___/ .__/_||_\___/_| \__,_|
|_|
AI Reasoning, Function-calling &
Knowledge Retrieval
Copyright © 2025-present tinyBigGAMES™ LLC
All Rights Reserved.
https://github.com/tinyBigGAMES/Sophora
See LICENSE file for license information
===============================================================================}
unit Sophora.Common;
{$I Sophora.Defines.inc}
interface
uses
WinApi.Windows,
System.SysUtils,
System.Classes,
System.Math,
System.IOUtils,
Sophora.CLibs,
Sophora.Utils,
Sophora.Console;
const
CsoSophoraVersion = '0.1.0';
CsoDefaultModelPath = 'C:/LLM/GGUF';
CsoDefaultModelFilename = 'deephermes-3-llama-3-8b-preview-abliterated-q4_k_m.gguf';
csoDefaultEmbeddingsModelFilename = 'bge-m3-q8_0.gguf';
CsoDefaultMainGPU = -1;
CsoDefaultGPULayers = -1;
CsoDefaultMaxContext = 1024*4;
CsoDefaultMaxThreads = -1;
type
{ TsoBaseObject }
TsoBaseObject = class
protected
FError: string;
public
constructor Create(); virtual;
destructor Destroy(); override;
procedure SetError(const AText: string; const AArgs: array of const); virtual;
function GetError(): string; virtual;
end;
implementation
{ TsoBaseObject }
constructor TsoBaseObject.Create();
begin
inherited;
end;
destructor TsoBaseObject.Destroy();
begin
inherited;
end;
procedure TsoBaseObject.SetError(const AText: string; const AArgs: array of const);
begin
FError := Format(AText, AArgs);
end;
function TsoBaseObject.GetError(): string;
begin
Result := FError;
end;
initialization
begin
ReportMemoryLeaksOnShutdown := True;
soUtils.UnitInit();
soConsole.UnitInit();
end;
finalization
begin
end;
end.