|
203 | 203 |
|
204 | 204 | import { llama } from './completion.js';
|
205 | 205 | import { SchemaConverter } from './json-schema-to-grammar.mjs';
|
| 206 | + |
| 207 | + // load default session values and parameters |
| 208 | + import { session, params } from './params.js'; |
| 209 | + |
206 | 210 | let selected_image = false;
|
207 | 211 | var slot_id = -1;
|
208 | 212 |
|
209 |
| - const session = signal({ |
210 |
| - prompt: "This is a conversation between User and Llama, a friendly chatbot. Llama is helpful, kind, honest, good at writing, and never fails to answer any requests immediately and with precision.", |
211 |
| - template: "{{prompt}}\n\n{{history}}\n{{char}}:", |
212 |
| - historyTemplate: "{{name}}: {{message}}", |
213 |
| - transcript: [], |
214 |
| - type: "chat", // "chat" | "completion" |
215 |
| - char: "Llama", |
216 |
| - user: "User", |
217 |
| - image_selected: '' |
218 |
| - }) |
219 |
| - |
220 |
| - const params = signal({ |
221 |
| - n_predict: 400, |
222 |
| - temperature: 0.7, |
223 |
| - repeat_last_n: 256, // 0 = disable penalty, -1 = context size |
224 |
| - repeat_penalty: 1.18, // 1.0 = disabled |
225 |
| - penalize_nl: false, |
226 |
| - top_k: 40, // <= 0 to use vocab size |
227 |
| - top_p: 0.95, // 1.0 = disabled |
228 |
| - min_p: 0.05, // 0 = disabled |
229 |
| - tfs_z: 1.0, // 1.0 = disabled |
230 |
| - typical_p: 1.0, // 1.0 = disabled |
231 |
| - presence_penalty: 0.0, // 0.0 = disabled |
232 |
| - frequency_penalty: 0.0, // 0.0 = disabled |
233 |
| - mirostat: 0, // 0/1/2 |
234 |
| - mirostat_tau: 5, // target entropy |
235 |
| - mirostat_eta: 0.1, // learning rate |
236 |
| - grammar: '', |
237 |
| - n_probs: 0, // no completion_probabilities, |
238 |
| - min_keep: 0, // min probs from each sampler, |
239 |
| - image_data: [], |
240 |
| - cache_prompt: true, |
241 |
| - api_key: '' |
242 |
| - }) |
243 |
| - |
244 | 213 | /* START: Support for storing prompt templates and parameters in browsers LocalStorage */
|
245 | 214 |
|
246 | 215 | const local_storage_storageKey = "llamacpp_server_local_storage";
|
|
0 commit comments