You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-38Lines changed: 31 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,56 +94,49 @@ LLamaSharp provides two ways to run inference: `LLamaExecutor` and `ChatSession`
94
94
usingLLama.Common;
95
95
usingLLama;
96
96
97
-
stringmodelPath="<Your model path>"; // change it to your own model path
98
-
varprompt="Transcript of a dialog, where the User interacts with an Assistant named Bob. Bob is helpful, kind, honest, good at writing, and never fails to answer the User's requests immediately and with precision.\r\n\r\nUser: Hello, Bob.\r\nBob: Hello. How may I help you today?\r\nUser: Please tell me the largest city in Europe.\r\nBob: Sure. The largest city in Europe is Moscow, the capital of Russia.\r\nUser:"; // use the "chat-with-bob" prompt here.
97
+
stringmodelPath=@"<Your Model Path>"; // change it to your own model path.
99
98
100
-
// Load a model
101
99
varparameters=newModelParams(modelPath)
102
100
{
103
-
ContextSize=1024,
104
-
Seed=1337,
105
-
GpuLayerCount=5
101
+
ContextSize=1024, // The longest length of chat as memory.
102
+
GpuLayerCount=5// How many layers to offload to GPU. Please adjust it according to your GPU memory.
// Add chat histories as prompt to tell AI how to act.
109
+
varchatHistory=newChatHistory();
110
+
chatHistory.AddMessage(AuthorRole.System, "Transcript of a dialog, where the User interacts with an Assistant named Bob. Bob is helpful, kind, honest, good at writing, and never fails to answer the User's requests immediately and with precision.");
0 commit comments